text
stringlengths
3.08k
10.4k
package tcp import ( "net" "sync" "sync/atomic" "time" "github.com/vvisun/cellnet" "github.com/vvisun/cellnet/peer" "github.com/vvisun/cellnet/util" ) // Socket会话 type tcpSession struct { peer.CoreContextSet peer.CoreSessionIdentify *peer.CoreProcBundle pInterface cellnet.Peer // Socket原始连接 conn ...
package aec import ( "fmt" ) // RGB3Bit is a 3bit RGB color. type RGB3Bit uint8 // RGB8Bit is a 8bit RGB color. type RGB8Bit uint8 func newSGR(n uint) ANSI { return newAnsi(fmt.Sprintf(esc+"%dm", n)) } // NewRGB3Bit create a RGB3Bit from given RGB. func NewRGB3Bit(r, g, b uint8) RGB3Bit { return RGB3Bit((r >> 7...
/* Copyright 2018 ZTE Corporation. 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 agreed to in wr...
/* Copyright © 2021 blacktop 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, distribute, sublicen...
package region import ( "github.com/go-spatial/tegola/container/singlelist/point/list" "github.com/go-spatial/tegola/maths" ) /* A region is made up of axises and a winding order. A region can hold other points along it's axises. */ type Region struct { list.List sentinelPoints [4]*list.Pt winding maths....
/* * Copyright 2020, Offchain Labs, 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 ag...
package blockchain import ( "encoding/binary" "fmt" "io" "github.com/btcboost/copernicus/core" "github.com/btcboost/copernicus/utils" "github.com/btcboost/copernicus/utxo" ) const MaxInputPerTx = core.MaxTxInPerMessage type DisconnectResult int const ( // DisconnectOk All good. DisconnectOk DisconnectResul...
package main import ( "flag" "log" "sort" "sync" "time" pd "github.com/paddlepaddle/paddle/paddle/fluid/inference/goapi" ) // flags var modelName = flag.String("model_name", "resnet50/inference.pdmodel", "the model path") var paramsName = flag.String("params_name", "resnet50/inference.pdiparams", "the params p...
/** * Copyright (C) 2015 Red Hat, 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...
// Copyright 2020 apirator.io // // 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...
/* * This file is subject to the terms and conditions defined in * file 'LICENSE.md', which is part of this source code package. */ package creator import ( "errors" "strings" "unicode" "github.com/pzduniak/unipdf/common" "github.com/pzduniak/unipdf/core" "github.com/pzduniak/unipdf/model" ) // TextChunk r...
// Copyright 2021 The LUCI 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...
package otel import ( "encoding/json" "fmt" "github.com/open-telemetry/opentelemetry-operator/api/v1alpha1" "github.com/timescale/tobs/cli/pkg/helm" "github.com/timescale/tobs/cli/pkg/k8s" "github.com/timescale/tobs/cli/pkg/utils" errors2 "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/ap...
package client import ( "github.com/rancher/norman/types" ) const ( AppType = "app" AppFieldAnnotations = "annotations" AppFieldAnswers = "answers" AppFieldAppRevisionID = "appRevisionId" AppFieldAppliedFiles = "appliedFiles" AppFieldConditions ...
/* 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 teaconfigs import ( "errors" "github.com/TeaWeb/code/teaconfigs/shared" "github.com/TeaWeb/code/teaconst" "github.com/iwind/TeaGo/maps" "github.com/iwind/TeaGo/utils/string" "net/http" "path/filepath" "regexp" "time" ) // Fastcgi配置 type FastcgiConfig struct { shared.HeaderList `yaml:",inline"` On ...
package cache import ( "bytes" "encoding/gob" "fmt" "reflect" "strconv" "testing" "time" ) var ( cacheAreaAuto = "tests" cacheStorageAuto = NewRedisCacheStorage("localhost:6379", "", 8, 200, 2000, cacheAreaAuto, SerializerGOB{}) cacheManagerAuto = AutoCacheManager{ cacheStorageAuto, } ) func init() {...
package cmd import ( "fmt" "github.com/jenkins-zh/jenkins-cli/app/i18n" "io/ioutil" "log" "os" "github.com/mitchellh/go-homedir" "github.com/spf13/cobra" "go.uber.org/zap" "gopkg.in/yaml.v2" ) // ConfigOptions is the config cmd option type ConfigOptions struct { ConfigFileLocation string } var configOpt...
package main import ( "log" "math/rand" "github.com/hajimehoshi/ebiten" "github.com/hajimehoshi/ebiten/ebitenutil" ) // Intro logo y adornos type intro struct { // logo logoX int logoWidth int logoY float64 logoHeight int logoScale float64 logoScaleDir string logoAlpha float64 ...
package file import ( "bytes" "fmt" "strings" "text/template" intimports "github.com/lolopinto/ent/internal/imports" "github.com/lolopinto/ent/internal/tsimport" "golang.org/x/tools/imports" ) type TemplatedBasedFileWriter struct { Data interface{} AbsPathToTemplate string OtherTemplateFiles...
// Copyright Monax Industries Limited // SPDX-License-Identifier: Apache-2.0 package native import ( "fmt" "github.com/hyperledger/burrow/acm" "github.com/hyperledger/burrow/acm/acmstate" "github.com/hyperledger/burrow/crypto" "github.com/hyperledger/burrow/execution/engine" "github.com/hyperledger/burrow/exec...
package sbanken import ( "context" "fmt" "io" "net/http" "os" "regexp" "strings" "time" "github.com/engvik/sbanken-cli/internal/output/json" "github.com/engvik/sbanken-cli/internal/output/table" "github.com/engvik/sbanken-go" "github.com/urfave/cli/v2" ) type sbankenClient interface { ListAccounts(conte...
package champions_parse_tierlist_hellhades import ( "fmt" "log" "net/http" "strconv" "strings" "github.com/PuerkitoBio/goquery" "github.com/raid-codex/tools/common" "github.com/raid-codex/tools/utils" "gopkg.in/alecthomas/kingpin.v2" ) // type Command struct { CSVFile *string DataDirectory *string ...
package main import ( "log" "net/url" "os" "strconv" "time" "github.com/didip/tollbooth" "github.com/iris-contrib/middleware/csrf" "github.com/iris-contrib/middleware/secure" "github.com/iris-contrib/middleware/tollboothic" "github.com/kataras/iris" "github.com/kataras/iris/core/host" "github.com/kataras/...
// Copyright 2015 The Cockroach Authors. // // Use of this software is governed by the Business Source License included // in the file licenses/BSL.txt and at www.mariadb.com/bsl11. // // Change Date: 2022-10-01 // // On the date above, in accordance with the Business Source License, use // of this software will be gov...
package process import ( "bufio" "container/heap" "fmt" "io/ioutil" "log" "os" "strconv" "strings" "sync" "syscall" "time" ) var ( totalMem uint64 ) // NewProcessMonitor returns a new process monitor. // n: the number of processes to return, interval: the interval of data collection. func NewProcessMonit...
package physical import ( "context" "sync/atomic" log "github.com/hashicorp/go-hclog" lru "github.com/hashicorp/golang-lru" "github.com/hashicorp/vault/helper/locksutil" "github.com/hashicorp/vault/helper/pathmanager" ) const ( // DefaultCacheSize is used if no cache size is specified for NewCache DefaultCac...
// original from https://interpreterbook.com/ package lexer import "toyvm/token" type Lexer struct { input string position int // 当前字符的位置 readPosition int // 输入字符串的读取位置(即当前字符的下一个字符的位置) ch byte // 当前字符(只支持 ascii) } func New(input string) *Lexer { lx := &Lexer{input: input} lx.readChar() ...
/* Copyright 2021. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed un...
package auresthttpclient import ( "context" "crypto/tls" "crypto/x509" "encoding/json" "fmt" aurestclientapi "github.com/StephanHCB/go-autumn-restclient/api" aurestnontripping "github.com/StephanHCB/go-autumn-restclient/implementation/errors/nontrippingerror" "github.com/go-http-utils/headers" "io" "io/iouti...
package migrations import ( "github.com/mongodb/anser" "github.com/mongodb/anser/db" "github.com/mongodb/anser/model" "github.com/mongodb/grip" "github.com/pkg/errors" "gopkg.in/mgo.v2/bson" ) const migrationLegacyNotificationsToSubscriptions = "legacy-notifications-to-subscriptions" func legacyNotificationsTo...
package rollup import ( "encoding/binary" "sort" "strings" "time" "github.com/kentik/ktranslate/pkg/eggs/logger" "github.com/kentik/ktranslate/pkg/kt" "github.com/dchest/siphash" gohll "github.com/sasha-s/go-hll" ) var ( hllErrRateHigh = 0.02 // Matching whats used in prod hllSizeForErrRateHigh = 3...
// Copyright Amazon.com, Inc. or 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. A copy of the // License is located at // // http://aws.amazon.com/apache2.0/ // // or in the "license" file acc...
package svgd import ( "errors" "fmt" "github.com/ajstarks/svgo" "io" "math/rand" "math" ) type PieCategory struct { Name string Color string Value float64 Shift uint } type PieDiagram struct { Title string Width uint Height uint ShowValues bool ValuesShift uint LegendMarginTop uint Radius uin...
package complete import ( "fmt" "os" "path/filepath" "strings" "src.elv.sh/pkg/cli/lscolors" "src.elv.sh/pkg/eval" "src.elv.sh/pkg/eval/vals" "src.elv.sh/pkg/fsutil" "src.elv.sh/pkg/parse" "src.elv.sh/pkg/ui" ) var pathSeparator = string(filepath.Separator) // GenerateFileNames returns filename candidates...
/* * 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 ...
// Copyright 2021 Matrix Origin // // 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 ...
// Unless explicitly stated otherwise all files in this repository are licensed // under the MIT License. // This product includes software developed at Guance Cloud (https://www.guance.com/). // Copyright 2021-present Guance, Inc. package mem import ( "testing" "github.com/shirou/gopsutil/mem" ) var vmStat = &me...
/* Package longpoll implements Bots Long Poll API. See more https://vk.com/dev/bots_longpoll */ package longpoll // import "github.com/SevereCloud/vksdk/v2/longpoll-bot" import ( "context" "encoding/json" "fmt" "net/http" "github.com/SevereCloud/vksdk/v2" "github.com/SevereCloud/vksdk/v2/api" "github.com/Seve...
package discovery import ( "context" "fmt" "strconv" "time" "github.com/coreos/etcd/client" "github.com/silentred/toolkit/util" ) var ( // DefaultPrefix is the key prefix in etcd DefaultPrefix = "iget/service/grpc" ) // Publisher is able to register and unregister service to registry type Publisher interfac...
package metadata import ( "regexp" ) type PropertyInput struct { Description string Label string Placeholder string PropertyInputs []PropertyInput `yaml:"property_inputs" validate:"dive"` Reference string `validate:"property-exists"` Selector...
package utreexo import ( "fmt" "testing" ) // test cases for TestTopDown: // add 4, remove [0] // add 5, remove [0, 3] // add 8, remove [0, 2] // add 8, remove [0, 2, 4, 6] func TestTopDown(t *testing.T) { // mv, stash := removeTransform([]uint64{1}, 16, 4) // fmt.Printf("mv %v, stash %v\n", mv, stash) // arro...
package jsonera import ( "encoding/json" "reflect" "testing" ) func TestBuildNewEra(t *testing.T) { testCases := []struct { newDoc string oldDoc string newEra string oldEra string changes []Change }{ // no changes { newDoc: `{}`, oldDoc: `{}`, newEra: `{".": 2, "_": {}}`, oldEra:...
// Copyright (c) 2019-2022 The iexcloud developers. All rights reserved. // Project site: https://github.com/woodstock-tokyo/iexcloud // Use of this source code is governed by a MIT-style license that // can be found in the LICENSE file for the project. package iex // Last provides trade data for executions on IEX. I...
package hyper // Hypercube is represented by a slice of its coordinates. type Cube []int type Cubes []Cube // Parameters of space discretization. type Params struct { // Value limits per dimension. For example 0, 255 for pixel values. Min, Max float64 // Uncertainty interval expressed as a fraction of bucketWidth ...
// 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 ...
package tdameritrade import ( "context" "fmt" "net/url" "strconv" ) // ChainsService handles communication with the chains related methods of // the TDAmeritrade API. // // TDAmeritrade API docs: https://developer.tdameritrade.com/option-chains/apis type ChainsService struct { client *Client } type JSONFloat fl...
package app import ( "fmt" "html/template" "net/http" "strings" "time" "github.com/gin-gonic/gin" "github.com/midoks/go-p2p-server/internal/assets/public" "github.com/midoks/go-p2p-server/internal/assets/templates" "github.com/midoks/go-p2p-server/internal/conf" "github.com/midoks/go-p2p-server/internal/ge...
// Copyright 2018 The go-exactonline AUTHORS. All rights reserved. // // Use of this source code is governed by a MIT // license that can be found in the LICENSE file. // Code generated by gen-services.go; DO NOT EDIT. package manufacturing import ( "context" "github.com/mcnijman/go-exactonline/api" "github.com/mc...
package controllers import ( _"lychee/models" "github.com/astaxie/beego" _ "github.com/astaxie/beego/session" _ "github.com/go-sql-driver/mysql" "errors" "regexp" "strings" "github.com/astaxie/beego/validation" ) // Predefined const error strings. const ( ErrInputData = "数据输入错误" ErrDatabas...
// Copyright (c) 2021, Oracle and/or its affiliates. // Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl. package mcagent import ( "fmt" clustersv1alpha1 "github.com/verrazzano/verrazzano/application-operator/apis/clusters/v1alpha1" "github.com/verrazzano/verra...
package release import ( "fmt" "os" "path/filepath" "regexp" "strings" "github.com/Masterminds/semver/v3" "github.com/spf13/cobra" "github.com/ory/x/flagx" "github.com/ory/x/stringslice" "github.com/ory/cli/cmd/pkg" ) var isTestRelease = regexp.MustCompile("^(([a-zA-Z0-9\\.\\-]+\\.)|)pre\\.[0-9]+$") var...
/* * 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 ...
package main import ( "encoding/json" "fmt" "net/http" "os" "strconv" "time" _ "net/http/pprof" "github.com/gorilla/mux" log "github.com/sirupsen/logrus" "github.com/opentracing/opentracing-go" "github.com/opentracing/opentracing-go/ext" "github.com/prometheus/client_golang/prometheus" "github.com/prom...
// binvox-dice takes an STL bounding box and writes commands to stdout to dice // the model into subsections to be processed by binvox. // Note that the maximum reliable dice resolution of binvox is 1024 despite the // documentation. If the CPU is used, all internal voxels are remove with or // without the '-ri' flag. ...
// Code generated by 'github.com/sevenval/structgen'. DO NOT EDIT. package config type Deployment struct { EndpointMode string `json:"endpoint_mode,omitempty"` Labels interface{} `json:"labels,omitempty"` Mode string `json:"mode,omitempty"` Placement *Placement `json:"p...
/* Copyright 2017 Loopring Project Ltd (Loopring Foundation). 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 ...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: baseproto.proto package baseproto 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 co...
package main import ( "flag" "fmt" "os" "strconv" "time" tg "github.com/semog/go-bot-api/v4" "k8s.io/klog" _ "github.com/semog/go-sqldb" ) const probedbFilename = "probes.db" func main() { token := flag.String("token", "Ask <PASSWORD>", "telegram bot token") debug := flag.Bool("debug", false, "Show debug...
// 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...
package bfapi import ( "bytes" "crypto/x509" "encoding/base64" "encoding/json" "encoding/pem" "fmt" "net/http" "strings" "time" ) type OpenIdDocument struct { Issuer string `json:"issuer"` AuthorizationEndpoint string `json:"authorization_endpoint"` JwksURI ...
/* * Copyright 2021 Red Hat * * 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...
// - // ========================LICENSE_START================================= // O-RAN-SC // %% // Copyright (C) 2021: Nordix Foundation // %% // 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 ...
package benchmark import ( "fmt" "log" "reflect" "runtime" "strings" "testing" "github.com/rs/zerolog" "github.com/drakos74/lachesis/store" "github.com/drakos74/lachesis/store/badger" "github.com/drakos74/lachesis/store/bolt" "github.com/drakos74/lachesis/store/file" "github.com/drakos74/lachesis/store/m...
package library import ( "errors" "net/http" "os" "plugin" "sync" "github.com/webability-go/xcore/v2" "github.com/webability-go/xamboo/cms/context" "github.com/webability-go/xamboo/cms/engines/assets" "github.com/webability-go/xamboo/cms/identity" "github.com/webability-go/xamboo/compiler" "github.com/web...
// Copyright (c) 2018 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge...
package process import ( "io" "net" "os/exec" "sync" "time" "github.com/pkg/errors" ) // address implements net.Addr for connection. type address struct{} // Network returns the connection protocol name. func (_ address) Network() string { return "standard input/output" } // String returns the connection ad...
package ua import ( "errors" "fmt" "github.com/qiniu/log" "github.com/qiniu/logkit/transforms" . "github.com/qiniu/logkit/utils/models" "github.com/ua-parser/uap-go/uaparser" ) type UATransformer struct { Key string `json:"key"` RegexYmlFilePath string `json:"regex_yml_path"` stats ...
package hatchery import ( "context" "go.opencensus.io/stats" "github.com/ovh/cds/sdk" "github.com/ovh/cds/sdk/cdsclient" ) // CommonConfiguration is the base configuration for all hatcheries type CommonConfiguration struct { Name string `toml:"name" default:"" comment:"Name of Hatchery" json:"name"` HTTP stru...
package joinpoint import ( "fmt" "github.com/wesovilabs/beyond/logger" "go/ast" "reflect" "strings" ) func buildPath(rootPkg string, pkg, objType string, funcDecl *ast.FuncDecl, imports map[string]string) string { in := pathForFieldList(rootPkg, pkg, funcDecl.Type.Params, imports, true) out := pathForFieldList...
package onkyoctl import ( "sync" "time" ) const protocol = "tcp" // Callback is the type for message callback functions. type Callback func(name, value string) // Device is an Onkyo device. type Device struct { Host string Port int log Logger commands CommandSet callback ...
package schemaspec_test import ( "testing" "ariga.io/atlas/schema/schemaspec" "ariga.io/atlas/schema/schemaspec/internal/schemautil" "github.com/stretchr/testify/require" ) type OwnerBlock struct { schemaspec.DefaultExtension ID string `spec:",name"` FirstName string ...
package server import ( "crypto/sha256" "crypto/subtle" "flag" "net/http" "os" "strings" "time" "github.com/creamlab/ducksoup/helpers" "github.com/creamlab/ducksoup/sfu" "github.com/creamlab/ducksoup/stats" "github.com/gorilla/mux" "github.com/gorilla/websocket" "github.com/rs/zerolog/log" ) var ( port...
// Copyright 2021-present Airheart, Inc. All rights reserved. // This source code is licensed under the Apache 2.0 license found // in the LICENSE file in the root directory of this source tree. // Order change flow: // 1. Get an existing order by ID using client.GetOrder(...) // 2. Create a new order change request u...
/* Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package cceventmgmt import ( "bytes" "sync" "github.com/foglink/fnkcore/src/common/flogging" ) var logger = flogging.MustGetLogger("cceventmgmt") var mgr *Mgr // Initialize initializes event mgmt func Initialize() { initialize...
package bitflow import ( "fmt" "io" "os" "github.com/antongulenko/golib/gotermBox" ) const ( // TextMarshallerDateFormat is the date format used by TextMarshaller to // print the timestamp of each sample. TextMarshallerDateFormat = "2006-01-02 15:04:05.999" // TextMarshallerDefaultSpacing is the default spa...
package bl import ( "encoding/json" "fmt" "os" "path/filepath" "github.com/datreeio/datree/pkg/cliClient" "github.com/datreeio/datree/pkg/printer" "github.com/datreeio/datree/pkg/propertiesExtractor" "gopkg.in/yaml.v3" ) type Printer interface { PrintWarnings(warnings []printer.Warning) PrintSummaryTable(s...
package provider import ( "context" "github.com/aliyun/alibaba-cloud-sdk-go/services/sts" "github.com/ghodss/yaml" "github.com/pkg/errors" v1 "k8s.io/api/core/v1" kerrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/klog/v2" "sigs.k8s.io/controller-runtime/pkg/client" "github.com/oam-dev/terraform-controlle...
/* Copyright 2016 <NAME> <www.webx.top> 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 agree...
/** * @Time : 2019-06-25 17:52 * @Author : <EMAIL> * @File : amqp * @Software: GoLand */ package amqp import ( "bytes" "context" "github.com/go-kit/kit/log" "github.com/go-kit/kit/log/level" kitamqp "github.com/go-kit/kit/transport/amqp" "github.com/icowan/config" "github.com/streadway/amqp" "time" ) ty...
package wxpayv3 import ( "bytes" "crypto" "crypto/rsa" "crypto/x509" "encoding/base64" "encoding/pem" "errors" "fmt" "github.com/xandercheung/wxpayv3-go/utils" "io/ioutil" "net/http" "strconv" "time" ) type Client struct { config *Config mchPrivateKey *rsa.PrivateKey // 商户API私钥 platformCer...
// Copyright 2016 Canonical ltd. // Copyright 2016 Cloudbase solutions // Licensed under the lgplv3, see licence file for details. package winrm import ( "fmt" "io/ioutil" "os" "path/filepath" "strings" "sync" "time" "github.com/juju/errors" "github.com/juju/utils" "github.com/juju/utils/cert" ) // List o...
package audit // Copyright (c) Microsoft Corporation. // Licensed under the Apache License 2.0. import ( "encoding/json" "fmt" "sync" "github.com/gofrs/uuid" "github.com/sirupsen/logrus" ) const ( // see pkg/deploy/generator/resources.go#L901 CloudRoleRP = "rp" DefaultLogMessage = "audit event" MetadataC...
package api_proxy import ( "context" "encoding/json" "fmt" "time" "github.com/SevenTV/ServerGo/src/cache" "github.com/SevenTV/ServerGo/src/mongo/datastructure" "github.com/SevenTV/ServerGo/src/utils" ) const baseUrlBTTV = "https://api.betterttv.net/3" func GetGlobalEmotesBTTV(ctx context.Context) ([]*datastr...
// Code generated by entc, DO NOT EDIT. package ent import ( "fmt" "strings" "time" "entgo.io/ent/dialect/sql" "github.com/Pirika-Pirilala-Popolina-Peperuto/database-system/pkg/ent/discount" "github.com/google/uuid" ) // Discount is the model entity for the Discount schema. type Discount struct { config `jso...
// Copyright 2018 Northern.tech AS // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable ...
package redisbroker import ( "encoding/json" "fmt" "log" "sync" "testing" "time" "github.com/mna/juggler/broker" "github.com/mna/juggler/message" "github.com/mna/redisc/redistest" "github.com/garyburd/redigo/redis" "github.com/pborman/uuid" "github.com/stretchr/testify/assert" "github.com/stretchr/testif...
package types import ( "fmt" "sort" "strings" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // IDCollection defines a set of nft ids that belong to a specific // collection type IDCollection struct { Denom string `json:"denom" yaml:"denom"` IDs S...
package e2e import ( "context" "github.com/codeready-toolchain/api/pkg/apis" "github.com/codeready-toolchain/toolchain-common/pkg/cluster" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "os" "sigs.k8s.io/kubefed/pkg/apis/core/common" "sigs.k8s.io/kubefed/p...
// release package lib import ( //"fmt" "gopkg.in/yaml.v2" "io/ioutil" "os/exec" "strconv" "strings" ) func NewRelease(job string, ssh *Scp, templatepath string) *Release { deploy_manifest := Template{} buf, err := ioutil.ReadFile(templatepath) if err != nil { SaveLog(err.Error(), "") panic(err) } err ...
/* * Copyright 1999-2019 Alibaba Group Holding 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 applicab...
package abios import ( "net/url" "sync" "time" ) // Default values for the outgoing rate and size of request buffer. const ( default_requests_per_second uint = 5 default_requests_per_minute uint = 300 // Buffer one minutes worth of requests (this can not be changed at runtime) default_request_buffer_size = de...
package mobileapi import ( "context" "encoding/json" "fmt" "log" "net/http" "strconv" "time" "github.com/chackett/zignews/pkg/storage" "github.com/gorilla/mux" "github.com/pkg/errors" ) const apiPrefixWithVersion = "/api/v1" // Handler implements HTTP API type Handler struct { service Service server *h...
// // Copyright 2019 Lightbend 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 ...
package reposerver import ( "context" "encoding/json" "log" "net/http" "os" "github.com/go-chi/chi" mw "github.com/go-chi/chi/middleware" "github.com/go-chi/jwtauth" "github.com/lestrrat-go/jwx/jwt" "github.com/tus/tusd/pkg/filestore" tusd "github.com/tus/tusd/pkg/handler" "go.amplifyedge.org/booty-v2/in...
// Copyright 2016 The Linux Foundation // // 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 agre...
// Copyright 2020 The searKing Author. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package tcp import ( "context" "io" "log" "net" "sync" "time" "github.com/searKing/golang/go/sync/atomic" time_ "github.com/searKing/golang/go/ti...
package metrics import ( "time" "github.com/prometheus/client_golang/prometheus" "github.com/stackrox/rox/pkg/metrics" ) const bucketKey = "Bucket" func init() { prometheus.MustRegister( FreePageN, PendingPageN, FreeAlloc, FreelistInuse, TxN, OpenTxN, TxStatsPageCount, TxStatsPageAlloc, TxStat...
/* * Copyright 2021 The Gort 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 agre...
package qdr import ( "flag" "strings" "testing" "crypto/tls" "gotest.tools/assert" ) var clusterRun = flag.Bool("use-cluster", false, "run tests against a configured cluster") func TestQDR(t *testing.T) { // AsInt ----------------------------------- goodAsInt := Record{} goodAsInt["int8"] = int8(0) goodAs...