text
stringlengths
3.08k
10.4k
package main import ( "errors" "fmt" "io/ioutil" "reflect" "strconv" "strings" ) // ini文件解析 // MySQL配置结构体 type MySQLConfig struct { Address string `ini:"address"` Port int `ini:"port"` Username string `ini:"username"` Password string `ini:"password"` } // Redis配置结构体 type RedisConfig struct { ...
package main import ( "context" "crypto/tls" "crypto/x509" "fmt" "io" "io/ioutil" "net/http" "os" "os/signal" "strings" "time" "github.com/savaki/kag" "github.com/savaki/kag/datadog" "gopkg.in/urfave/cli.v1" ) var ( opts = struct { Brokers string Observer string Interval time.Duration Debug ...
// Package stack provides the glue between networking protocols and the // consumers of the networking stack. package stack import ( "sync" "log" "github.com/YaoZengzeng/yustack/types" "github.com/YaoZengzeng/yustack/waiter" "github.com/YaoZengzeng/yustack/ports" ) // Stack is a networking stack, with all supp...
package client import ( "context" "net/http" ppath "path" "strconv" "time" "github.com/heetch/regula" "github.com/heetch/regula/api" "github.com/heetch/regula/rule" "github.com/pkg/errors" ) // RulesetService handles communication with the ruleset related // methods of the Regula API. type RulesetService st...
package cmd import ( "fmt" "net" "os" "path/filepath" "strings" "github.com/spf13/viper" "github.com/cloudflare/cloudflare-go" log "github.com/sirupsen/logrus" "github.com/spf13/cobra" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" "k8s.io/client-go/tools/clientcmd" metav1 "k8s.io/apimachinery/...
package borges import ( "fmt" "gopkg.in/src-d/go-log.v1" "gopkg.in/src-d/regression-core.v0" ) type packResults map[string][]*PackResult type versionResults map[string]packResults type Test struct { config regression.Config repos *regression.Repositories server *regression.GitServer borges map[string]*r...
package internal import ( "bytes" "errors" "fmt" "github.com/yuin/goldmark" "html/template" "io/ioutil" "os" "path/filepath" "sort" "strings" "time" ) func (app *App) Build() error { if err := os.RemoveAll("./dist"); err != nil { return errors.New("unable to remove dist") } if err := BuildDirStruct("....
/* Copyright © 2022 SUSE 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 writing, software dist...
package jsonUtilities import ( "encoding/json" "fmt" "regexp" "strconv" "strings" "github.com/pkg/errors" "github.com/reubenmiller/go-c8y-cli/pkg/logger" "github.com/reubenmiller/go-c8y/pkg/c8y" ) const ( // Separator character which is used when setting the path via a dot notation Separator = "." ) // Lo...
// Copyright 2016 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable...
/* 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 player import ( "fgame/fgame/core/storage" foundentity "fgame/fgame/game/found/entity" foundtypes "fgame/fgame/game/found/types" "fgame/fgame/game/global" "fgame/fgame/game/player" "fgame/fgame/game/player/types" "fgame/fgame/pkg/timeutils" "github.com/pkg/errors" ) //玩家资源找回对象 type PlayerFoundObject ...
package cosmos import ( "github.com/trustwallet/blockatlas/pkg/blockatlas" "github.com/trustwallet/blockatlas/pkg/logger" "github.com/trustwallet/blockatlas/pkg/numbers" "strconv" "sync" "time" ) func (p *Platform) GetTxsByAddress(address string) (blockatlas.TxPage, error) { tagsList := []string{"transfer.reci...
package app import ( "encoding/json" cmn "github.com/ColorPlatform/prism/libs/common" dbm "github.com/ColorPlatform/prism/libs/db" "github.com/ColorPlatform/prism/libs/log" bapp "github.com/ColorPlatform/color-sdk/baseapp" sdk "github.com/ColorPlatform/color-sdk/types" "github.com/ColorPlatform/color-sdk/x/au...
/* Copyright 2019 The Kubeedge 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, so...
package raft import ( "encoding/json" "fmt" "github.com/aergoio/aergo/consensus" "github.com/aergoio/aergo/message" "github.com/aergoio/aergo/p2p" "github.com/aergoio/aergo/p2p/p2putil" "github.com/aergoio/aergo/pkg/component" "github.com/aergoio/aergo/types" "github.com/libp2p/go-libp2p-peer" "strconv" "sy...
/* Copyright 2016 The Fission 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, sof...
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package ec2 import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" ) type ModifyVpcPeeringConnectionOptionsInput struct { _ struct{} `type:"structure"` // The VPC peering connection options for ...
/** * 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 2017 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 rest import ( "context" "errors" "fmt" "net" "net/http" "github.com/bool64/ctxd" "github.com/dohernandez/kit-template/pkg/servicing" "github.com/grpc-ecosystem/grpc-gateway/v2/runtime" ) var serverType = "REST" // Option sets up a server mux. type Option func(mux *Server) // WithAddress sets server...
package notify import ( "context" "errors" "fmt" "math/rand" "sync" "sync/atomic" "testing" "time" log "github.com/go-pkgz/lgr" "github.com/stretchr/testify/assert" "github.com/umputun/remark/backend/app/store" ) func TestService_NoDestinations(t *testing.T) { s := NewService(nil, 0) assert.Equal(t, de...
package errors // errors.go contains all the errors returned by the adapter implementation // plus some extra utilities to parse those errors import ( "fmt" grpccodes "google.golang.org/grpc/codes" grpcstatus "google.golang.org/grpc/status" "github.com/coinbase/rosetta-sdk-go/types" ) // ListErrors lists all t...
// Code generated by main. DO NOT EDIT. package tsmt_001_001_03 import ( "bytes" "encoding/xml" "time" ) type AcknowledgementV03 struct { AckId MessageIdentification1 `xml:"urn:iso:std:iso:20022:tech:xsd:tsmt.001.001.03 AckId"` TxId SimpleIdentificationInformation `xml:"urn:iso...
// Copyright 2018 Keybase Inc. All rights reserved. // Use of this source code is governed by a BSD // license that can be found in the LICENSE file. package libkbfs import ( "testing" "time" "github.com/keybase/client/go/kbfs/data" "github.com/keybase/client/go/kbfs/kbfsblock" "github.com/keybase/client/go/kbf...
// *** 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 v20181101 import ( "github.com/pulumi/pulumi/sdk/v2/go/pulumi" ) func LookupWebAppSlot(ctx *pulumi.Context, args *LookupWebAppSlotArgs, opts ...pulumi.In...
// Copyright 2016 <NAME>. 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...
/* * Copyright 2016 Google Inc. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicabl...
// Copyright 2014 <NAME>. All rights reserved. // Use of this source code is governed by a MIT style // license that can be found in the LICENSE file. package binding import ( "bytes" "reflect" "testing" "time" "github.com/stretchr/testify/assert" "gopkg.in/go-playground/validator.v8" ) type testInterface in...
package mcp23xxx import ( "fmt" "sync" "periph.io/x/periph/conn" "periph.io/x/periph/conn/gpio" "periph.io/x/periph/conn/i2c" "periph.io/x/periph/conn/physic" "periph.io/x/periph/conn/spi" ) // Opts holds the configuration options for the device. type Opts struct { // Chip model. Model string // Hardware a...
// Unless explicitly stated otherwise all files in this repository are licensed // under the Apache License Version 2.0. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2016-present Datadog, Inc. package scheduler import ( "fmt" "sync" "time" "github.com/DataDog/...
package client import ( "context" "encoding/hex" "fmt" "io/ioutil" "net/http" "time" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/rest" "github.com/desmos-labs/juno/config" rpcclient "github.com/tendermint/tendermint/rpc/client" httpclie...
package repository_test import ( "os" "path" "path/filepath" "runtime" "testing" "github.com/alpacahq/ribbit-backend/apperr" "github.com/alpacahq/ribbit-backend/model" "github.com/alpacahq/ribbit-backend/repository" "github.com/alpacahq/ribbit-backend/secret" embeddedpostgres "github.com/fergusstrange/embe...
/* 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, ...
// Copyright (c) The Thanos Authors. // Licensed under the Apache License 2.0. package extkingpin import ( "fmt" "strings" "time" extflag "github.com/efficientgo/tools/extkingpin" "github.com/pkg/errors" "github.com/prometheus/common/model" "gopkg.in/alecthomas/kingpin.v2" ) func ModelDuration(flags *kingpin...
/* Copyright 2019 The Jetstack cert-manager contributors. 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 migrator import ( "database/sql" "fmt" "io/ioutil" "os" "path/filepath" "sync" vtparser "github.com/knocknote/vitess-sqlparser/sqlparser" "github.com/pkg/errors" "go.knocknote.io/octillery/connection" "go.knocknote.io/octillery/sqlparser" ) // DBMigratorPlugin interface for migration type DBMigrato...
// Copyright 2014 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicabl...
/* * * Copyright 2019 The Tekton 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 ...
// // Copyright © 2017-2020 Solus Project // // 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 ...
// mpg123.go contains all bindings to the C library package mpg123 /* #include <mpg123.h> #cgo LDFLAGS: -lmpg123 */ import "C" import ( "errors" "fmt" "os" "unsafe" ) var EOF = errors.New("EOF") // All output encoding formats supported by mpg123 const ( ENC_8 = C.MPG123_ENC_8 ENC_16 = C.MP...
package ram import ( "fmt" "log" "regexp" "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ram" "github.com/hashicorp/aws-sdk-go-base/tfawserr" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/...
package gopherdiscovery import ( "log" "strings" "time" "golang.org/x/net/context" "github.com/gdamore/mangos" "github.com/gdamore/mangos/protocol/pub" "github.com/gdamore/mangos/protocol/surveyor" "github.com/gdamore/mangos/transport/ipc" "github.com/gdamore/mangos/transport/tcp" ) type Options struct { ...
// +build linux solaris package libcontainerd import ( "encoding/json" "io" "io/ioutil" "os" "path/filepath" "sync" "syscall" "time" "github.com/Sirupsen/logrus" containerd "github.com/docker/containerd/api/grpc/types" "github.com/docker/docker/pkg/ioutils" specs "github.com/opencontainers/runtime-spec/s...
package acquire import ( "fmt" "log" "strings" configTypes "github.com/gleanerio/gleaner/internal/config" bolt "go.etcd.io/bbolt" "github.com/gleanerio/gleaner/internal/summoner/sitemaps" "github.com/minio/minio-go/v7" "github.com/spf13/viper" ) // Sources Holds the metadata associated with the sites to har...
package k8s import ( appsv1 "k8s.io/api/apps/v1" batchv1 "k8s.io/api/batch/v1" batchv1beta1 "k8s.io/api/batch/v1beta1" apiv1 "k8s.io/api/core/v1" networkingv1 "k8s.io/api/networking/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" k8sRuntime "k8s.io/apimachinery/pkg/runtime" ) // CapabilitiesV1 is a type alia...
// Copyright 2017 The StudyGolang Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // http://studygolang.com // Author: polaris <EMAIL> package app import ( "html/template" "http/middleware" "logic" "model" "net/http" . "http"...
// Copyright 2019 Yunion // // 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...
package controller import ( "context" "encoding/json" "fmt" apierr "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" "github.com/argoproj/argo-workflows/v3/errors" "github.com/argoproj/argo-workflows/v3/pkg/apis/workflow" wfv1 "github.com/argo...
// Code generated by entc, DO NOT EDIT. package ent import ( "fmt" "strings" "github.com/blushft/strana/modules/sink/reporter/store/ent/alias" "github.com/blushft/strana/modules/sink/reporter/store/ent/event" "github.com/blushft/strana/modules/sink/reporter/store/ent/user" "github.com/facebook/ent/dialect/sql"...
// Copyright The OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agre...
package modd import ( "os" "os/exec" "sync" "time" "github.com/cortesi/modd/conf" "github.com/cortesi/modd/shell" "github.com/cortesi/modd/varcmd" "github.com/cortesi/termlog" ) const ( // MinRestart is the minimum amount of time between daemon restarts MinRestart = 500 * time.Millisecond // MulRestart is...
package main import ( "embed" _ "embed" "image" "image/color" "image/draw" "image/png" "io" "strings" "github.com/BourgeoisBear/gooder/quote" "github.com/BourgeoisBear/gooder/wuline" "github.com/BourgeoisBear/rasterm" ) // NOTE: image height should ideally be a multiple of six (to avoid vertical overhang ...
/* Copyright 2013 CoreOS Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software di...
package v2 import ( "context" "regexp" "time" "k8s.io/apimachinery/pkg/util/wait" "github.com/loft-sh/devspace/pkg/util/log" k8sv1 "k8s.io/api/core/v1" rbacv1 "k8s.io/api/rbac/v1" "github.com/loft-sh/devspace/pkg/devspace/config/versions/latest" "github.com/loft-sh/devspace/pkg/devspace/kubectl" metav1 "k...
package plotting import ( "math/rand" "testing" "time" "github.com/beevee/go-chart" "github.com/moira-alert/moira" metricSource "github.com/moira-alert/moira/metric_source" . "github.com/smartystreets/goconvey/convey" ) // TestResolveLimits tests plot limits will be calculated correctly for any metricData arr...
package handler import ( "fmt" "github.com/IAOTW/aliyun-exporter/pkg/client" "github.com/IAOTW/aliyun-exporter/pkg/collector" "github.com/IAOTW/aliyun-exporter/pkg/config" "github.com/go-kit/kit/log" "github.com/go-kit/kit/log/level" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/clien...
// Copyright (c) 2016 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 proc import ( "time" seq "github.com/ncabatoff/go-seq/seq" common "github.com/ncabatoff/process-exporter" ) type ( // Grouper is the top-level interface to the process metrics. All tracked // procs sharing the same group name are aggregated. Grouper struct { // groupAccum records the historical accu...
package collectors import ( "context" "fmt" "math" "github.com/btcsuite/btcutil" "github.com/lightninglabs/lndclient" "github.com/prometheus/client_golang/prometheus" ) // WalletCollector is a collector that will export metrics related to lnd's // on-chain wallet. . type WalletCollector struct { lnd *lndclien...
// +build windows /* Copyright The containerd 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 applicab...
package imagerepository import ( "fmt" kapi "github.com/GoogleCloudPlatform/kubernetes/pkg/api" "github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors" "github.com/GoogleCloudPlatform/kubernetes/pkg/fields" "github.com/GoogleCloudPlatform/kubernetes/pkg/labels" "github.com/GoogleCloudPlatform/kubernetes/pkg/...
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package wafregional import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" ) type CreateWebACLMigrationStackInput struct { _ struct{} `type:"structure"` // Indicates whether to exclude entities ...
package proxy import ( "sort" "sync" "time" "github.com/deepfabric/elasticell/pkg/codec" "github.com/deepfabric/elasticell/pkg/log" "github.com/deepfabric/elasticell/pkg/pb/raftcmdpb" "github.com/deepfabric/elasticell/pkg/util" "github.com/fagongzi/goetty" "github.com/pkg/errors" ) var ( errConnect ...
package features import ( "fmt" "strconv" "strings" v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3" managementv3 "github.com/rancher/rancher/pkg/generated/controllers/management.cattle.io/v3" "github.com/sirupsen/logrus" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/api...
/* Copyright 2019 Gravitational, Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
// *** 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/pkg/errors" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // Create an OS Config patch deployment. ty...
// Copyright (c) 2019 Uber Technologies, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law o...
package indieauth import ( "context" "crypto/sha256" "encoding/base64" "encoding/json" "errors" "fmt" "log" "mime" "net/http" "net/url" "strings" ) // Client describes an IndieAuth client application that is // configured to perform the IndieAuth authentication flow. // (The IndieAuth authorization flow is...
// Copyright 2012-2020 The NATS 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 ...
// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by the Apache 2.0 // license that can be found in the LICENSE file. // +build golangorg // Package short implements a simple URL shortener, serving an administrative // interface at /s and shortened urls from /s/key. // It i...
/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
package cli import ( "context" glog "log" "math/rand" "sort" "sync" "time" "github.com/nats-io/jsm.go" "github.com/nats-io/jsm.go/natscontext" "github.com/nats-io/nats.go" "gopkg.in/alecthomas/kingpin.v2" ) type command struct { Name string Order int Command func(app commandHost) } type commandHos...
// Copyright 2016 The Cockroach 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...
// Copyright 2015 The rkt 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...
package collections import ( "fmt" "log" "testing" ) // Map of strings to randomly generated uint32 values var ( keyCIDMap = map[string]uint32{ "Hello": 0x00, "Couchbase": 0x99, "Collections": 0x12234, "GSI": 0x576843, "FTS": 0x7685346, "Query": 0x1712, "Analytics...
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package sqs import ( "context" "fmt" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" ) type SendMessageBatchInput struct { _ struct{} `type:"structure"` // A list of SendMessageBatchRequestEntry items. //...
package auth import ( "context" "crypto/rand" "encoding/hex" "encoding/json" "errors" "fmt" "io/ioutil" "net/http" "os" "path/filepath" "github.com/mitchellh/go-homedir" "github.com/pkg/browser" "github.com/rs/zerolog/log" "golang.org/x/oauth2" "golang.org/x/term" ) const ( credentialsFile = "~/.conf...
package ad9910 import ( "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/suite" ) type CFR2TestSuite struct { suite.Suite r CFR2 } func (s *CFR2TestSuite) SetupTest() { s.r = NewCFR2() } func (s *CFR2TestSuite) TestSTAmplScaleEnabled() { s.r[0] = 0x00 assert.False(s.T(), s.r.STA...
// Copyright GoFrame Author(https://goframe.org). All Rights Reserved. // // This Source Code Form is subject to the terms of the MIT License. // If a copy of the MIT was not distributed with this file, // You can obtain one at https://github.com/gogf/gf. package ghttp import ( "net/http" "reflect" "github.com/go...
package iothub import ( "fmt" "log" "time" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/azure" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/helpers/tf" "github.com/terraform-providers/terraform-provide...
// Copyright 2014 The oauth2 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 oauth2 import ( "crypto/rsa" "crypto/x509" "encoding/json" "encoding/pem" "errors" "fmt" "io/ioutil" "net/http" "net/url" "strings" "tim...
// 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 common import ( "github.com/astaxie/beego" "liumao801/lmadmin/functions" "mime/multipart" ) type UploadController struct { beego.Controller } type UploadResult struct { Url string `json:"url"` Uploaded bool `json:"uploaded"` Msg string `json:"msg"` } // 公共的上传方法 func (c *UploadController) CommonUp...
package doctor import ( "fmt" "github.com/spf13/cobra" "goharvest2/pkg/color" "goharvest2/pkg/conf" "gopkg.in/yaml.v3" "io/ioutil" "os" "strings" ) type options struct { ShouldPrintConfig bool Color string } var opts = &options{ ShouldPrintConfig: false, Color: "auto", } type val...
/* * 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 a...
package protocol import ( "encoding/gob" "fmt" "strings" "sync" "time" ) type Node interface { String() string } // AuthorMatches is a predicate that matches if the author's name or email address // matches the regex pattern. type AuthorMatches struct { Expr string IgnoreCase bool } func (a *AuthorMat...
/* Copyright 2018 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 environment import ( "os" "strings" "sync" "github.com/estuaryoss/estuary-agent-go/src/constants" "github.com/magiconair/properties" ) var once sync.Once type Env struct { configEnvVars map[string]string env map[string]string virtualEnv map[string]string virtualEnvSize int } var si...
/* 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 expath import ( "errors" "path/filepath" "runtime" "testing" ) type testPathHelper struct { testPath string } func (t testPathHelper) getNames(dir string) (names []string, err error) { testPath := trimPath(t.testPath) dir = trimDir(filepath.ToSlash(dir)) nLen := len(dir) if nLen < len(testPath) { ...
package cimc import ( "context" "fmt" "os" "regexp" "strings" "time" goexpect "github.com/google/goexpect" "github.com/google/goterm/term" "golang.org/x/crypto/ssh" ) const ( timeout = 60 * time.Second ctrlX = "\x18" ctrlM = "\x0D" ) var noMoreCmds = []string{"commit", "top", "scope", "set"} // Ses...
package axel import ( "crypto/tls" "errors" "fmt" "io" "net" "net/http" "os" "path" "path/filepath" "runtime" "strings" "sync" "time" ) type httpAxel struct { // options remoteURL string // remote url save string // local save path conn int // nb of connections, note: maybe reset as 1 if...
// Copyright 2018 The Chubao 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 agree...
package issuer import ( "crypto/rand" "crypto/rsa" "crypto/tls" "crypto/x509" "crypto/x509/pkix" "encoding/pem" "io" "math/big" "net" "sync" "time" ) // Issuer defines interface for on-flight certificate generator type Issuer interface { Issue(cn string, dnsnames []string, ipaddresses []net.IP) (*tls.Cert...
// SPDX-License-Identifier: Apache-2.0 // Copyright(c) 2018-2020 Saaras Inc. // Copyright © 2018 Heptio // 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/licen...
// Package ratelimiter implements a rate limiting and traffic shaping middleware with a set of token buckets. package ratelimiter import ( "context" "fmt" "net/http" "time" "github.com/mailgun/ttlmap" "github.com/opentracing/opentracing-go/ext" "github.com/traefik/traefik/v2/pkg/config/dynamic" "github.com/tr...
package brb import ( "crypto/sha256" "fmt" "math" "reflect" "rp-runner/graphs" ) const ( BrachaSend uint8 = 1 BrachaEcho uint8 = 2 BrachaReady uint8 = 3 ) type BrachaMessage struct { Src uint64 Id uint32 Payload Size } func (b BrachaMessage) SizeOf() uintptr { return reflect.TypeOf(b.Src).Siz...
// Copyright 2017 <NAME> http://www.sage42.org/ // // 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 la...
package ssh import ( "io/ioutil" "strconv" "github.com/pkg/errors" "github.com/smallstep/certificates/api" "github.com/smallstep/certificates/authority/provisioner" "github.com/smallstep/certificates/ca" "github.com/smallstep/cli/command" cmdca "github.com/smallstep/cli/command/ca" "github.com/smallstep/cli/...