text
stringlengths
3.08k
10.4k
package main import ( "bufio" "flag" "net" "os" "sync" "github.com/projectdiscovery/gologger" "github.com/projectdiscovery/mapcidr" ) // Options contains cli options type Options struct { Slices int HostCount int Cidr string FileCidr string Silent bool Version bool Output string // No...
package main import ( "flag" "fmt" "github.com/PagerDuty/go-pagerduty" "os" "time" ) type onCall struct { engineer string minutes int64 shift string override bool } type engineerOverview struct { engineer string shifts map[string][]int64 override map[string][]int64 } func parsePDTime(timeString st...
package htpasswd import ( "io/ioutil" "os" "testing" "github.com/GehirnInc/crypt/apr1_crypt" "golang.org/x/crypto/bcrypt" ) func poe(err error) { if err != nil { panic(err) } } func getHashedPasswords() HashedPasswords { return HashedPasswords(map[string]string{ HashAPR1: "$apr1$qxYNc6nQ$yp9F.jioKu3yR...
package core // #cgo LDFLAGS: -lpruio -L"/usr/local/lib/freebasic/linux/" -lfb -lpthread -lprussdrv -ltermcap -lsupc++ -lpruio // #include "sensors.h" import "C" //import "errors" import "fmt" //import "unsafe" //import "log" //import "log/syslog" const sensorCount = 48 type Sensors struct { raw [80]C.int last...
package ffmpeg import ( "errors" "fmt" "github.com/golang/glog" "path" "path/filepath" "strconv" "strings" "unsafe" ) // #cgo pkg-config: libavformat libavfilter libavcodec libavutil libswscale gnutls // #include <stdlib.h> // #include "lpms_ffmpeg.h" import "C" var ErrTranscoderRes = errors.New("TranscoderI...
/* This demo shows what happens when you write to the shared memory wihtout syncing. You will read read bogus from memory! */ package main import ( "context" "flag" "fmt" "math" "math/rand" "strconv" "strings" "sync" "time" ) // Integer stores integer values. type Integer struct { i int32 s string } //...
/* 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 or agreed to in writi...
// Copyright 2021 VMware, Inc. // SPDX-License-Identifier: Apache-2.0 package sharing import ( "fmt" "sort" "strconv" "sync" "github.com/go-logr/logr" sg2v1alpha1 "github.com/vmware-tanzu/carvel-secretgen-controller/pkg/apis/secretgen2/v1alpha1" corev1 "k8s.io/api/core/v1" ) const ( // WeightAnnKey allows t...
package main import ( "fmt" "log" "os" "sort" "sync" "sync/atomic" "time" "github.com/kiteco/kiteco/kite-golib/diskmapindex" arg "github.com/alexflint/go-arg" "github.com/kiteco/kiteco/kite-go/lang/python/pythoncode" "github.com/kiteco/kiteco/kite-go/lang/python/pythonpipeline" "github.com/kiteco/kiteco/...
package main import ( "bytes" "errors" "fmt" "image/png" "io" "log" "os" "os/exec" "strings" "github.com/u-root/u-root/pkg/checker" "github.com/u-root/u-root/pkg/fb" "github.com/u-root/u-root/pkg/kmodule" "github.com/vishvananda/netlink" ) const ( // IFace is default usb networking interface IFaceName...
//go:generate goversioninfo -64 -o resource_windows.syso -icon app.ico package main //#cgo windows LDFLAGS: -L${SRCDIR}/../../../../windows/tensorflow/lib //#cgo windows LDFLAGS: -static-libgcc -static-libstdc++ -Wl,-Bstatic -lstdc++ -lpthread -Wl,-Bdynamic //#cgo linux LDFLAGS: -Wl,-rpath,$ORIGIN import "C" import ...
package goemits import ( "context" "fmt" "log" "sync" "github.com/go-redis/redis/v8" ) //Goemits defines main structure of the app type Goemits struct { //main client client *redis.Client //pubsub object pubsub *redis.PubSub //all of listeners listeners []string //triggers for events handlers map[string...
package p2p import ( "context" "errors" "fmt" "sync" "time" "github.com/gogo/protobuf/proto" "github.com/libp2p/go-libp2p-core/host" "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" "github.com/rs/zerolog" "github.com/rs/zerolog/log" "gitlab.com/thorchain/tss/go-tss/mess...
package sheep import ( "time" "github.com/lindsaygelle/nook" "github.com/lindsaygelle/nook/animal" "github.com/lindsaygelle/nook/character" "github.com/lindsaygelle/nook/gender" "github.com/lindsaygelle/nook/personality" "golang.org/x/text/language" ) var ( etoileBirthday = nook.Birthday{ Day: 25, Mont...
package bot import ( "fmt" "regexp" "strconv" log "github.com/sirupsen/logrus" ) type BlockRpc struct { Result string `json:"result"` } func (b *Bot) checkBlockBook(coin string) { uri := fmt.Sprintf("%s/api/", b.nConf.BlockBookBTC) if coin == "ETH" { uri = fmt.Sprintf("%s/api/", b.nConf.BlockBookETH) } r...
// Copyright (c) 2019 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...
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package elasticache import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" ) // Represents the input of a DescribeCacheSubnetGroups operation. // Please also see https://docs.aws.amazon.com/goto/We...
package tests import ( "fmt" "net/http" "testing" "github.com/gavv/httpexpect" "github.com/snowlyg/go-tenancy/g" "github.com/snowlyg/go-tenancy/tests/base" ) func TestBrandList(t *testing.T) { auth := base.BaseWithLoginTester(t) defer base.BaseLogOut(auth) brandList(auth, base.PageRes, base.PageKeys, http.S...
// Copyright 2018 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 lsp import ( "context" "strings" "golang.org/x/tools/internal/lsp/mod" "golang.org/x/tools/internal/lsp/protocol" "golang.org/x/tools/internal/ls...
/* Copyright 2020 <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 to in writing, software distrib...
/* Copyright 2019 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 goublu Options parses and stores user options for Goublu. package goublu import ( "bufio" "errors" "os" "reflect" "regexp" "strings" "github.com/jwoehr/gocui" ) // Options holds user options. type Options struct { UbluDir string SaveOutDir string BgColorIn gocui.Attribute FgColorIn gocui.A...
package bot import ( "context" "fmt" "os" "strconv" "sync" "time" "github.com/akshatmittal21/torrent-genie/constants" "github.com/akshatmittal21/torrent-genie/db" "github.com/akshatmittal21/torrent-genie/logger" "github.com/akshatmittal21/torrent-genie/torrent" tgbotapi "github.com/go-telegram-bot-api/tele...
// Package lfucache an in memory least frequently used (LFU) cache. // All operations have with O(1) complexity. // When evicting an item from the cache, // if 2 items have the same frequency the (least recently used) LRU item is evicted. // // Ideally, you should provide a wrapper around this class // to ensure strict...
// Copyright 2021 IBM Corporation // // 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 tekton import ( "fmt" "io/ioutil" "strings" "testing" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1" "github.com/tektoncd/pipeline/test/diff" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" k8s...
// Copyright 2016 <NAME>. // Package gowo provides a very simple but powerful worker pool package gowo import ( "fmt" "sync" "time" ) // Handler is the function that will be called by the handlers type Handler func(work interface{}) (result interface{}) // Job specifies the work required type Job struct { data ...
package main import ( lib "devstats" "encoding/json" "fmt" "strings" "time" ) func copySeries(ch chan bool, ctxI, ctxO *lib.Ctx, seriesName string) { // Connect to InfluxDB databases icI := lib.IDBConn(ctxI) icO := lib.IDBConn(ctxO) defer func() { lib.FatalOnError(icI.Close()) lib.FatalOnError(icO.Close(...
package main import ( "bytes" "reflect" "sort" "strings" "testing" ) func Test_fileName(t *testing.T) { type args struct { p string r int c int } tests := []struct { name string args args want string }{ { name: "test10x20", args: args{ p: "test", r: 10, c: 20, }, want: "...
package bear import ( "time" "github.com/lindsaygelle/nook" "github.com/lindsaygelle/nook/animal" "github.com/lindsaygelle/nook/character" "github.com/lindsaygelle/nook/gender" "github.com/lindsaygelle/nook/personality" "golang.org/x/text/language" ) var ( ikeBirthday = nook.Birthday{ Day: 16, Month: t...
// Copyright 2019-present Facebook // // 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 ...
package main import ( "fmt" "io/ioutil" "log" "net/http" "net/url" "os" "runtime" "strconv" "strings" "time" "gopkg.in/telegram-bot-api.v4" ) const version = "0.0" var authorizedIDTable = map[int]struct{}{} func main() { me := os.Args[0] log.Printf("%s: telegram bot version=%s runtime=%s GOMAXPROCS=...
package macaroon import ( "encoding/base64" "encoding/hex" "encoding/json" "fmt" "unicode/utf8" ) // macaroonJSONV1 defines the V1 JSON format for macaroons. type macaroonJSONV1 struct { Caveats []caveatJSONV1 `json:"caveats"` Location string `json:"location"` Identifier string `json:"ide...
// Package pgbalancer is a balancer of the postgres databases with RPS limiter. // > Requires golang version >= 1.9. // > Warning: This balancer is the client-side only, and it assumed that all nodes have been replicated by database-side. // // This package implements only four methods to select information from a clus...
package sandwich import ( "bytes" "errors" "net/http" "net/http/httptest" "os" "strings" "testing" "time" "github.com/augustoroman/sandwich/chain" ) type fakeClock struct { now time.Time advance time.Duration } func (f *fakeClock) Now() time.Time { now := f.now f.now = now.Add(f.advance) return no...
package movie_helper import ( "github.com/allanpk716/ChineseSubFinder/common" _interface "github.com/allanpk716/ChineseSubFinder/interface" "github.com/allanpk716/ChineseSubFinder/model" "github.com/allanpk716/ChineseSubFinder/sub_parser/ass" "github.com/allanpk716/ChineseSubFinder/sub_parser/srt" "github.com/ji...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: remove_flows_from_flow_set.proto package deviced 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 platformclientv2 import ( "time" "github.com/leekchan/timeutil" "encoding/json" "strconv" "strings" ) // Campaignrule type Campaignrule struct { // Id - The globally unique identifier for the object. Id *string `json:"id,omitempty"` // Name - The name of the CampaignRule. Name *string `json:"name,o...
package sqs import ( "errors" "os" "strconv" "sync" "time" libLogger "github.com/social9/go-queues/lib/logger" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/sqs" ) // SQSConfig Wrapper for SQSConfig me...
// Copyright 2015 The Serviced 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 ...
/* * GNU GLPK linear/mixed integer solver * short.c example on go */ package main /* #cgo CFLAGS: -I/usr/local/include/ #cgo LDFLAGS: -L/usr/local/lib -lglpk #include <glpk.h> #include <stdlib.h> */ import "C" import "unsafe" import ( "fmt" ) const () var () func main() { fmt.Println("hello") /* declare vari...
// Copyright © 2022 Cisco Systems, Inc. and its affiliates. // 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 //...
package apps import ( "bytes" "context" "fmt" "io" "github.com/banzaicloud/k8s-objectmatcher/patch" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "k8...
// Copyright © 2017 uMov.<NAME> <<EMAIL>> // // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of ...
package logs import ( "github.com/aws/aws-sdk-go/service/cloudwatchlogs" "github.com/stitchfix/flotilla-os/config" "github.com/stitchfix/flotilla-os/state" "os" "testing" ) type testLogsClient struct { t *testing.T calls []string nextTok string } func (tlc *testLogsClient) DescribeLogGroups(input *cl...
package blobs import ( "context" "fmt" "net/http" "strings" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/autorest/azure" "github.com/Azure/go-autorest/autorest/validation" "github.com/tombuildsstuff/giovanni/storage/internal/endpoints" "github.com/tombuildsstuff/giovanni/storage/inte...
package object import ( "container/list" "errors" "fmt" "github.com/nggenius/ngengine/core/rpc" "github.com/nggenius/ngengine/core/service" "github.com/nggenius/ngengine/utils" "github.com/nggenius/ngengine/share" ) type FactoryObject interface { Init(interface{}) Index() int SetIndex(int) SetObjId(mb rp...
/* Copyright 2020-2021 The UnDistro 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 cli import ( "fmt" "io/ioutil" "os" "path" rx "regexp" "strings" "text/template" "github.com/akutz/gotil" "github.com/spf13/cobra" flag "github.com/spf13/pflag" "github.com/rexray/rexray/util" ) func (c *CLI) initUsageTemplates() { var ut string utPath := path.Join(gotil.HomeDir(), util.DotDir...
package mongodb import ( "context" "fmt" "time" "github.com/go-ocf/cloud/cloud2cloud-connector/store" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" ) const resLinkedAccountCName = "linkedAccounts" type dbOAuth struct { LinkedCloudID string AccessToken string RefreshToken string ...
package transform import ( "fmt" "html/template" "strconv" "strings" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/kustomize/api/filesys" "sigs.k8s.io/kustomize/kyaml/yaml" ) // TransformFunc is the type of a transform function. A transformation must // return a T...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: hello.proto package pb import ( fmt "fmt" proto "github.com/golang/protobuf/proto" context "golang.org/x/net/context" grpc "google.golang.org/grpc" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Mars...
package server import ( "encoding/json" "fmt" "io/ioutil" "sort" "time" "github.com/vaitekunas/journal/logrpc" context "golang.org/x/net/context" ) // GatherStatistics saves log-related statistics func (l *logServer) GatherStatistics(service, instance, key, ip string, logEntry *logrpc.LogEntry) { l.Lock() ...
package compiler import ( "bytes" "fmt" "github.com/iancoleman/strcase" "strings" ) func getArgumentDataType(argument *endpointArgumentDefinition) string { return strcase.ToCamel(argument.UnitName) } func writeArgumentDefinition(w *bytes.Buffer, argument *endpointArgumentDefinition) { if argument.UnitName == "...
/* 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 under the License...
package controllers import ( "backend/models" "backend/utils" "encoding/json" "fmt" "io" "net/http" "strconv" "time" "github.com/bwmarrin/snowflake" jwt "github.com/golang-jwt/jwt" "golang.org/x/crypto/bcrypt" ) type Exception models.Exception type ErrorResponse struct { Err string } type error interfac...
// 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 wr...
package client import ( "github.com/rancher/norman/types" ) const ( WorkloadType = "workload" WorkloadFieldActiveDeadlineSeconds = "activeDeadlineSeconds" WorkloadFieldAnnotations = "annotations" WorkloadFieldAutomountServiceAccountToken = "automountServic...
package tcp import ( "github.com/26597925/EastCloud/pkg/logger" "github.com/26597925/EastCloud/pkg/network/common" "github.com/26597925/EastCloud/pkg/util/atomic" "github.com/26597925/EastCloud/pkg/util/timer" "io" "net" "time" ) type Server struct { msgHandler *common.MsgHandle connMgr *common.ConnManager ...
// Copyright (c) 2018 <NAME> // // Use of this source code is governed by The MIT License // that can be found in the LICENSE file. package filtering import ( "log" "reflect" "sync" "time" "unsafe" "github.com/iomz/go-llrp" ) // EngineFactory manages the FC's subscriptions and engine instances type EngineFact...
/* Copyright 2019 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 pwcompose import ( "encoding/json" "io/ioutil" "os" "os/exec" "path" "path/filepath" "go.uber.org/zap" "gopkg.in/yaml.v3" "pathwar.land/pathwar/v2/go/pkg/errcode" ) type PrepareOpts struct { ChallengeDir string Prefix string NoPush bool JSON bool Version string Logger ...
package api import( "os" "fmt" "github.com/yosmudge/graphatmo/config" log "github.com/Sirupsen/logrus" "golang.org/x/oauth2" "github.com/segmentio/go-prompt" "strings" "encoding/json" "os/user" yaml "github.com/go-yaml/yaml" "io/ioutil" "net/http" "net/url" ) type Api struct { Auth ...
// Copyright 2015 <NAME>. // Copyright 2019 <NAME>. // Use of this source code is governed by a zlib-style // license that can be found in the LICENSE file. // Simple service that only works by printing a log message every few seconds. package main import ( "bufio" "flag" "fmt" "io" "io/ioutil" "log" "os" "os...
// Copyright (c) 2021 PaddlePaddle 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...
package graphsplit import ( "context" "fmt" "os" "path" ipld "github.com/ipfs/go-ipld-format" logging "github.com/ipfs/go-log/v2" "golang.org/x/xerrors" ) var log = logging.Logger("graphsplit") type GraphBuildCallback interface { OnSuccess(node ipld.Node, graphName string) OnError(error) } type csvCallbac...
package verifyslack_test import ( "bytes" "crypto/hmac" "fmt" "io/ioutil" "net/http" "net/http/httptest" "strconv" "time" "github.com/coro/verifyslack" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" ) var _ = Describe("GenerateExpectedSignature", func() { When("the function is passed metadata abo...
/* Copyright 2022 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 models import ( "fmt" "sort" validate "kubecloud/common/validate" ) type ZcloudHarbor struct { ID int64 `orm:"pk;column(id);auto" json:"id"` HarborId string `orm:"column(harbor_id)" json:"harbor_id"` Tenant string `orm:"column(tenant)" json:"-"` HarborName string `or...
package model import ( "time" "github.com/SmallTianTian/dingtalk/model/taobao" ) func NewOapiAlitripBtripFlightOrderSearchRequest() *OapiAlitripBtripFlightOrderSearchRequest { return &OapiAlitripBtripFlightOrderSearchRequest{} } type OapiAlitripBtripFlightOrderSearchRequest struct { taobao.SimpleTaobaoRequest ...
// Package redis provides a Redis broker package redis import ( "context" "errors" "github.com/go-redis/redis/v8" "xmicro/broker" "xmicro/codec" "xmicro/codec/json" "xmicro/logger" ) // publication is an internal publication for the Redis broker. type publication struct { topic string message *broker.Messa...
/* * Copyright 2017-2019 Kopano and its licensors * * 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...
// 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
package context import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" "sync" "time" "github.com/Sirupsen/logrus" "github.com/juju/errors" "github.com/ernestoalejo/tfg-fn/pkg/kubernetes" ) type Backend struct { Process chan *Call latency chan int64 // Read only info of the backend call strin...
// Copyright 2021 <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 to in writi...
// Code generated by transpiler. DO NOT EDIT. /** * Go Video Downloader * * Copyright 2019 Tenta, 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.or...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: Enums.proto package Windmill 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 compile...
package eks import ( "context" "fmt" "os" "strings" "time" awsapicfn "github.com/aws/aws-k8s-tester/pkg/awsapi/cloudformation" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/cloudformation" "go.uber.org/zap" ) // TemplateClusterRole is the CloudFormation template for EKS cluster role. co...
package log import ( "fmt" "os" "path" "runtime" "strings" "time" ) // assert interface compliance. var _ Interface = (*Entry)(nil) // Now returns the current time. var Now = time.Now type CallerInfo struct { PathName string FileName string LineNo uint32 FuncName string } const ( thisPackageName = "lo...
/* Copyright © 2020 <NAME><<EMAIL>> 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, softwa...
package main import ( "fmt" "github.com/twinj/uuid" "github.com/killbill/kbcli" "github.com/killbill/kbcli/models/gen" "os" //"runtime" "time" "strconv" "strings" ) type Empty interface{} func makeTimestamp() int64 { return time.Now().UnixNano() / int64(time.Millisecond) } func generateRandomTestKey() str...
// Copyright 2016, <NAME>. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE.md file. // +build cgo // Package brotli implements the Brotli compressed data format using C wrappers. package brotli /* // This relies upon the shared library built from...
// Copyright 2017 Qubit Ltd. // // 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 2020 <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 to in writ...
package client import ( "context" "errors" "fmt" "time" "github.com/symcn/api" "k8s.io/client-go/dynamic" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/client-go/tools/record" "k8s.io/klog/v2" controllers "sigs.k8s.io/controller-runtime" rtcache "sigs.k8s.io/controller-runtime/pkg/cache" ...
/* Copyright 2019 The KubeCarrier 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 mvcc import ( "context" "testing" "github.com/treeverse/lakefs/catalog" "github.com/treeverse/lakefs/testutil" ) func TestCataloger_RollbackCommit_Basic(t *testing.T) { ctx := context.Background() c := testCataloger(t) repository := testCatalogerRepo(t, ctx, c, "repo", "master") files := []string{"f...
package main import ( "context" "fmt" "os" "path/filepath" "strings" "github.com/govim/govim" "github.com/govim/govim/cmd/govim/internal/fswatcher" "github.com/govim/govim/cmd/govim/internal/golang_org_x_tools/lsp/protocol" "github.com/govim/govim/cmd/govim/internal/golang_org_x_tools/span" ) type modWatche...
package backend import ( "bytes" "context" "crypto/rand" "encoding/json" "fmt" "path" "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" "github.com/aws/aws-sdk-go/service/s3/s3iface" "github.com/marcinwyszynski/secretservice" "github.com/marcinwyszynski/ssmvars" "github.com...
package cmd import ( "crypto/sha256" "encoding/hex" "fmt" "path/filepath" "sort" "strings" "github.com/spf13/cobra" "github.com/asuffield/ouro-tools/pkg/messagestore" ) var ( from string template string to string all bool ) func printSummary(s *messagestore.Store) { h := sha256.New() s...
package zcache import ( "sync" "time" ) type List struct { head *Item len int } func newList() *List { l := &List{ head: &Item{}, len: 0, } l.head.next = l.head l.head.prev = l.head return l } func (l *List) remove(i *Item) *Item { i.prev.next = i.next if i.next != nil { i.next.prev = i.prev } //...
/* Copyright © 2021 SignorMercurio 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, softwar...
package tengo import ( "fmt" "os" "testing" ) func TestMain(m *testing.M) { os.Exit(m.Run()) } func primaryKey(cols ...*Column) *Index { return &Index{ Name: "PRIMARY", Columns: cols, SubParts: make([]uint16, len(cols)), PrimaryKey: true, Unique: true, } } func aTable(nextAutoInc uint...
// Copyright 2022 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 renderer contains the data structure and functions required for the renderer. The renderer is the heart of fragment, it is the part which draws the lines and points according to the data provided by the other packages. */ package renderer import ( "image" "image/color" "image/png" "math" "os" "git...
package browserstack import ( "bytes" "context" "encoding/json" "errors" "fmt" "io/ioutil" "math/rand" "net/http" "strconv" "strings" "time" "github.com/mrhenry/web-tests/scripts/browserua" ) type Browser struct { Browser string `json:"browser"` BrowserVersion string ...
// // Copyright 2015 IBM Corp. 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 applicab...
package controller import ( "context" "github.com/meshplus/hyperbench/common" "github.com/meshplus/hyperbench/core/collector" "github.com/meshplus/hyperbench/core/controller/master" "github.com/meshplus/hyperbench/core/controller/worker" "github.com/meshplus/hyperbench/core/recorder" "github.com/op/go-logging" ...
// bench.go package main import ( "flag" "fmt" "log" "os" "sync" "text/tabwriter" "time" "cloud.google.com/go/pubsub" pubsublow "cloud.google.com/go/pubsub/apiv1" "golang.org/x/net/context" pubsubpb "google.golang.org/genproto/googleapis/pubsub/v1" ) const ( subscriptionName = "projects/gocloud-212523/su...
package genutil import ( "go/types" "testing" "github.com/stretchr/testify/require" "golang.org/x/tools/go/packages" ) const testPath = "github.com/olvrng/rbot/tools/genutil/testdata" var initialized bool var testPkg *packages.Package var testScope *types.Scope func initOnce(t *testing.T) { if initialized { ...