text
stringlengths
3.08k
10.4k
// Copyright 2020 Thinkium // // 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...
package testutil import ( "context" "fmt" "math/rand" "sync" "time" "github.com/filecoin-project/dealbot/controller/client" "github.com/filecoin-project/dealbot/tasks" "github.com/filecoin-project/go-fil-markets/storagemarket" logging "github.com/ipfs/go-log/v2" "github.com/urfave/cli/v2" "github.com/goog...
// Copyright (c) 2018 Cisco and/or its affiliates. // // 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 applicabl...
package aylien import ( "errors" "fmt" "math/rand" "strings" textapi "github.com/AYLIEN/aylien_textapi_go" "github.com/jonas747/dcmd" "github.com/jonas747/dstate" "github.com/mmuyskens/yagpdb/bot" "github.com/mmuyskens/yagpdb/commands" "github.com/mmuyskens/yagpdb/common" "github.com/mmuyskens/yagpdb/commo...
/* * Copyright 2015 <NAME> * Author: <NAME> <xuyuanp # gmail dot com> * * 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 req...
package invite import ( "context" "strconv" "strings" "time" "geeks-accelerator/oss/saas-starter-kit/internal/account" "geeks-accelerator/oss/saas-starter-kit/internal/platform/notify" "geeks-accelerator/oss/saas-starter-kit/internal/platform/web/webcontext" "geeks-accelerator/oss/saas-starter-kit/internal/us...
package pkcs12 import ( "bytes" "crypto/cipher" "crypto/x509/pkix" "encoding/asn1" "testing" ) func pbDecrypterFor(algorithm pkix.AlgorithmIdentifier, password []byte) (cipher.BlockMode, error) { algorithmName, supported := algByOID[algorithm.Algorithm.String()] if !supported { return nil, NotImplementedErro...
package cache import ( "context" "encoding/json" "errors" "fmt" "strconv" "time" "github.com/go-redis/redis/v8" ) // Common errors that might be returned by the cache package. var ( ErrNotFound = errors.New("key not found in cache") ErrNoTTLSet = errors.New("key does not have a TTL set") ) // Since we curr...
// Copyright 2018 ETH Zurich // // 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 wri...
package worker import ( "context" "fmt" "github.com/google/uuid" "log" "strconv" "sync" "time" ) //NewWorker is a constructor for #Worker and give //for user some default settings func NewWorker(name string, handle func(ctx context.Context) error, configs ...Config) *Worker { id, _ := uuid.NewUUID() w := &Wo...
// Copyright © 2014 Alienero. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package main import ( "bufio" "crypto/tls" "errors" "fmt" "net" "net/rpc" "runtime" "time" "github.com/Alienero/quick-know/mqtt" myrpc "github.com/Alien...
package launcher import ( "crypto/ecdsa" "crypto/rand" "fmt" "path" "strings" "github.com/ethereum/go-ethereum/cmd/utils" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/crypto" "gopkg.in/urfave/cli.v1" "github.com/millicentnetwork/go-opera/inter/validatorpk" "github.com/millicen...
package common /* import "github.com/psych0d0g/anirip/common" */ import ( "fmt" "io" "io/ioutil" "math/rand" "net/http" "net/http/cookiejar" "net/url" "regexp" "strconv" "strings" "time" "github.com/robertkrimen/otto" "s32x.com/anirip/common/log" "s32x.com/httpclient" ) const ( uaList = "https://ra...
package routing import ( "time" "github.com/eacsuite/lnd/routing/route" ) // missionControlState is an object that manages the internal mission control // state. Note that it isn't thread safe and synchronization needs to be // enforced externally. type missionControlState struct { // lastPairResult tracks the la...
package teams import ( "crypto/sha256" "fmt" "github.com/keybase/client/go/libkb" "github.com/keybase/client/go/protocol/keybase1" ) // -------------------------------------------------- // An operation that occurs simultaneously on the child and parent team chains. // This struct holds the child half of the op...
/* Copyright 2018 The Kubernetes 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, ...
package main import ( "bufio" "crypto/md5" "fmt" "os" "regexp" "strings" "github.com/shiena/ansicolor" ) const version = "0.1.0+Go" type ansiColorer func(color int) string type options struct { foreground ansiColorer background ansiColorer pattern string } type colorMode int const ( mode16Color col...
package dht import ( "bytes" "net" "sync" "time" "github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" "github.com/google/gopacket/routing" netroute "github.com/libp2p/go-netroute" ma "github.com/multiformats/go-multiaddr" manet "github...
/****************************************************** # DESC : getty interface # MAINTAINER : <NAME> # LICENCE : Apache License 2.0 # EMAIL : <EMAIL> # MOD : 2016-08-17 11:20 # FILE : getty.go ******************************************************/ package getty import ( "compress/flate"...
package cluster /* Copyright 2020 - 2021 Crunchy Data Solutions, 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 appli...
// // DISCLAIMER // // Copyright 2017 ArangoDB GmbH, Cologne, Germany // // 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 require...
// Code generated by azure-service-operator-codegen. DO NOT EDIT. // Copyright (c) Microsoft Corporation. // Licensed under the MIT license. package v1beta20201201 type RedisResource_StatusARM struct { // Id: Fully qualified resource ID for the resource. Ex - // /subscriptions/{subscriptionId}/resourceGroups/{resour...
package service import ( "bytes" "encoding/json" "fmt" "github.com/go-kit/kit/transport" "io" "io/ioutil" "net/http" "net/http/httptest" "os" "strconv" "testing" "github.com/fleetdm/fleet/v4/server/config" "github.com/fleetdm/fleet/v4/server/datastore/inmem" "github.com/fleetdm/fleet/v4/server/fleet" ...
package event import ( "fmt" "strconv" "sync" "github.com/assembla/cony" "github.com/json-iterator/go" "github.com/streadway/amqp" ) // Publisher can enqueue jobs. type Publisher struct { Namespace string // eg, "myapp-work" exchangeName string // 使用的 exchange name cli *cony.Client defaultExc ...
package helpers import ( "crypto/rand" "crypto/rsa" "crypto/x509" "crypto/x509/pkix" "encoding/json" "encoding/pem" "fmt" "io/ioutil" "math/big" "net/http" "os" "time" "github.com/go-http-utils/headers" "github.com/golang-jwt/jwt" "github.com/onsi/gomega" "github.com/onsi/gomega/ghttp" "gopkg.in/squa...
package auth import ( "crypto/rsa" "encoding/base64" "encoding/binary" "fmt" "log" "math/big" "time" "github.com/dgrijalva/jwt-go" ) var noVerificationWorningMessage = "JWT Token is not verified properly. Because you are running in 'NoVerification MODE'." // Authenticator はユーザー認証サービスです type Authenticator in...
package product import ( "context" "github.com/GGP1/adak/internal/params" "github.com/GGP1/adak/pkg/postgres" "github.com/GGP1/adak/pkg/review" "github.com/bradfitz/gomemcache/memcache" "github.com/jmoiron/sqlx" "github.com/pkg/errors" ) // Service provides product operations. type Service interface { Create...
package billing // Copyright (c) Microsoft and contributors. 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 // // Unl...
// Copyright (C) 2015 <NAME>. All Rights Reserved. // Package wirepb supports decoding raw wire-format protobuf messages, where // "raw" means the decoding is done without knowledge of the schema. package wirepb import ( "bufio" "encoding/binary" "fmt" "io" "math" ) // A Decoder consumes input from an io.Reader...
package main import ( "context" "fmt" "net" "os" "github.com/urfave/cli/v2" "go.opencensus.io/stats/view" "golang.org/x/xerrors" logging "github.com/ipfs/go-log/v2" "github.com/filecoin-project/go-jsonrpc" "github.com/filecoin-project/go-state-types/abi" manet "github.com/multiformats/go-multiaddr/net" ...
package master import ( "encoding/json" "errors" "gonum.org/v1/plot" "io/ioutil" "sync" "github.com/ipfs/go-ds-bench/options" "golang.org/x/tools/benchmark/parse" ) var ErrExists = errors.New("results for this bench already exist") var errDone = errors.New("done") type Series struct { Opts []options.Be...
package main import ( "flag" "fmt" "math/rand" "strings" "time" "github.com/stuarthu/go-implement-your-cache-server/cache-benchmark/cacheClient" ) type statistic struct { count int time time.Duration } type result struct { getCount int missCount int setCount int statBuckets []statistic } func ...
// Copyright © 2018 <NAME> <<EMAIL>> // // 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, publish...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: nullint.proto package nullint 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 a compil...
package utils import ( "encoding/json" "fmt" "io" "reflect" "sort" "strconv" "strings" log "github.com/sirupsen/logrus" "github.com/valyala/fasttemplate" argoappsv1 "github.com/argoproj/argo-cd/v2/pkg/apis/application/v1alpha1" argoappsetv1 "github.com/argoproj/argo-cd/v2/pkg/apis/applicationset/v1alpha1"...
package dtr import ( "testing" "time" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) const scanResultPayload = `[ { "namespace": "docker", "reponame": "nginx", "tag": "1.10", "critical": 8, "major": 25, "minor": 3, "last_scan_status": 6, "check_completed_at...
/* Copyright © 2019 VMware, Inc. All Rights Reserved. SPDX-License-Identifier: BSD-2-Clause */ package l10n import ( "bufio" "errors" "fmt" "io" "os" "strings" "time" "github.com/vmware/vsphere-automation-sdk-go/runtime/log" "golang.org/x/text/language" "golang.org/x/text/message/catalog" ) // Interfac...
// 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...
/* Copyright 2018 The Kubernetes 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, ...
// Copyright Istio 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 wri...
// Copyright (c) 2013 Couchbase, 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 in w...
package multistream import ( "crypto/sha256" "encoding/binary" "errors" "fmt" "math" "net" "sync" ) type RcvData struct { Length uint32 ErrId uint8 } type MSConn struct { net.Conn wlock sync.Mutex vConnCount int syncTunnel chan struct{} rcvs map[uint32]*chan *RcvData rcvLock sync.RWMutex } type MSDia...
package state import ( "context" "fmt" "github.com/dapr/components-contrib/state" "github.com/dapr/dapr/pkg/proto/common/v1" statev1pb "github.com/dapr/dapr/pkg/proto/state/v1" emptypb "google.golang.org/protobuf/types/known/emptypb" ) type GRPCServer struct { // this is the real implementation Impl state.St...
package ebpf import ( "fmt" "runtime" "unsafe" "github.com/cilium/ebpf" "github.com/cilium/ebpf/asm" "github.com/cilium/ebpf/link" "github.com/pkg/errors" "github.com/sirupsen/logrus" "golang.org/x/sys/unix" ) func nilCloser() error { return nil } func findAttachedCgroupDeviceFilters(dirFd int) ([]*ebpf.P...
/* Copyright SecureKey Technologies Inc. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package key import ( "crypto/ecdsa" "crypto/elliptic" "fmt" "regexp" "github.com/hyperledger/aries-framework-go/pkg/doc/did" "github.com/hyperledger/aries-framework-go/pkg/doc/jose/jwk/jwksupport" vdrapi "git...
package exchange import ( "fmt" "math/big" "strconv" "sync" common3 "github.com/ethereum/go-ethereum/common" "go.uber.org/zap" "github.com/KyberNetwork/reserve-data/common" commonv3 "github.com/KyberNetwork/reserve-data/reservesetting/common" "github.com/KyberNetwork/reserve-data/reservesetting/storage" ) ...
package main import ( "common" "fmt" "math" "time" ) const BenchmarkRaysCount = 10000000 func uniformSampleSphere() Vector64 { u1 := RandFloat64() u2 := RandFloat64() z := 1.0 - 2.0*u1 r := math.Sqrt(1.0 - z*z) phi := 2.0 * math.Pi * u2 x := r * math.Cos(phi) y := r * math.Sin(phi) return Vector64{x, y, ...
package parser import ( "errors" "fmt" "go/token" "os" "path/filepath" "strings" "unicode" "unicode/utf8" "github.com/emicklei/proto" ) type ( // DefaultProtoParser types a empty struct DefaultProtoParser struct{} ) // NewDefaultProtoParser creates a new instance func NewDefaultProtoParser() *DefaultProt...
/* Copyright 2017 WALLIX 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 distribu...
// Code generated by go-swagger; DO NOT EDIT. package models // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "encoding/json" "strconv" "github.com/go-openapi/errors" "github.com/go-openapi/strfmt" "github.com/go-opena...
// Use and distribution licensed under the Apache license version 2. // // See the COPYING file in the root project directory for full text. // package ghw import ( "fmt" "io/ioutil" "os" "path/filepath" "sort" "strconv" "strings" ) func (ctx *context) cachesForNode(nodeID int) ([]*MemoryCache, error) { // T...
package main // Load Tester for Network Sinks. // // Model load via N devices (connections) with each sending N msg/s. // // Algorithm // - N = number of devices // - msg = number of messages per second. // - T = 1/msg -> Time taken by 1 message to guarantee msg msgs/second. // - Payload = Payload in memory. (bytes) ...
package display import ( "github.com/nsf/termbox-go" "github.com/sjmudd/ps-top/event" "github.com/sjmudd/ps-top/lib" "github.com/sjmudd/ps-top/screen" "github.com/sjmudd/ps-top/version" ) // ScreenDisplay contains screen specific display information type ScreenDisplay struct { BaseDisplay // embedded screen ...
/* 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 spaghetti import ( "log" "syscall/js" n "github.com/lachee/noodle" ) // Library is the hook to the JS library var JS js.Value var cursorSize = Vector2{1, 1} var cursorHotspot = Vector2{-1, -3} var ( cameraPosition Vector3 pixelScale float32 hue float32 ) //Application handles the game. Put your...
// Code for generating pull lists as described in https://arvados.org/projects/arvados/wiki/Keep_Design_Doc#Pull-List package summary import ( "encoding/json" "fmt" "git.curoverse.com/arvados.git/sdk/go/blockdigest" "git.curoverse.com/arvados.git/sdk/go/keepclient" "git.curoverse.com/arvados.git/sdk/go/logger" ...
// Copyright 2021 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 ...
// +build amd64 package virtualmap import ( "errors" "path" "github.com/ataboo/go-metar-blink/pkg/common" "github.com/ataboo/go-metar-blink/pkg/geo" "github.com/ataboo/go-metar-blink/pkg/logger" "github.com/ataboo/go-metar-blink/pkg/stationrepo" "github.com/veandco/go-sdl2/sdl" "github.com/veandco/go-sdl2/tt...
/* Copyright SecureKey Technologies Inc. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package connection import ( "fmt" "github.com/cucumber/godog" "github.com/google/uuid" "github.com/hyperledger/aries-framework-go/pkg/client/connection" "github.com/hyperledger/aries-framework-go/pkg/client/di...
package kycstatus import ( "context" "fmt" "net/http" "regexp" "strings" "github.com/jmoiron/sqlx" "github.com/diamnet/go/services/regulated-assets-approval-server/internal/serve/httperror" "github.com/diamnet/go/support/errors" "github.com/diamnet/go/support/http/httpdecode" "github.com/diamnet/go/support/...
// Copyright (c) 2017 Tigera, 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 applica...
package rule import ( "bytes" "fmt" "go/ast" "go/printer" "go/token" "go/types" "regexp" "strings" "github.com/mgechev/revive/lint" ) const styleGuideBase = "https://golang.org/wiki/CodeReviewComments" // isBlank returns whether id is the blank identifier "_". // If id == nil, the answer is false. func isB...
// Copyright 2014 The Gogs Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package mailer import ( "encoding/hex" "errors" "fmt" "github.com/gogits/gogs/models" "github.com/gogits/gogs/modules/base" "github.com/gogits/gogs/mo...
// Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the Lice...
// this is a wrapper for https://github.com/AlecAivazis/survey package but with // additional extensions and customizations for glab // adapted from https://github.com/cli/cli/blob/trunk/pkg/surveyext/editor.go package surveyext import ( "bytes" "io" "io/ioutil" "os" "os/exec" "path/filepath" "runtime" "githu...
// Copyright 2019 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 ...
package command import ( "fmt" "io/ioutil" "os" "path/filepath" "sort" "strings" "github.com/ForceCLI/force/config" . "github.com/ForceCLI/force/error" . "github.com/ForceCLI/force/lib" ) var cmdExport = &Command{ Run: runExport, Usage: "export [options] [dir]", Short: "Export metadata to a local direc...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: remove_role_from_group.proto package identityd2 import ( fmt "fmt" _ "github.com/envoyproxy/protoc-gen-validate/validate" proto "github.com/golang/protobuf/proto" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var ...
package main import ( "flag" "fmt" "os" "os/exec" "path/filepath" "syscall" "time" "github.com/gogo/protobuf/proto" log "github.com/golang/glog" torchv1alpha1 "github.com/kubeflow/pytorch-operator/pkg/apis/pytorch/v1alpha1" torchjobclient "github.com/kubeflow/pytorch-operator/pkg/client/clientset/versioned...
package main // #cgo pkg-config: libevdev // #include <libevdev/libevdev.h> // #include <libevdev/libevdev-uinput.h> // #include <string.h> import "C" import ( "fmt" "os" "unsafe" ) // Absolute axis constants const ( AbsX Abs = C.ABS_X AbsY Abs = C.ABS_Y AbsRX Abs = C.ABS_RX AbsRY Abs = C.ABS_RY ) // Butto...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: defaultevaluator/messages.proto package defaultevaluator 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 _ = ma...
// Licensed to Elasticsearch B.V. under one or more contributor // license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright // ownership. Elasticsearch B.V. licenses this file to you under // the Apache License, Version 2.0 (the "License"); you may // not use ...
/* * Copyright (c) 2016 <NAME> <<EMAIL>> * Author: <NAME> <<EMAIL>> * * 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 * ...
package client import ( "bytes" "fmt" "math/rand" "os/exec" "time" "github.com/imdevlab/g/utils" "go.uber.org/zap" "github.com/imdevlab/g" "github.com/bsed/trace/agentd/misc" "github.com/bsed/trace/pkg/util" "github.com/valyala/fasthttp" ) var c = &fasthttp.Client{} type Client struct { StartTime ...
package main import ( "bufio" "flag" "fmt" "image" "os" "sort" "strings" "github.com/disintegration/imaging" "github.com/pfnet-research/go-menoh" ) func main() { const ( batch = 1 channel = 3 width = 224 height = 224 conv1_1InName = "140326425860192" fc6OutName = "140326200777584" ...
/* Copyright 2015 The Kubernetes 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 applicable law or ag...
package websockethub import ( "net/http" "github.com/gorilla/websocket" "github.com/iotaledger/hive.go/logger" "github.com/iotaledger/hive.go/typeutils" ) // Hub maintains the set of active clients and broadcasts messages to the clients. type Hub struct { // websocket Upgrader. upgrader *websocket.Upgrader ...
// Copyright (c) 2012 The Gocov Authors. // // 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, pub...
// Copyright 2016 The Upspin 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 usercache provides a KeyServer implementation that wraps // another and caches Lookups. // If a Lookup is made for the user that last Dialed the ...
// Copyright 2016 The Go 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 godash import ( "bytes" "encoding/gob" "encoding/json" "sort" "strings" "time" ) // reviewScale is the relative weight of a single review compa...
package rabbitmqworker import ( "context" "fmt" "log" "reflect" "sync" "github.com/golangid/candi/candihelper" "github.com/golangid/candi/codebase/factory" "github.com/golangid/candi/codebase/factory/types" "github.com/golangid/candi/logger" "github.com/golangid/candi/tracer" "github.com/streadway/amqp" ) ...
package config import ( "fmt" "strings" "time" "0chain.net/core/config" "github.com/spf13/viper" ) //SetupDefaultConfig - setup the default config options that can be overridden via the config file func SetupDefaultConfig() { viper.SetDefault("logging.level", "info") viper.SetDefault("contentref_cleaner.frequ...
package oval import ( "encoding/xml" "fmt" "sync" ) // ErrNotFound is returned by Lookup methods when the specified identifier is // not found. type ErrNotFound string func (e ErrNotFound) Error() string { return fmt.Sprintf("oval: identifier %q not found", string(e)) } // Root : root object type Root struct { ...
// Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved. // Code generated. DO NOT EDIT. package filestorage import ( "github.com/oracle/oci-go-sdk/common" "net/http" ) // ListFileSystemsRequest wrapper for the ListFileSystems operation type ListFileSystemsRequest struct { // The OCID of t...
// Copyright 2018-2020 CERN // // 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 wr...
package golidator import ( "fmt" "reflect" "strings" "unicode" ) // ValidationResult provides result of validation. type ValidationResult int const ( // ValidationNG means validation is failure. ValidationNG ValidationResult = iota // ValidationOK means validation is succeed. ValidationOK ) // Validator is ...
package eod import ( "fmt" "sort" "strings" ) const blueCircle = "🔵" func elems2txt(elems []string) string { for i, elem := range elems { elems[i] = strings.ToLower(elem) } sort.Strings(elems) return strings.Join(elems, "+") } func (b *EoD) combine(elems []string, m msg, rsp rsp) { lock.RLock() dat, exi...
// Copyright 2016 CoreOS, 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 in...
package main import ( "fmt" "log" "regexp" "strconv" "strings" "sync" "github.com/nickng/scribble-go-runtime/examples/httpget/httpget" "github.com/nickng/scribble-go-runtime/runtime/session" "github.com/nickng/scribble-go-runtime/runtime/transport" "github.com/nickng/scribble-go-runtime/runtime/transport/sh...
package main import ( "bufio" "context" "errors" "github.com/bsm/redislock" "github.com/go-redis/redis/v8" "go.guoyk.net/redmemd/memwire" "io" "log" "math/rand" "strconv" "strings" "time" ) var ( ErrNotStored = errors.New("not stored") ErrExists = errors.New("exists") ErrNotFound error ...
// Copyright The OpenTelemetry 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 ag...
package timeofday import ( "fmt" "strconv" "strings" "time" ) type TimeOfDay struct { hour int minute int loc *time.Location } func New(hour, minute int, loc *time.Location) (*TimeOfDay, error) { if hour < 0 || hour > 24 { return nil, fmt.Errorf("Hour integer must be between 0 and 24, inclusive") } ...
package main import ( "bufio" "flag" "fmt" "math/rand" "os" "strings" "time" "sconsify/infrastructure" "sconsify/rpc" "sconsify/sconsify" "sconsify/spotify" "sconsify/ui/noui" "sconsify/ui/simple" "github.com/howeyc/gopass" "runtime" "strconv" "sconsify/ui" "sconsify/webapi" ) var version string va...
/* Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserve. 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 fakeengine import ( "bufio" "bytes" "context" "io/ioutil" "github.com/docker/go-units" "github.com/projecteru2/core/engine" enginemocks "github.com/projecteru2/core/engine/mocks" enginetypes "github.com/projecteru2/core/engine/types" coretypes "github.com/projecteru2/core/types" "github.com/projecte...
package svc import ( "fmt" "io/ioutil" "net/http" "strconv" "strings" "time" "github.com/gin-gonic/gin" fsm "github.com/heqingy/TrashScheduler/fsm" log "github.com/sirupsen/logrus" ) type FSMConfig struct { fsm.Config StatePath string } type Config struct { Port int SMSConfig FSMConfig } type Service...
package main import ( "fmt" cloudevents "github.com/cloudevents/sdk-go/v2" // make sure to use v2 cloudevents here keptnv2 "github.com/keptn/go-utils/pkg/lib/v0_2_0" log "github.com/sirupsen/logrus" "io/ioutil" "os" "time" ) /** * Here are all the handler functions for the individual event * See https://github...
package monitoring import ( "bytes" "encoding/json" "errors" "fmt" "io/ioutil" "net/http" "strings" "time" "github.com/nttcom/ecl2mond/logging" "github.com/nttcom/ecl2mond/meter" "github.com/nttcom/ecl2mond/authenticate" "github.com/nttcom/ecl2mond/environment" ) var logger = logging.NewLogger("monitorin...
package main import ( "bufio" "fmt" "go_rt/core" "go_rt/entities" "go_rt/materials" "go_rt/maths" "log" "math" "math/rand" "os" ) func FindClosestCollision(ray *core.Ray, sceneEntities []entities.Entity) entities.RayHitResult { result := entities.RayHitResult{HasValue: false} closestTime := math.Max...
package geo import ( // "encoding/json" "fmt" "github.com/usmanager/registration-client-go" "gopkg.in/mgo.v2" "gopkg.in/mgo.v2/bson" "os" "os/signal" "syscall" // "io/ioutil" "log" "net" // "os" "time" "github.com/hailocab/go-geoindex" opentracing "github.com/opentracing/opentracing-go" "github.com/u...