text
stringlengths
3.08k
10.4k
// https://en.wikipedia.org/wiki/Goertzel_algorithm // https://web.archive.org/web/20180628024641/http://en.dsplib.org/content/goertzel/goertzel.html // provides an efficient way to calculate a DFT term if we don't care about the full spectrum // it is slower than the FFT for the full frequency spectrum, but it is fast...
package main import ( "encoding/json" "fmt" "io" "io/ioutil" "log" "net/http" "os" "strings" "sync" "time" "code.google.com/p/go.net/websocket" ) var Version = "0.1.0" var ( dashboardUser = "admin" clientSecret = "" endpoints = make(map[string]*Endpoint) endpointsLock sync.Mutex clients =...
package trading import ( "encoding/json" "strconv" "bytes" "github.com/pkg/errors" ) type messageUserID uint64 func (u messageUserID) UInt64() uint64 { return uint64(u) } var userJsonPrefix = []byte(`"user_`) func (u messageUserID) MarshalJSON() ([]byte, error) { idBytes := []byte(strconv.FormatUint(uint64...
// Code generated by go-swagger; DO NOT EDIT. package extensions // 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 main import ( "crypto/aes" "crypto/sha256" "encoding/base64" "errors" "fmt" "gaen/export" "io" "io/ioutil" "strconv" "strings" "time" "golang.org/x/crypto/hkdf" "google.golang.org/protobuf/proto" ) // DecodeFromFile decodes a TemporaryExposureKeyExport binary file func DecodeFromFile(filename st...
package main import ( "fmt" "github.com/hashicorp/logutils" "github.com/theshamuel/go-flags" "github.com/theshamuel/hhchecker/app/config" "github.com/theshamuel/hhchecker/app/provider" "io" "log" "net/http" "os" "os/signal" "runtime" "strings" "syscall" "time" ) var opts struct { config.CommonOpts Ema...
package logger import ( "errors" "fmt" "log" "os" "path" "runtime" "strings" "time" ) // levels const ( debugLevel = 0 releaseLevel = 1 errorLevel = 2 fatalLevel = 3 ) const ( printDebugLevel = "[debug] " printReleaseLevel = "[release] " printErrorLevel = "[error] " printFatalLevel = "[fa...
package controller import ( "fmt" "gowork/config" "gowork/controller/common" "gowork/model" "gowork/utils" "net/http" "runtime" "strconv" "github.com/gin-gonic/gin" "github.com/shirou/gopsutil/cpu" "github.com/shirou/gopsutil/disk" "github.com/shirou/gopsutil/host" "github.com/shirou/gopsutil/mem" ) con...
package Hextranslate import ( "bufio" "container/list" "fmt" "os" "os/exec" "os/signal" "path/filepath" "strings" "syscall" "github.com/hexya-addons/web/odooproxy" ) func FatalError(str string, args ...interface{}) { fmt.Println(str) for _, a := range args { fmt.Println(a) } FtExit() } func FtExit()...
package util import ( "errors" "fmt" "os" "path/filepath" "strings" "gopkg.in/urfave/cli.v2" ) type Tool struct { *Logger Project Project } func NewTool(logger *Logger, project Project) (*Tool, error) { if project == nil { return nil, errors.New("Project is undefined") } t := &Tool{ Logger: logger,...
package network import ( "time" dc "github.com/fsouza/go-dockerclient" "github.com/elastic/beats/metricbeat/module/docker" ) type NETService struct { NetworkStatPerContainer map[string]map[string]NETRaw } type NetworkCalculator interface { getRxBytesPerSecond(newStats *NETRaw, oldStats *NETRaw) float64 getRx...
package hooks import ( "bytes" "context" "encoding/json" "fmt" "io/ioutil" "net/http" "sync" "time" "github.com/samkreter/go-core/log" "github.com/sirupsen/logrus" ) const ( timeFormat = "2006-01-02T15:04:05.000Z07:00" channelBufferSize = 1024 defaultHTTPClientTimeout = time.Second...
/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this f...
package main import ( "bytes" "crypto/md5" "encoding/json" "errors" "fmt" "io" "io/ioutil" "log" "net/http" "os" "strings" "sync" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" ) type batcher struct { batchChan chan *AuthEvent //...
package foon import ( "testing" "github.com/stretchr/testify/assert" "time" ) type embedded struct { ID string `foon:"id"` CreatedAt time.Time `foon:"createdAt"` UpdatedAt time.Time `foon:"updatedAt"` } type testNormal struct { __kind string `foon:"collection,KindTest"` ID string `foon:"id"` Name string `fi...
package hostnetsrv import ( "bufio" "encoding/json" "fmt" "io" "os" "path" "path/filepath" "strconv" "strings" "github.com/SyntropyNet/syntropy-agent/agent/common" "github.com/SyntropyNet/syntropy-agent/internal/config" "github.com/SyntropyNet/syntropy-agent/internal/logger" "github.com/google/go-cmp/cmp...
package xenstore import ( "atman/ring" "bytes" "encoding/binary" "io" "io/ioutil" "runtime" "strconv" "sync" "sync/atomic" "unsafe" ) type xenStore struct { port uint32 sync.Mutex req io.Writer rsp io.Reader requests map[uint32]chan *Response } var store *xenStore func init() { type xenstoreInter...
// Copyright 2020 Self Group Ltd. All Rights Reserved. package chat import ( "strings" "time" "github.com/google/uuid" "github.com/joinself/self-go-sdk/pkg/helpers" "github.com/joinself/self-go-sdk/pkg/ntp" ) func (s *Service) SelfID() string { return s.selfID } type MessageObject struct { Link string Name...
package sync import ( "crypto/tls" "crypto/x509" "fmt" "io/ioutil" "log" "net" "net/url" "strings" "time" "github.com/linksmart/hds-data-synchronizer/common" "github.com/linksmart/historical-datastore/data" "github.com/linksmart/historical-datastore/registry" "google.golang.org/grpc" "google.golang.org/...
package xnl import ( "fmt" "net" "time" "github.com/pboyd04/MotoGo/internal/moto/mototrbo" ) // PacketHandler is a function to handle a particular type of packet type PacketHandler func(Packet) bool // Client descripes a XNL Client type Client struct { client *mototrbo.Client id mototrbo...
package xre_test import ( "bytes" "fmt" "io" "strings" "testing" "unicode" "github.com/jcorbin/xre" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) type testEnv struct { xre.BufEnv } type cmdTestCase struct { name string cmd string proc string in interface{} out []byt...
package table import ( "fmt" "reflect" "testing" ) func TestParseRow(t *testing.T) { tests := []struct { s string wantRow row wantMerge bool }{ {``, nil, false}, {` `, nil, false}, {` `, nil, false}, {`a`, row{"a"}, false}, {`a `, row{"a"}, false}, {`a `, row{"a"}, false}, {` a`, ...
package fStrings import ( "reflect" "strings" "testing" ) func SplitN(s, sep string, n int) []string { switch { case n == 0: var ret []string return ret case s == "" && sep == "": return make([]string, 0) case n == 1: return []string{s} case s == sep: return []string{"", ""} case sep == "" || Index...
package netlink import ( "bytes" "encoding/binary" "fmt" "github.com/vishvananda/netlink/nl" "github.com/vishvananda/netns" "golang.org/x/sys/unix" ) type XfrmMsg interface { Type() nl.XfrmMsgType } type XfrmMsgExpire struct { XfrmState *XfrmState Hard bool } func (ue *XfrmMsgExpire) Type() nl.XfrmMs...
package controllers import ( "DeepWorkload/conf" "DeepWorkload/lib/redisgo" "DeepWorkload/models" "DeepWorkload/utils/graphics" "encoding/base64" "github.com/astaxie/beego" "github.com/qiniu/api.v7/v7/auth/qbox" "github.com/qiniu/api.v7/v7/storage" uuid "github.com/satori/go.uuid" "image/jpeg" "io/ioutil" ...
package install import ( "fmt" "os/exec" "strings" "time" "github.com/rancher/rio/cli/pkg/clicontext" "github.com/rancher/rio/modules/service/controllers/serviceset" "github.com/rancher/rio/pkg/constants" "github.com/rancher/rio/pkg/constructors" "github.com/rancher/rio/pkg/systemstack" v1 "k8s.io/api/core/...
package mylogger import ( "fmt" "os" "path" "time" ) type FileLogger struct { Level LogLevel //日志等级 filePath string //日志文件路径 fileName string //日志文件名 fileobj *os.File errFileobj *os.File maxFileSize int64 //最大文件个数 } //构造函数 func NewFileLogger(levelStr, fp, fn string, maxSize int64) *File...
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** package v1 import ( "context" "reflect" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // Gets environment details. func LookupEnvironment(ctx *pulumi.Context,...
package main import ( "crypto/sha1" "encoding/hex" "flag" "fmt" "io/ioutil" "log" "net/http" "os" "path/filepath" "time" "github.com/BurntSushi/toml" "github.com/PuerkitoBio/goquery" "github.com/sergi/go-diff/diffmatchpatch" ) type Config struct { Checker struct { CacheDir string `toml:"cache_f...
package error import ( "errors" "encoding/json" "github.com/lixiangyun/autoproxy/util" "os" ) // 系统内部错误码 var ( ERR_EXIST = errors.New("source exist") ERR_NO_EXIST = errors.New("source not exist") ERR_DB = errors.New("db connect fail") ERR_DATA = errors.New("data invaild") ERR_PARM = errors.New("param invaild...
package main import ( "context" "fmt" batchV1 "k8s.io/api/batch/v1" coreV1 "k8s.io/api/core/v1" metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" kubeInformers "k8s.io/client-go/informers" "k8s.io/client-go/informers/internalinterfaces" "...
package chain import ( "context" "errors" "gx/ipfs/QmR8BauakNcBa3RbE4nbQu76PDiJgoQgz8AJdhJuiU4TAw/go-cid" "gx/ipfs/QmRXf2uUSdGSunRJsM9wXSUNVwLUGCY3So5fAs7h2CBJVf/go-hamt-ipld" bstore "gx/<KEY>" "github.com/filecoin-project/go-filecoin/address" "github.com/filecoin-project/go-filecoin/consensus" "github.com/fi...
//go:build windows package environment import ( "errors" "oh-my-posh/regex" "strings" "syscall" "unicode/utf16" "unsafe" "golang.org/x/sys/windows" ) // win32 specific code // win32 dll load and function definitions var ( user32 = syscall.NewLazyDLL("user32.dll") procEnumWindows ...
// Copyright 2021 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 tcpproxy import ( "context" "errors" "io" "net" "net/http" "strings" "sync" "time" "github.com/kazeburo/the-rp/opts" "github.com/kazeburo/the-rp/upstream" "go.uber.org/zap" ) const ( bufferSize = 0xFFFF ) // Proxy proxy struct type Proxy struct { listener net.Listener upstream *upstrea...
package binance import ( "encoding/json" "errors" "github.com/nntaoli-project/goex" "github.com/nntaoli-project/goex/internal/logger" "net/http" "net/url" "os" "sort" "strings" "time" ) type FuturesWs struct { base *BinanceFutures f *goex.WsConn d *goex.WsConn depthCallFn func(depth *goex.Depth)...
package cmd import ( "fmt" "io" "strings" "github.com/jenkins-x/jx/pkg/apis/jenkins.io/v1" "github.com/jenkins-x/jx/pkg/jx/cmd/templates" "github.com/jenkins-x/jx/pkg/kube" "github.com/jenkins-x/jx/pkg/log" "github.com/jenkins-x/jx/pkg/util" "github.com/spf13/cobra" metav1 "k8s.io/apimachinery/pkg/apis/meta...
// 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...
// Copyright 2018 GRAIL, Inc. All rights reserved. // Use of this source code is governed by the Apache-2.0 // license that can be found in the LICENSE file. // The following enables go generate to generate the doc.go file. //go:generate go run v.io/x/lib/cmdline/gendoc "--build-cmd=go install" --copyright-notice= . -...
// The MIT License // // Copyright (c) 2020 Temporal Technologies Inc. All rights reserved. // // Copyright (c) 2020 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 Soft...
package freetds import ( "sync" "time" ) var poolExpiresInterval = 5 * time.Minute var poolCleanupInterval = time.Minute //ConnPool - connection pool for the maxCount connections. // //Connection can be acquired from the pool by pool.Get(). // //Release conn to the pool by caling conn.Close() or pool.Release(conn)...
package main import ( "flag" "fmt" "os" "os/exec" "strings" ) func use() { fmt.Fprintf(os.Stderr, "\nuse: bambam -o outdir -p package myGoSourceFile.go myGoSourceFile2.go ...\n") fmt.Fprintf(os.Stderr, " # Bambam makes it easy to use Capnproto serialization[1] from Go.\n") fmt.Fprintf(os.Stderr, " # B...
package kafka import ( "context" "fmt" "sync" "time" "github.com/gargath/pleiades/pkg/aggregator" "github.com/gargath/pleiades/pkg/log" "github.com/gargath/pleiades/pkg/util" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" "github.com/segmentio/kafk...
package executor import ( "fmt" "io" "io/ioutil" "runtime" "sort" "time" "github.com/aquasecurity/defsec/pkg/terraform" "github.com/aquasecurity/defsec/pkg/severity" "github.com/aquasecurity/defsec/pkg/state" "github.com/aquasecurity/defsec/pkg/scan" "github.com/aquasecurity/defsec/pkg/rules" "github...
package main import ( "math/rand" "bytes" "encoding/binary" "encoding/pem" "crypto/tls" "crypto/x509" "net" "io" "os" "io/ioutil" "log" "time" "compress/zlib" "strconv" "regexp" "fmt" ) var hostname string var hostport_re, _ = regexp.Compile("^(.+):([0-9]+)$") func init() { log.Prin...
package api import ( "bytes" "fmt" "io" "strconv" "strings" "time" ) // AutopilotConfiguration is used for querying/setting the Autopilot configuration. // Autopilot helps manage operator tasks related to Consul servers like removing // failed servers from the Raft quorum. type AutopilotConfiguration struct { ...
// Copyright 2020 The Cockroach Authors. // // Use of this software is governed by the Business Source License // included in the file licenses/BSL.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 License, ...
/* Copyright 2020 The Knative 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, soft...
package querier import ( "container/heap" "sort" "time" "github.com/prometheus/prometheus/storage" "github.com/weaveworks/cortex/pkg/chunk" ) // Limit on the window size of seeks. const window = 24 * time.Hour const chunkSize = 12 * time.Hour type chunkMergeIterator struct { its []*nonOverlappingIterator h ...
/* Package timez provides compact binary encoding of UTC time and time offset. A timez value encodes the UTC time with microsecond precision and the local time offset in a 64 bit unsigned integer. Both values can be retrieved independently. This makes timez a convenient stamp value in binary messages crossing local ti...
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** package v1beta import ( "context" "reflect" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // Gets details of a single Feature. func LookupFeature(ctx *pulumi....
/* Copyright 2016 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 cloudca import ( "strconv" "testing" "github.com/cloud-ca/gocca/mocks" "github.com/cloud-ca/gocca/mocks/services_mocks" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" ) const ( TEST_TEMPLATE_ID = "test_template_id" TEST_TEMPLATE_NAME = "test_templat...
// Copyright 2016 <NAME>. // Licensed under the MIT, see LICENCE file for details. package main import ( "bytes" "fmt" "reflect" "sort" "strings" "text/template" ) const ( TagSecret = "secret" TagEmail = "email" TagURL = "url" TagTel = "telephone" ) const ( HTMLFieldText = "text" HTMLFieldPas...
package commands import ( "fmt" "os" "github.com/docker/app/internal/packager" "github.com/docker/app/internal/image" "github.com/deislabs/cnab-go/driver" "github.com/docker/app/internal/cliopts" "github.com/deislabs/cnab-go/action" "github.com/deislabs/cnab-go/credentials" bdl "github.com/docker/app/inte...
// Copyright 2022 <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 ...
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. // See License.txt for license information. package storetest import ( "github.com/stretchr/testify/mock" "github.com/blastbao/mattermost-server/store" "github.com/blastbao/mattermost-server/store/storetest/mocks" ) // Store can be used to provi...
package heka_opentsdb_output import ( "bytes" "compress/gzip" "errors" "fmt" "github.com/mozilla-services/heka/pipeline" "gopkg.in/mgo.v2" "io/ioutil" "log" "net/http" "net/url" "runtime" "runtime/debug" "strings" "time" ) type timeoutTransport struct { *http.Transport Timeout time.Time } func (t *ti...
package middleware import ( "encoding/json" "errors" "github.com/KubeOperator/KubeOperator/pkg/auth" "github.com/KubeOperator/KubeOperator/pkg/db" "github.com/KubeOperator/KubeOperator/pkg/dto" "github.com/KubeOperator/KubeOperator/pkg/model" "github.com/KubeOperator/KubeOperator/pkg/permission" "github.com/Ku...
/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this fi...
package transport import ( "bytes" "encoding/json" "errors" "fmt" "net/http" "strconv" "strings" "github.com/LUSHDigital/microservice-core-golang/response" "github.com/LUSHDigital/microservice-core-golang/transport/models" transportErrors "github.com/LUSHDigital/microservice-core-golang/transport/errors" "...
package blockstore import ( "context" "fmt" "sync/atomic" "time" bloom "github.com/ipfs/bbloom" blocks "github.com/ipfs/go-block-format" "github.com/ipfs/go-cid" "github.com/ipfs/go-metrics-interface" ) // bloomCached returns a Blockstore that caches Has requests using a Bloom // filter. bloomSize is size of...
package orderbook import ( "encoding/json" "fmt" "testing" "time" "github.com/caeret/decimal" ) func TestOrderSide(t *testing.T) { ot := NewOrderSide() o1 := NewOrder( "order-1", Buy, decimal.New(10, 0), decimal.New(10, 0), time.Now().UTC(), ) o2 := NewOrder( "order-2", Buy, decimal.New(10...
/* * Copyright 2014 <NAME>, <NAME>, <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...
package tx_pool import ( "container/heap" "sort" "go-blockchain/blc" ) type PriceIndex struct { price uint64 index uint64 } type priceHeap []PriceIndex func (h priceHeap) Len() int { return len(h) } func (h priceHeap) Less(i, j int) bool { return h[i].price < h[j].price } func (h priceHeap) Swap(i, j int) ...
// ------------------------------------------------------------ // Copyright (c) Microsoft Corporation and Dapr Contributors. // Licensed under the MIT License. // ------------------------------------------------------------ package apns import ( "bytes" "context" "crypto/x509" "encoding/pem" "errors" "fmt" "n...
package build import ( "bytes" "encoding/binary" "fmt" "github.com/google/gopacket" "io" "strconv" ) const ( Port = 27017 Version = "0.1" CmdPort = "-p" ) type Mongodb struct { port int version string source map[string]*stream } type stream struct { packets chan *packet } type packet struct { is...
package playbook // import "github.com/docker/infrakit/pkg/cli/playbook" import ( "context" "fmt" "io" "net/url" "os" "path" "strings" "github.com/docker/infrakit/pkg/callable" "github.com/docker/infrakit/pkg/callable/backend" "github.com/docker/infrakit/pkg/cli" logutil "github.com/docker/infrakit/pkg/log...
// Copyright [2020] [thinkgos] // // 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 blobs import ( "context" "fmt" "testing" "time" "github.com/Azure/azure-sdk-for-go/profiles/latest/storage/mgmt/storage" "github.com/tombuildsstuff/giovanni/storage/2019-12-12/blob/containers" "github.com/tombuildsstuff/giovanni/storage/internal/auth" "github.com/tombuildsstuff/giovanni/testhelpers" )...
// 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 wri...
package daemon import ( "bytes" "context" "encoding/json" "fmt" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/zrepl/zrepl/daemon/job" "github.com/zrepl/zrepl/daemon/nethelpers" "github.com/zrepl/zrepl/logger" "github.com/zrepl/zrepl/version" "io" "net" "net/http" "t...
package k8s import ( "encoding/json" "fmt" "strconv" "strings" "github.com/deviceinsight/kafkactl/internal/env" "github.com/deviceinsight/kafkactl/internal" "github.com/deviceinsight/kafkactl/output" "github.com/pkg/errors" "github.com/spf13/cobra" "github.com/spf13/pflag" ) var KafkaCtlVersion string ty...
package load // import "github.com/docker/docker/internal/test/fixtures/load" import ( "bufio" "bytes" "context" "os" "os/exec" "path/filepath" "strings" "sync" "github.com/docker/docker/api/types" "github.com/docker/docker/client" "github.com/docker/docker/pkg/jsonmessage" "github.com/docker/docker/pkg/t...
// Copyright 2011 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 sync import ( "internal/race" "sync/atomic" "unsafe" ) // A WaitGroup waits for a collection of goroutines to finish. // The main goroutine calls A...
package extractor import ( "fmt" "time" "github.com/CubicrootXYZ/openapi-code-sample-generator/internal/errors" "github.com/CubicrootXYZ/openapi-code-sample-generator/internal/helper" "github.com/CubicrootXYZ/openapi-code-sample-generator/internal/log" "github.com/CubicrootXYZ/openapi-code-sample-generator/inte...
package dnscrypt import ( "crypto/rand" "encoding/binary" "time" "golang.org/x/crypto/ed25519" "golang.org/x/crypto/nacl/box" ) // Magic protocol bytes. const ( certMagic = "DNSC" protocolMinorVersion = "\x00\x00" x25519XSalsa20Poly1305 = "\x00\x01" x25519XChacha20Poly1305 = "\x00\x02" ) ...
//go:build integrationtest // +build integrationtest package integrationtest import ( "fmt" "testing" "time" storkv1 "github.com/libopenstorage/stork/pkg/apis/stork/v1alpha1" "github.com/portworx/sched-ops/k8s/core" storkops "github.com/portworx/sched-ops/k8s/stork" "github.com/portworx/sched-ops/task" "gith...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: spire/types/jointoken.proto package types 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...
// Copyright 2016 Landonia Ltd. All rights reserved. package proxy import ( "crypto/tls" "errors" "fmt" "net" "os" "strconv" "strings" "github.com/iris-contrib/letsencrypt" "golang.org/x/crypto/acme/autocert" ) // Default values for base Server conf const ( // DefaultSSLAddr return the default SSL addr to...
package generator import ( "bytes" "errors" "fmt" "io/ioutil" "os" "os/exec" "path" "sort" "strings" "text/template" "go.mercari.io/yo/internal" templates "go.mercari.io/yo/tplbin" ) // Loader is the common interface for database drivers that can generate code // from a database schema. type Loader inter...
package db import ( "net/http" "strings" sgbucket "github.com/couchbase/sg-bucket" "github.com/couchbase/sync_gateway/auth" "github.com/couchbase/sync_gateway/base" ch "github.com/couchbase/sync_gateway/channels" ) type DesignDoc sgbucket.DesignDoc const ( DesignDocSyncGateway = "sync_gateway" DesignDo...
package handler import ( "context" "fmt" kedav1alpha1 "github.com/kedacore/keda/pkg/apis/keda/v1alpha1" version "github.com/kedacore/keda/version" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/p...
// Package wkbcommon contains code common to WKB and EWKB encoding. package wkbcommon import ( "encoding/binary" "fmt" "io" ) // Byte order IDs. const ( XDRID = 0 NDRID = 1 ) // Byte orders. var ( XDR = binary.BigEndian NDR = binary.LittleEndian ) // An ErrUnknownByteOrder is returned when an unknown byte or...
package ginkgo import ( "bytes" "context" "fmt" "io" "os" "os/exec" "sort" "strings" "sync" "syscall" "time" "github.com/openshift/origin/pkg/monitor" ) type testStatus struct { out io.Writer timeout time.Duration monitor monitor.Interface env []string afterTestFn func(t *testCase) includ...
package odoo import ( "context" "io/ioutil" "math/rand" "net/http" "net/http/httptest" "net/url" "strconv" "testing" "github.com/go-logr/logr" "github.com/go-logr/zapr" "github.com/google/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.uber.org/zap/zapcore" "go.uber...
// +build !windows package well import ( "context" "errors" "io" "net" "os" "os/exec" "os/signal" "strconv" "syscall" "time" "github.com/cybozu-go/log" ) const ( listenEnv = "CYBOZU_LISTEN_FDS" restartWait = 10 * time.Millisecond ) func isMaster() bool { return len(os.Getenv(listenEnv)) == 0 } type...
/* Copyright 2021 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 ( "fmt" "math/rand" "net/http" "time" "github.com/gin-gonic/gin" postgres "gorm.io/driver/postgres" "gorm.io/gorm" "gorm.io/gorm/logger" ) // World represents an entry int the World table type World struct { ID int64 `json:"id"` RandomNumber int64 `json:"randomNumber" gorm:"co...
package securitytest import ( "errors" "strings" "time" apiContext "github.com/globocom/huskyCI/api/context" huskydocker "github.com/globocom/huskyCI/api/dockers" "github.com/globocom/huskyCI/api/log" "github.com/globocom/huskyCI/api/types" "github.com/globocom/huskyCI/api/util" ) var securityTestAnalyze = m...
package main import ( "context" "fmt" "net/http" "os" "os/exec" "strconv" "strings" "text/template" "time" "github.com/docker/cli/cli/connhelper" "github.com/docker/docker/api/types" "github.com/docker/docker/client" "github.com/google/go-cmp/cmp" ) type ServiceEntry struct { ServiceName string...
// Licensed to the Apache Software Foundation (ASF) under one or more // contributor license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright ownership. // The ASF licenses this file to You under the Apache License, Version 2.0 // (the "License"); you may not...
//+build windows package windows import ( "context" "fmt" "os" "path/filepath" "strings" "github.com/Microsoft/hcsshim" "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/log" specs "github.com/opencontainers/runtime-spec/specs-go" "github.com/pkg/errors" ) // newContainerConfig ...
// Copyright 2020 The Lokomotive 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 cmd import ( "bufio" "context" "fmt" "io" "io/ioutil" "log" "os" "path/filepath" "strings" "github.com/cheggaaa/pb/v3" qrterminal "github.com/mdp/qrterminal/v3" "github.com/psanford/wormhole-william/wormhole" "github.com/spf13/cobra" ) var ( codeLen int codeFlag string sendTextFlag s...
package controller import ( "fmt" "io" "os" "path/filepath" "runtime" "sort" "strings" "github.com/sirupsen/logrus" "github.com/suzuki-shunsuke/go-findconfig/findconfig" "github.com/suzuki-shunsuke/logrus-error/logerr" "gopkg.in/yaml.v2" ) type Package struct { Name string `validate:"required"` Regi...
package render import ( "bytes" "fmt" "path" "strings" "github.com/buger/jsonparser" "github.com/ghodss/yaml" "github.com/golang/glog" "k8s.io/helm/pkg/chartutil" "k8s.io/helm/pkg/engine" "k8s.io/helm/pkg/hooks" chartapi "k8s.io/helm/pkg/proto/hapi/chart" "k8s.io/helm/pkg/releaseutil" "k8s.io/helm/pkg/t...
/* * Copyright (c) 2020. * * Metaprov.com */ package v1alpha1 import ( "bytes" "fmt" "text/template" "github.com/metaprov/modelaapi/pkg/apis/training" "github.com/metaprov/modelaapi/pkg/util" "gopkg.in/yaml.v2" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pk...
package nginx import ( "context" "errors" "math" "time" "github.com/AirHelp/autoscaler/nginx_stats" "github.com/AirHelp/autoscaler/stat" log "github.com/sirupsen/logrus" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" v1 "k8s.io/api/core/v1" ) const ( defaultEndpoint = "/stats/active_conne...
package main import ( "flag" "fmt" "gopkg.in/yaml.v2" "io" "io/ioutil" "net" "os" "os/exec" "strings" ) // -------------------------------------------------------------------------- // constants // ------------------------------------------------...