text
stringlengths
3.08k
10.4k
package main import ( "context" "encoding/json" "fmt" "io" "log" "net/http" "os" "os/signal" "syscall" "time" "github.com/minio/minio-go" "github.com/rs/cors" // "github.com/auth0-community/go-auth0" jwtmiddleware "github.com/auth0/go-jwt-middleware" // jose "gopkg.in/square/go-jose.v2" ) const ( MI...
package base import ( "TeamTalk-go-flutter/server/src/base/improto" "bytes" "container/list" "encoding/binary" "github.com/golang/glog" "github.com/golang/protobuf/proto" "math" "net" "sync" "time" ) type Request struct { Header *ImPduHeader Message *proto.Message //Callback ResultCallback //NeedRe...
package value import ( "bytes" "fmt" "math" "strconv" "strings" ) type ScalarType int func (typ ScalarType) String() string { switch typ { case String: return "string" case Bool: return "bool" case Number: return "number" } return "<unknown>" } const ( String ScalarType = iota Bool Number ) typ...
package models import ( "bytes" "database/sql" "fmt" "strconv" "strings" ) // SearchOptions are options that can be passed to SearchSets for filtering // sets. type SearchOptions struct { // If len is 0, then it should be treated as if all statuses are good. Status []int Query string // Gamemodes to which l...
// Copyright © 2019 NAME HERE <EMAIL ADDRESS> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law ...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: google/ads/googleads/v0/resources/keyword_view.proto package resources // import "google.golang.org/genproto/googleapis/ads/googleads/v0/resources" import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" // Reference imports to s...
// Copyright 2019 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package request_test import ( "fmt" "sort" "strings" "testing" "time" "github.com/kylelemons/godebug/pretty" . "github.com/smartystreets/goconvey...
package swim import ( "os" "sync" "sync/atomic" "github.com/ganmacs/swim/logger" ) var log = logger.NewSimpleLogger(os.Stdout) type Swim struct { Name string nodeLock *sync.RWMutex nodeMap map[string]*Node nodeNum uint32 nodes []*Node probeIndex int Incarnation uint64 session *session c...
package timsort import ( "fmt" "math/rand" "sort" "testing" ) func TestSmokeTS(t *testing.T) { a := make([]interface{}, 3) a[0] = val{3, 0} a[1] = val{1, 1} a[2] = val{2, 2} TimSort(KeyLessThanSlice(a)) if !IsSorted(a, KeyOrderLessThan) { t.Error("not sorted") } } func TestSmokeStabilityTS(t *testing....
package circonus import ( "bytes" "fmt" "strings" "github.com/circonus-labs/circonus-gometrics/api/config" "github.com/hashicorp/errwrap" "github.com/hashicorp/terraform/helper/hashcode" "github.com/hashicorp/terraform/helper/schema" ) const ( // circonus_check.postgresql.* resource attribute names checkPos...
package notifications import ( "bytes" "context" "fmt" html "html/template" text "text/template" "time" "github.com/transcom/mymove/pkg/models" "github.com/gofrs/uuid" "github.com/transcom/mymove/pkg/assets" "github.com/gobuffalo/pop" "go.uber.org/zap" ) const surveyLink = "https://www.surveymonkey.com...
// Copyright (c) 2018 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge...
package boot import ( "os" "os/signal" "sync" "github.com/spf13/cobra" "github.com/the-anna-project/annad/object/config" servicespec "github.com/the-anna-project/spec/service" ) // New creates a new boot command. func New() *Command { command := &Command{} command.SetConfigCollection(config.NewCollection()...
package dusk import ( "bytes" "image" // Includes support for .png icons _ "image/png" // Includes support for .jpg, .jpeg icons _ "image/jpeg" // Includes support for .gif icons _ "image/gif" gl "github.com/go-gl/gl/v4.1-core/gl" "github.com/go-gl/glfw/v3.2/glfw" "github.com/go-gl/mathgl/mgl32" ) // Win...
// Code generated by go-swagger; DO NOT EDIT. package operations // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "context" "net/http" "time" "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.c...
package staticrender import ( "fmt" "io" "strings" "sync" // "golang.org/x/net/html" // "golang.org/x/net/html/atom" "github.com/vugu/html" "github.com/vugu/html/atom" "github.com/vugu/vugu" ) // caller should be able to just specify a directory, // or provide custom logic for how to give an exact io.Writer...
package main import ( "context" "fmt" "log" "net/http" "os" "os/signal" "path" "runtime" "sync" _ "net/http/pprof" "github.com/threefoldfoundation/tfchain/pkg/config" "github.com/threefoldfoundation/tfchain/pkg/persist" tfchaintypes "github.com/threefoldfoundation/tfchain/pkg/types" "github.com/rivine...
// Code generated by protoc-gen-go. // source: proxy.proto // DO NOT EDIT! /* Package pb is a generated protocol buffer package. It is generated from these files: proxy.proto It has these top-level messages: Message */ package pb import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" ...
package channel import ( "go-common/app/interface/main/app-card/model/card" "go-common/app/interface/main/app-channel/model" "go-common/app/interface/main/app-channel/model/tab" tag "go-common/app/interface/main/tag/model" "strconv" ) // Tab is type Tab struct { ID int64 `json:"id"` Name str...
// Copyright 2019 Liquidata, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to...
package ui import ( "bufio" "math" "os" "strconv" "strings" "github.com/faiface/beep" ) // Waveform has information of wave thined out type Waveform struct { Wave []int SampleInterval int WindowSize int HeightMax int ValMax float64 WaveDirPath string } // GenRawWave generat...
package datastructures import ( "sort" "github.com/google/go-cmp/cmp" ) // IDSet is a space-efficient set of integer identifiers. // // The correlation process creates many sets (e.g., range/moniker relations), most of which // contain a small handful of elements. There are a fewer number of sets which have a larg...
// +build cuda package nnops import ( "fmt" "hash" "github.com/chewxy/hm" "github.com/jeremypansier/gorgonia" "gorgonia.org/cu/dnn" t2cudnn "gorgonia.org/cu/dnn/interop" "gorgonia.org/tensor" ) type activation struct { *cudnn.Activation xDesc, yDesc *cudnn.TensorDescriptor } func newRelu() (*activation, e...
package server import ( "fmt" "reflect" "testing" "github.com/ahmetalpbalkan/wagl/rrstore" "github.com/miekg/dns" ) func TestHandleExternalOff(t *testing.T) { srv, ready := testServer(t, rrstore.New()) <-ready defer srv.Shutdown() if r, err := query(srv.Addr, "example.com", dns.TypeA); err != nil { t.Fat...
// Copyright 2016 Google Inc. All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ag...
package aws import ( "fmt" "os" "strings" "github.com/aws/aws-sdk-go/aws/arn" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/sts" "github.com/sirupsen/logrus" "github.com/openshift/rosa/pkg/arguments" rprtr "github.com/openshift/rosa/pkg/reporter" ) // JumpAccounts are the vario...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: openconfig_rib.proto package mt_proto import ( fmt "fmt" proto "github.com/golang/protobuf/proto" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is ...
package leetcode import ( "context" "encoding/json" "fmt" "html" "io" "log" "net/http" "os" "path/filepath" "github.com/jmoiron/sqlx" _ "github.com/mattn/go-sqlite3" ) // Config is the config for Repo. type Config struct { Path string Source string Lang string } // Valid check cfg.Path and cfg.Lan...
// // Copyright © 2011-2019 <NAME> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed t...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: services.proto package rpc import ( context "context" fmt "fmt" proto "github.com/golang/protobuf/proto" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" math "math" ) // Reference imports to s...
package server import ( "bufio" "context" "encoding/binary" "errors" "fmt" "io" "time" "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/protocol" "github.com/spacemeshos/go-spacemesh/codec" "github.com/spacemeshos/go-spacemesh/log" ) //...
package binlog import ( "encoding/binary" "fmt" "github.com/chrislusf/glog" "github.com/chrislusf/vasto/pb" "github.com/golang/protobuf/proto" "io" "os" "sync" ) type logSegmentFile struct { fullName string segment uint32 file *os.File offset int64 sizeBufForWrite []byt...
package main import ( "bytes" "crypto/hmac" "crypto/md5" "crypto/rand" "encoding/base64" "encoding/binary" "flag" "fmt" "log" "os" ) // Generate API key // Composition: // [1:algorithm version][4:deprecated (used to be application ID)][2:key sequence][1:isRoot][16:signature] = 24 bytes // convertible to ba...
/* Copyright The Helm Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software di...
package main import ( "flag" "fmt" "log" "os" "time" "github.com/rqlite/gorqlite" ) var ( addr = "http://rbox1:4001" leader string peers []string trace bool ) func init() { flag.StringVar(&addr, "addr", addr, "rqlite leader address") flag.BoolVar(&trace, "trace", false, "debug trace to stderr") } f...
// SPDX-License-Identifier: MIT // Copyright (c) 2020 <NAME> <<EMAIL>> package update import ( "encoding/binary" "fmt" "strconv" "strings" "unicode/utf16" "github.com/pkg/errors" ) type fileHeader struct { fileKey [4]byte apVID, apPID uint16 iapVID, iapPID uint16 wchars bool fwVersion ...
package transaction import ( "context" "errors" "fmt" "math/big" "strconv" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/crypto" "github.com/spf13/cobra" "github.com/tzero-dev/go-t0ken/cli" "github.com/tzero-dev/go-t0ken/commands/gas...
package internal import ( "context" "encoding/json" "fmt" "time" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver/mongo" ) type CommandOp struct { DB string `json:"db"` ID int `json:"id"` callback func(ctx context.Context, client *m...
package main_test import ( "fmt" "io/ioutil" "net" "net/http" "net/url" "os/exec" "regexp" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/onsi/gomega/gexec" "github.com/onsi/gomega/ghttp" "golang.org/x/oauth2" ) func EphemeralPort() (int, error) { const proto = "tcp" addr, err := ne...
// Copyright (c) 2019 Uber Technologies, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law o...
// Copyright 2016 Google Inc. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
package pgsrv import ( "context" "database/sql/driver" "fmt" parser "github.com/lfittl/pg_query_go" nodes "github.com/lfittl/pg_query_go/nodes" "github.com/panoplyio/pgsrv/protocol" "io" ) type query struct { transport *protocol.Transport queryer Queryer execer Execer sql string numCols int }...
// Copyright © 2016 Casa Platform // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to...
// Package gl provides a full Fyne render implementation using system OpenGL libraries. package gl import ( "fmt" "image" "fyne.io/fyne/v2" "fyne.io/fyne/v2/internal/driver" "fyne.io/fyne/v2/theme" ) var shaderSources = map[string][2][]byte{ "line": {shaderLineVert.StaticContent, shaderLineFrag.StaticCont...
package node import ( "context" log "github.com/sirupsen/logrus" "github.com/zourva/pareto/box" "github.com/zourva/pareto/env" "google.golang.org/grpc" "google.golang.org/grpc/keepalive" "google.golang.org/grpc/reflection" "google.golang.org/grpc/stats" "math" "net" "time" ) // ServerSideCallback defines t...
package upgrade import ( "fmt" "os" "github.com/pkg/errors" "github.com/stackrox/rox/generated/internalapi/central" "github.com/stackrox/rox/pkg/namespaces" appsV1 "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) var ( upgra...
package jike_sdk_go import ( "context" "encoding/json" "fmt" "time" ) const ( Posts = "/originalPosts" ) type CreatePostReq struct { PictureKeys []string `json:"pictureKeys"` SyncToPersonalUpdate bool `json:"syncToPersonalUpdate"` SubmitToTopic string `json:"submitToTopic"` Content ...
/* * Copyright 2022 InfAI (CC SES) * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed t...
// Code generated by go-swagger; DO NOT EDIT. package changes // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "context" "net/http" "time" "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/...
package commons import ( "fmt" "math" "time" "github.com/CapregSoft/go-prayer-time/constants" ) func FixAngle(angle float64) float64 { angle = angle - 360.0*(math.Floor(angle/360.0)) if angle < 0 { angle = angle + 360.0 } return angle } // range reduce hours to 0..23 func FixHour(hour float64) float64 {...
package agent import ( "context" "errors" "fmt" "io" "log" "net" "net/http" "strconv" "time" "github.com/gorilla/websocket" "github.com/snsinfu/go-taskch" "github.com/snsinfu/reverse-tunnel/config" "github.com/snsinfu/reverse-tunnel/ports" "github.com/snsinfu/reverse-tunnel/server/service" ) const ( r...
package storage import ( "database/sql" "github.com/Sirupsen/logrus" "github.com/endophage/gotuf/data" "github.com/go-sql-driver/mysql" ) // MySQLStorage implements a versioned store using a relational database. // The database table must look like: // CREATE TABLE `tuf_files` ( // `id` INT AUTO_INCREMENT, // ...
package tiff // A tiff image file contains one or more images. The metadata // of each image is contained in an Image File Directory (IFD), // which contains entries of 12 bytes each and is described // on page 14-16 of the specification. An IFD entry consists of // // - a tag, which describes the signification of th...
package requestparams import ( "time" "github.com/robfig/cron/v3" ) // CreateLeaveRequestParams : Param for user leave request type CreateLeaveRequestParams struct { LeaveRequest []LeaveRequest `json:"leave_request"` } // LeaveRequest : struct for leave request type LeaveRequest struct { OrgID in...
package e2e import ( "context" "reflect" "testing" "time" "github.com/oldsj/jenkins-operator/pkg/apis/jenkinsio/v1alpha1" "github.com/oldsj/jenkins-operator/pkg/controller/jenkins/configuration/user/seedjobs" "github.com/oldsj/jenkins-operator/pkg/controller/jenkins/plugins" "github.com/bndr/gojenkins" fram...
package auth import ( "bytes" "context" "errors" "fmt" "net/http" "text/template" "time" "cuelang.org/go/cue" "github.com/dgrijalva/jwt-go/v4" "github.com/google/uuid" "github.com/labstack/echo/v4" passwordvalidator "github.com/lane-c-wagner/go-password-validator" "golang.org/x/crypto/bcrypt" "gorm.io/g...
// Copyright 2016 The Upspin Authors. All rights reserved. // Copyright 2017 The Tapr Authors. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions // are met: // // * Redistributions of source code must re...
// MIT License // Copyright (c) 2017 <NAME> // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, p...
/* Copyright 2021. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed un...
package godiff // import "github.com/karrick/godiff" func reverse(list []string) { // Walk i forward from first index and l backwards from final index l := len(list) if l < 2 { return // done when 0 or 1 item in list } l-- var i int for i < l { list[i], list[l] = list[l], list[i] // swap elements i++ ...
package sinks import ( "context" "reflect" "testing" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/ssm" "github.com/aws/aws-sdk-go/service/ssm/ssmiface" "github.com/opsgenie/kubernetes-event-exporter/pkg/kube" v1 "k8s.io/apimachinery/pkg/ap...
/* * Copyright (c) 2021 NetEase Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or...
package galaga import ( "fmt" "time" "github.com/blackchip-org/pac8/pkg/machine" "github.com/blackchip-org/pac8/pkg/memory" "github.com/blackchip-org/pac8/pkg/pac8" "github.com/blackchip-org/pac8/pkg/proc" "github.com/blackchip-org/pac8/pkg/util/bits" "github.com/blackchip-org/pac8/pkg/util/state" "github.co...
package services import ( "errors" "net/http" "strconv" "strings" "github.com/jfrog/gofrog/parallel" rthttpclient "github.com/jfrog/jfrog-client-go/artifactory/httpclient" "github.com/jfrog/jfrog-client-go/artifactory/services/utils" "github.com/jfrog/jfrog-client-go/auth" clientutils "github.com/jfrog/jfrog...
package onkyoctl import ( "encoding/binary" "errors" ) const ( iscpStart = "!" unitTypeReceiver = "1" headerSize uint32 = 16 eISCPVersion byte = 0x01 terminator = "\r\n" cr = byte('\r') lf = byte('\n') eof ...
package tdigest_test import ( "math" "math/rand" "sort" "testing" "github.com/bsm/tdigest" . "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo/extensions/table" . "github.com/onsi/gomega" ) var _ = Describe("TDigest", func() { var blank, subject *tdigest.TDigest BeforeEach(func() { blank = seedTD() s...
package v3 import ( "encoding/json" "fmt" "io/ioutil" "path" "strings" "time" "github.com/cloudfoundry-incubator/cf-test-helpers/cf" "github.com/cloudfoundry-incubator/cf-test-helpers/generator" "github.com/cloudfoundry-incubator/cf-test-helpers/runner" "github.com/cloudfoundry/cf-acceptance-tests/helpers/a...
package sif import ( "fmt" "strings" "time" ) // ColumnType is an interface which is implemented to define a supported fixed-width column types. // Sif provides a variety of built-in types. Additional fixed-width types may not be created at this time. type ColumnType interface { Size() int // ...
// Copyright 2021, Pulumi Corporation. All rights reserved. package googleclient import ( "context" "fmt" "github.com/golang/glog" "github.com/pkg/errors" "golang.org/x/oauth2" "golang.org/x/oauth2/google" "google.golang.org/api/option" "google.golang.org/api/transport" ) type tokenSourceFunc func() (*oaut...
// Copyright 2021-Present Couchbase, Inc. // // Use of this software is governed by the Business Source License included in // the file licenses/BSL-Couchbase.txt. As of the Change Date specified in that // file, in accordance with the Business Source License, use of this software // will be governed by the Apache Lic...
package main import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net" "net/http" "os" "regexp" "time" "github.com/gorilla/mux" "github.com/nu7hatch/gouuid" "code.cloudfoundry.org/lager" ) type peerService struct { logger lager.Logger members *[]string heartbeat heartbeat values *map[string]s...
// Copyright 2014 The Cayley Authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by ap...
package main import ( "bytes" "flag" "fmt" "io" "log" "os" "strings" "text/template" "github.com/iancoleman/strcase" "github.com/markbates/pkger" "github.com/pdk/struct2json" ) var ( goFile string structName string instanceName string packageName string methodPrefix string methodSuffix stri...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: test.proto package protocol import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf type TestData ...
package proto import ( "time" ) // Header contains basic JSON headers, which // every message should have. type Header struct { SrcAddr string `json:"src_addr"` UUID string `json:"uuid"` // UUID of message (used for identifying images). } // FaceBox is tuple of 4 integers: top, right, bottom and left of image....
package main import ( "encoding/csv" "encoding/json" "fmt" "io" "io/ioutil" "log" "net/http" "os" "sync" "time" kingpin "gopkg.in/alecthomas/kingpin.v2" ) //TruMail is returned by trumail.io when an email is submitted. type TruMail struct { Address string `json:"address"` Username string `json:"u...
package common import ( "crypto/md5" "encoding/hex" "fmt" "io" "io/ioutil" "os" "strings" "time" "github.com/jucardi/go-db" "github.com/jucardi/go-db/logger" "github.com/jucardi/go-osx/paths" "github.com/jucardi/go-streams/streams" "gopkg.in/mgo.v2/bson" ) const ( MigrationRepo = "_migration" ) type M...
package handlers import ( "Orca/pkg/caching" "Orca/pkg/scanning" "context" "fmt" "github.com/google/go-github/v33/github" "log" ) type checkRunStatus string type checkRunConclusion string const ( checkRunStatusInProgress checkRunStatus = "in_progress" checkRunStatusCompleted checkRunStatus = "comp...
/* This lexer was inspired by https://www.youtube.com/watch?v=HxaD_trXwRE and adapted from https://github.com/golang/go/blob/master/src/text/template/parse/lex.go The lexer probably does more work than strictly necessary, especially the lexProperty method. ¯\_(ツ)_/¯ */ package parse import "fmt" // Pos is a positio...
package mgr import ( "context" "io" "strings" "sync" "time" "github.com/alibaba/pouch/apis/types" "github.com/alibaba/pouch/ctrd" "github.com/alibaba/pouch/daemon/config" "github.com/alibaba/pouch/pkg/errtypes" "github.com/alibaba/pouch/pkg/jsonstream" "github.com/alibaba/pouch/registry" "github.com/pkg/...
package cmd import ( "fmt" "math" "sort" "strings" "github.com/prometheus/client_golang/prometheus" ) type POSHistogram struct { bucket map[float64]uint64 count uint64 sum float64 labelKey []string labelValue []string } type POSHistogramCollector struct { desc *prometheus.Desc metri...
package mariadbplugin import ( "database/sql" "errors" "fmt" "z-notes/interfaces" ) //UpdatePermission creates or updates a pagepermission func (DBConnection *MariaDBPlugin) UpdatePermission(permission interfaces.UserPageAccess) error { if permission.PageID == 0 { return errors.New("Page ID not provided") } ...
package task import ( "database/sql" "errors" "fmt" "strings" "time" "unicode" "github.com/pingcap/parser/ast" "github.com/ibanyu/owl/service/sql_util" "github.com/ibanyu/owl/util/logger" ) type BackupDao interface { AddBackup(backup *OwlBackup) (int64, error) UpdateBackup(backup *OwlBackup) error GetBa...
package indexer import ( "fmt" "math" "reflect" "sync" ) // Index is a single index. type Index struct { keys []IndexElement m sync.RWMutex t reflect.Type less []Less } //Less defines a single less function for sorting. type Less func(e1, e2 IndexElement) (bool, error) //NewIndex creates an Index inst...
/* Copyright 2017 Authors All rights reserved */ package httpclient import ( "bytes" "crypto/tls" "io/ioutil" "net" "net/http" "time" http2 "build-booster/common/http" "build-booster/common/ssl" ) // HttpResponse define the information of the http response type HttpResponse struct { Reply []byte Stat...
package models import ( "strings" "time" ) // UbuntuCVEJSON : type UbuntuCVEJSON struct { PublicDateAtUSN time.Time CRD time.Time Candidate string PublicDate time.Time References []string Description string UbuntuDescription string Notes []string Bugs...
// Code generated by go-swagger; DO NOT EDIT. // Copyright 2020 SAP SE // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless re...
package common import ( "fmt" "regexp" "strconv" "strings" "github.com/0chain/errors" ) // A Key represents an identifier. It can be a pool ID, client ID, smart // contract address, etc. type Key string // A Size represents a size in bytes. type Size int64 func byteCountIEC(b int64) string { const unit = 102...
// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
// Copyright © 2022, Cisco Systems Inc. // Use of this source code is governed by an MIT-style license that can be // found in the LICENSE file or at https://opensource.org/licenses/MIT. package sqldbtest import ( "context" "cto-github.cisco.com/NFV-BU/go-msx/config" "cto-github.cisco.com/NFV-BU/go-msx/fs" "cto-g...
package server import ( "github.com/talbor49/HoneyBee/grammar" "log" ) const ( illegalRequestTemplate = "Illegal request by client, No such command '%d'" ) func checkRequirements(request grammar.Request, conn *DatabaseConnection, requestParamsLength int, requiresLogin bool, requiresBucket bool) (err byte) { if r...
// Copyright 2020 PingCAP, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to i...
package embedded import ( "net/http" "os" "path" "strconv" "strings" ) // Handler serves embedded handle to serve FileSystem type Handler interface { http.Handler // SetNotFoundHandler set a hander to be called for no found SetNotFoundHandler(http.Handler) // SetPermissionHandler set a hander to be called fo...
// Kernel is a simple microkernel that allows for Service's to be deployed within // an application. // // It manages the complete lifecycle of the application with muliple stages each // called in sequence: Init, PostInit, Start & Run. Once the kernel gets to the // Start phase then any error will cause the Stop phase...
package brokerage_server_ib import ( "encoding/json" "errors" "fmt" "strings" "sync" "time" "golang.org/x/time/rate" "github.com/dimfeld/ib" "github.com/inconshreveable/log15" jsoniter "github.com/json-iterator/go" "github.com/dimfeld/brokerage_server/types" ) const ( DEFAULT_GATEWAY = "localhost:...
/* Copyright SecureKey Technologies Inc. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package discovery import ( "testing" gcommon "github.com/hyperledger/fabric/gossip/common" "github.com/stretchr/testify/assert" "github.com/trustbloc/fabric-peer-ext/pkg/mocks" "github.com/trustbloc/fabric-peer...
/* Copyright 2019 Cisco Systems Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software d...
package main import ( "context" "log" "strings" "github.com/portto/solana-go-sdk/common" "github.com/portto/solana-go-sdk/pkg/pointer" "github.com/portto/solana-go-sdk/program/assotokenprog" "github.com/portto/solana-go-sdk/program/metaplex/tokenmeta" "github.com/portto/solana-go-sdk/program/sysprog" "github...
package ctrace import ( "io" "net/http" "sync" "github.com/Nordstrom/ctrace-go/core" "github.com/Nordstrom/ctrace-go/ext" "github.com/Nordstrom/ctrace-go/log" opentracing "github.com/opentracing/opentracing-go" ) // ******************* Http Client ******************* // TracedHTTPInterceptor is a defined f...
/* Copyright 2019 The Crossplane Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...