text
stringlengths
3.08k
10.4k
// Licensed to Elasticsearch B.V. under one or more contributor // license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright // ownership. Elasticsearch B.V. licenses this file to you under // the Apache License, Version 2.0 (the "License"); you may // not use ...
package main import ( "os" "strings" ) func installPkgs(pkgNames []string) { displayPkgs(pkgNames, "install") fullInit() for _, pkgName := range pkgNames { chapLog("=>", "", "Installing %s", pkgName) chapLog("==>", "", "Preparing for installation of %s", pkgName) isURL := isValidURL(pkgName) isFile :=...
package internal import ( "bytes" "crypto/md5" "encoding/hex" "encoding/json" "errors" "fmt" "io/ioutil" "net/http" "strconv" "strings" "time" "github.com/go-acme/lego/v3/challenge/dns01" ) const defaultBaseURL = "https://www.cloudxns.net/api2/" type apiResponse struct { Code int `json:"...
/* Copyright 2020 The OpenYurt 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 ais provides core functionality for the AIStore object storage. /* * Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved. */ package ais import ( "fmt" "net/http" "github.com/NVIDIA/aistore/3rdparty/glog" "github.com/NVIDIA/aistore/cluster" "github.com/NVIDIA/aistore/cmn" "github.com/NVIDIA...
/* * Tencent is pleased to support the open source community by making Blueking Container Service available. * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * Licensed under the MIT License (the "License"); you may not use this file except * in compliance with the License. You may obta...
package containerservice // Copyright (c) Microsoft and contributors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 ...
/* * Copyright (c) 2021 THL A29 Limited, a Tencent company. All rights reserved * * This source code file is licensed under the MIT License, you may obtain a copy of the License at * * http://opensource.org/licenses/MIT * */ package direct import ( "fmt" ) // CallBack4Command : 回调函数,用于处理agent上报的使用的资源信息 type ...
/* Copyright 2020 <NAME> <<EMAIL>> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, sof...
// 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 Software without restriction, including without limitation the rights // to use, copy, modify, merge...
package tortoise import ( "container/list" "github.com/spacemeshos/go-spacemesh/common/types" "github.com/spacemeshos/go-spacemesh/log" ) func newFullTortoise(config Config, common *commonState) *full { return &full{ Config: config, commonState: common, votes: map[types.BallotID]votes{}, ab...
package vault import ( "fmt" "io/ioutil" "os" "path/filepath" "strings" "github.com/variantdev/vals/pkg/api" vault "github.com/hashicorp/vault/api" ) const ( FormatYAML = "yaml" FormatRaw = "raw" ) // Test procedure: // // $ vault secrets enable -path mykv kv // Success! Enabled the kv secrets engine at...
package delete import ( "fmt" "time" "github.com/weaveworks/eksctl/pkg/actions/nodegroup" "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/weaveworks/logger" api "github.com/weaveworks/eksctl/pkg/apis/eksctl.io/v1alpha5" "github.com/weaveworks/eksctl/pkg/authconfigmap" "github.com/weaveworks/e...
/* * 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 auth import ( "bytes" "crypto/aes" "crypto/rand" "crypto/rsa" "crypto/sha1" "crypto/x509" "encoding/base64" "encoding/json" "errors" "fmt" "github.com/Tnze/go-mc/data/packetid" "io/ioutil" "net/http" "strings" "github.com/Tnze/go-mc/net" "github.com/Tnze/go-mc/net/CFB8" pk "github.com/Tnze/go...
/* * Copyright 2020 ZUP IT SERVICOS EM TECNOLOGIA E INOVACAO SA * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required...
package main import ( "github.com/go-gl/gl/v2.1/gl" "github.com/go-gl/glfw/v3.1/glfw" "github.com/vova616/chipmunk" "github.com/vova616/chipmunk/vect" "math" "log" "math/rand" "os" "runtime" "time" ) var ( ballRadius = 25 ballMass = 1 space *chipmunk.Space balls []*chipmunk.Shape staticL...
// Copyright 2019 The Kubernetes Authors. // SPDX-License-Identifier: Apache-2.0 package resource import ( "encoding/json" "fmt" "log" "strings" "sigs.k8s.io/kustomize/v3/internal/kusterr" "sigs.k8s.io/kustomize/v3/pkg/ifc" "sigs.k8s.io/kustomize/v3/types" ) // Factory makes instances of Resource. type Facto...
package list import ( "fmt" "strings" ) type ( // Thing is used as a placeholder for some other data type. Thing string // List is a single linked list. List struct { Head *Node Tail *Node // Used for quick appending Size int } // Node is a node in a List. Node struct { Data Thing Next *Node } )...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: users.proto package userspb import ( context "context" fmt "fmt" proto "github.com/golang/protobuf/proto" _ "github.com/golang/protobuf/ptypes/timestamp" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc...
// Package launchpad file runtime.go contains runtime support for reference // tracking and output assembled object to represent parsed view of the org // for later processing. package launchpad import ( "errors" "fmt" "io" "log" "sort" "strings" ) var ( errUndefinedReference = errors.New("undefined reference"...
package proxy import ( "bytes" "crypto" "crypto/rand" "crypto/rsa" "crypto/sha256" "crypto/x509" "encoding/base64" "encoding/hex" "encoding/pem" "fmt" "hash" "io/ioutil" "net/http" "strings" ) // Only headers enumerated in this list are used to compute the signature of a request. var signedHeaders = []s...
package apiextra import ( "github.com/thewug/fsb/pkg/storage" "github.com/thewug/gogram/data" "regexp" "strconv" "strings" "fmt" ) const NONEXISTENT_POST = -1 const NONEXISTENT_PARENT = -2 const BLANK_PARENT = -1 const UNCHANGED_PARENT = 0 type settings interface { GetApiEndpoint() string GetApiFilteredEn...
// Copyright 2017 The OPA Authors. All rights reserved. // Use of this source code is governed by an Apache2 // license that can be found in the LICENSE file. package cmd import ( "bytes" "fmt" "io" "io/ioutil" "os" "os/exec" "path/filepath" "github.com/open-policy-agent/opa/format" "github.com/spf13/cobr...
package adb import ( "fmt" "github.com/android-test-runner/atr/command" "os/exec" "strconv" ) type Adb interface { Version() (string, error) ConnectedDevices() ([]string, error) DisableAnimations(deviceSerial string) error Install(apkPath string, deviceSerial string) command.ExecutionResult Uninstall(package...
package endpoint import ( "fmt" "net/url" "os" "strings" "github.com/cockroachdb/errors" "github.com/inconshreveable/log15" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apima...
package idgenerator import ( "errors" "strconv" "sync" "time" "github.com/gomodule/redigo/redis" ) //CachedIDGenerator 缓存ID生成器实体 type CachedIDGenerator struct { //configEntity redis配置 configEntity *RedisConfig redisPool *redis.Pool baseOption *Option mapContainer map[string]*idContainer } // RedisCon...
// Copyright 2021 VMware Tanzu Community Edition contributors. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package e2e_test import ( "fmt" "os" "path/filepath" "strings" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/vmware-tanzu/community-edition/addons/packages/test/pkg/u...
/* 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, ...
// //Created by xuzhuoxi //on 2019-04-05. //@author xuzhuoxi // package astar type IGridMap interface { // 初始化地图大小 InitGridMap(dataSize, gridSize Size) // 格式大小 GetGridSize() Size // 地图数据大小 GetDataSize() Size // 地图像素大小 GetPixelSize() Size // AStart算法 GetAStartAlg() IAStarAlg // 格式数据值 GetDataValue(pos Posit...
/* Copyright 2018-2019 <NAME>, S.A. 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 sequence import ( "errors" "fmt" "regexp" "sort" "strconv" "strings" ) var ( ErrNotSeqfile = errors.New("not a sequence file") ErrFrameExists = errors.New("frame exists") ErrNegativeFrame = errors.New("nagative frame") ) // Splitter is a file name splitter. type Splitter struct { // re catches...
package recurly import ( "encoding/xml" "net" ) const ( // TransactionStatusSuccess is the status for a successful transaction. TransactionStatusSuccess = "success" // TransactionStatusFailed is the status for a failed transaction. TransactionStatusFailed = "failed" // TransactionStatusVoid is the status for...
/* SPDX-License-Identifier: Apache-2.0 Copyright Contributors to the Submariner 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 requ...
package tests import ( "fmt" "io/ioutil" "path/filepath" "strings" "testing" "github.com/ghodss/yaml" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "sigs.k8s.io/kustomize/v3/k8sdeps/kunstruct" "sigs.k8s.io/kustomize/v3/k8sdeps/transformer" "sigs.k8s.io/kustomize/v3/pkg/fs" "sigs.k8s.io/kustomize/v3/p...
package agent import ( "bytes" "fmt" "io" "net/http" "strconv" "strings" "time" "github.com/hashicorp/consul/agent/consul/structs" ) const ( // maxQueryTime is used to bound the limit of a blocking query maxQueryTime = 600 * time.Second ) // EventFire is used to fire a new event func (s *HTTPServer) Event...
// Simple smtp client to send email(support Chinese). // Work well with qq, 163, mac mail app, google mail. package smtpx import ( "bytes" "crypto/tls" "encoding/base64" "fmt" "log" "net" "net/smtp" "net/url" "strings" "sync" ) type Attachment struct { Filename string Data []byte } type Sender struct...
package test import ( "fmt" "os" "path/filepath" "sort" "strings" "github.com/fatih/color" yaml "gopkg.in/yaml.v3" "github.com/benthosdev/benthos/v4/internal/config" ifilepath "github.com/benthosdev/benthos/v4/internal/filepath" "github.com/benthosdev/benthos/v4/internal/log" ) var green = color.New(color...
package controllers import ( "context" "encoding/json" "errors" "fmt" "io" "os" "os/signal" "strings" "syscall" options "github.com/breathbath/go_utils/v2/pkg/config" io2 "github.com/breathbath/go_utils/v2/pkg/io" "github.com/cloudradar-monitoring/rportcli/internal/pkg/models" "github.com/sirupsen/logrus...
// Code generate by sfindex. DO NOT EDIT. // Package sfgo implements Go stubs for the SysFlow format. package sfgo // Attribute defines an indexed attribute. type Attribute uint32 // Flat indexes. const ( ARRAY_INT Attribute = 0 ARRAY_STR Attribute = 0 SF_REC_TYPE Attribute = ARRAY_INT //Type name: SFHeader S...
package did import ( "crypto/ecdsa" "encoding/hex" log "github.com/golang/glog" "github.com/joincivil/id-hub/pkg/linkeddata" "github.com/pkg/errors" "github.com/ethereum/go-ethereum/crypto" ) // ValidDocPublicKey ensures that the given DocPublicKey is of a supported type, // has a valid key for that type and...
package main import ( "bytes" "errors" "io/ioutil" "log" "regexp" "strconv" "strings" "text/template" "time" "github.com/russross/blackfriday" ) type post struct { Author string Date time.Time Title string Content string Preview string Page boo...
package dispatcher import ( "errors" "reflect" ) var ( ErrInvalidServiceType = errors.New("service must be a pointer to struct") ErrNonExistentService = errors.New("service is not registered in the dispatcher") ErrNonExistentMethod = errors.New("method is not registered in the dispatcher") ErrInvalidA...
package main import ( "bytes" "fmt" "os" "strings" ) var tabSpaces = []rune(strings.Repeat(" ", kiloTabStop)) const startMsg = "HELP: Ctrl + S to save | Ctrl + Q to exit | Ctrl + F to find" const kiloTabStop = 4 const numStatusRows = 2 // View handles display of editor, status and prompts on screen type View ...
package main import ( "container/list" "fmt" "github.com/mattn/go-runewidth" "github.com/nsf/termbox-go" "gopkg.in/sorcix/irc.v2" "strings" "unicode/utf8" ) var buffer *list.List var limit int func formatmessage(msg *irc.Message) string { prefix := msg.Prefix if prefix == nil { prefix = &irc.Prefix{"unkno...
// Copyright 2020 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 main import ( "math/rand" "os" "time" "github.com/spf13/cobra" "github.com/lxc/lxd/lxd/daemon" "github.com/lxc/lxd/lxd/events" "github.com/lxc/lxd/lxd/operations" "github.com/lxc/lxd/lxd/response" "github.com/lxc/lxd/shared/logger" "github.com/lxc/lxd/shared/logging" "github.com/lxc/lxd/shared/ver...
package api import ( "io" "net" "net/http" _ "net/http/pprof" // we need this side effect that loads the pprof endpoints to defaultServerMux "sync" "time" "github.com/centrifuge/go-centrifuge/config" "github.com/centrifuge/go-centrifuge/errors" "github.com/centrifuge/go-centrifuge/utils" "github.com/grpc-ec...
package docker import ( "crypto/tls" "crypto/x509" "encoding/pem" "fmt" "net" "net/http" "os" "time" "github.com/docker/cli/cli/connhelper" "github.com/docker/cli/cli/context" "github.com/docker/cli/cli/context/store" "github.com/docker/docker/client" "github.com/docker/go-connections/tlsconfig" "github...
/* * The Plaid API * * The Plaid REST API. Please see https://plaid.com/docs/api for more details. * * API version: 2020-09-14_1.54.0 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package plaid import ( "encoding/json" ) // TransferFailure The failure reason if the ...
/* Package main provides a toy example use of Trails' http stack. */ package main import ( "embed" "errors" "net/http" "net/url" "os" "time" "github.com/xy-planning-network/trails/http/ctx" "github.com/xy-planning-network/trails/http/middleware" . "github.com/xy-planning-network/trails/http/resp" "github....
package main import ( "bufio" "flag" "fmt" "log" "math/rand" "os" "path/filepath" "strconv" "strings" "time" "github.com/Sirupsen/logrus" "github.com/robfig/cron" "github.com/zelenin/go-tdlib/client" ) // Giveaways is our object that holds the content parsed from the groups file type Giveaways struct {...
package GUI import ( "fmt" "github.com/icza/gowut/gwu" "myProject/videoMaker/account" "strings" ) var ( l1 gwu.Label l2 gwu.Label l3 gwu.Label ) func buildActiveUI(event gwu.Event) gwu.Comp { p := gwu.NewVerticalPanel() if account.AppAccount.IsActive() { buildActive(p) } else { buildUnActive(p) } b...
package broker import ( "encoding/json" "errors" "testing" "gopkg.in/yaml.v2" "bytes" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/Peripli/service-manager-cli/internal/cmd" "github.com/Peripli/service-manager-cli/pkg/smclient/smclientfakes" "github.com/Peripli/service-manager-cli/pkg...
// SPDX-License-Identifier: Unlicense OR MIT package driver import ( "errors" "image" "time" "gioui.org/internal/f32color" "gioui.org/shader" ) // Device represents the abstraction of underlying GPU // APIs such as OpenGL, Direct3D useful for rendering Gio // operations. type Device interface { BeginFrame(tar...
package driver import ( "sync" "fmt" "regexp" "strings" "log" "encoding/json" "time" "reflect" "strconv" ) const API_VERSION = "v1.3" const RegularxEpression = `\{\$([a-zA-Z0-9\-\_\[\]\'\"]+)\}` const RegularxEpressionKey = `([a-zA-Z0-9\-\_]+)` var reqTagAll *regexp.Regexp var reqTagKey *regexp.Regexp f...
/* * Copyright 2019 Comcast Cable Communications Management, 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 r...
/* * MinIO Cloud Storage, (C) 2017 MinIO, 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 la...
package typeform_test import ( "fmt" "io/ioutil" "net/http" "net/http/httptest" "strings" "testing" "github.com/gorilla/mux" "github.com/stretchr/testify/assert" "github.com/marotpam/typeform-go" ) const ( formIDCreatedForm = "createdFormID" formIDRetrievedForm = "retrievedFormID" formIDDeletedForm ...
package client import ( "bytes" "crypto/tls" "crypto/x509" "encoding/base64" "fmt" "io/ioutil" "log" "net" "net/http" "time" "github.com/byxorna/homer/pkg/types" "github.com/miekg/dns" "github.com/patrickmn/go-cache" ) type client struct { cfg Config listenIP net.IP listenPort int httpClien...
// +build ignore package main import ( . "github.com/mmcloughlin/avo/build" . "github.com/mmcloughlin/avo/operand" . "github.com/mmcloughlin/avo/reg" . "github.com/segmentio/asm/build/internal/x86" ) func init() { ConstraintExpr("!purego") } func main() { TEXT("ContainsByte", NOSPLIT, "func(haystack []byte, n...
// Copyright 2017 DigitalOcean. // // 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 aa import ( "fmt" "log" "strings" "time" "github.com/hi-iwi/AaGo/util" ) type Configuration struct { Name string `yaml:"name"` Env string `yaml:"env"` // dev test preprod product TimezoneID string `yaml:"timezone_id"` // e.g. "Asia/Shanghai" TimeLocation *time.Location Ti...
package info_greffe import ( "encoding/json" "io/ioutil" "net/http" url2 "net/url" "os" "strconv" "time" "github.com/graniet/go-pretty/table" "github.com/graniet/operative-framework/session" ) type InfoGreffeRegistration struct { session.SessionModule sess *session.Session `json:"-"` Stream *session.St...
// Copyright 2017 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...
package di import ( "fmt" "reflect" ) // Scope is the struct injector's struct value scope/permant state. // See `Stateless` and `Singleton`. type Scope uint8 const ( // Stateless is the scope that the struct should be different on each binding, // think it like `Request Scoped`, per-request struct for mvc. Sta...
package filters import ( "fmt" "github.com/stretchr/testify/assert" "reflect" "testing" ) func TestRegexp(t *testing.T) { for _, in := range []string{ "https://foo.com/blah_blah", "http://foo.com/blah_blah", "http://foo.com/blah_blah/", "http://foo.com/blah_blah_(wikipedia)", "http://foo.com/blah_blah_...
package main import ( "encoding/json" "errors" "fmt" "os" "time" "github.com/jetstack/cert-manager/pkg/acme/webhook/apis/acme/v1alpha1" "github.com/jetstack/cert-manager/pkg/acme/webhook/cmd" "github.com/selectel/cert-manager-webhook-selectel/selectel" coreV1 "k8s.io/api/core/v1" extAPI "k8s.io/apiextension...
// errorcheck -0 -m -l // Copyright 2012 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. // Test, using compiler diagnostic flags, that the escape analysis is working. // Compiles but does not run. Inlining is disabled. pac...
/* * 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 operator import ( "context" "errors" "fmt" "github.com/aquasecurity/starboard/pkg/ext" "github.com/aquasecurity/starboard/pkg/operator/aqua" "github.com/aquasecurity/starboard/pkg/operator/controller" "github.com/aquasecurity/starboard/pkg/operator/controller/job" "github.com/aquasecurity/starboard/pk...
// Copyright (c) Dropbox, 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, publish, dist...
package sharedhttpcache import ( "net/http" "time" ) //CacheConfig defines a config for how the cache should behave // A different cache config can be used on a per request basis like for different websites or pages type CacheConfig struct { //CacheableMethods is a list of request methods for which responses may ...
/* 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, softwar...
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package pinpointemail import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" "github.com/aws/aws-sdk-go-v2/private/protocol" ) // A request to retrieve the results of a predictive inbox placement ...
package types import ( "fmt" ) type WErr struct { code int msg string } func NewWErr(code int, msg string) *WErr { return &WErr{ code: code, msg: msg, } } func (e *WErr) Error() string { return e.msg } func (e *WErr) ErrorCode() int { return e.code } var ( ErrArgsInvalid = NewWErr(-600001, "...
package main import ( "encoding/json" "fmt" "log" "net/http" "os" "strings" "github.com/go-errors/errors" "github.com/gorilla/mux" "github.com/mitchellh/cli" "github.com/svanas/nefertiti/command" ctcommand "github.com/svanas/nefertiti/command" "github.com/svanas/nefertiti/flag" ) const ( APP_NAME = "...
package aws import ( "fmt" "log" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/neptune" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/schema" ) func resourceAwsNeptuneSubnetGroup() *schema.Resource { return &schema.Resource{ Create: resourceAws...
package evaluatedownloads import ( "bytes" "encoding/base64" "encoding/json" "fmt" "log" "net/http" "net/url" "os" "strings" "jfrog-test/src/common" ) func basicAuth(username, password string) string { auth := fmt.Sprintf("%s:%s", username, password) //log.Println(auth) return base64.StdEncoding.EncodeT...
// Copyright 2019 The OpenSDS 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...
// +build linux // Package serverstarter provides a server starter which can be used to do graceful restart. package serverstarter import ( "fmt" "net" "os" "os/exec" "os/signal" "strconv" "strings" "syscall" ) const ( stdFdCount = 3 // stdin, stdout, stderr defaultEnvListenFDs = "LISTEN_FDS" ) /...
// Copyright 2020 <NAME>. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package intern lets you make smaller comparable values by boxing // a larger comparable value (such as a 16 byte string header) down // into a globally unique 8 byte...
package framed_msgpack_rpc // // Most code borrowed from: github.com/ugorji/go/codec // with small changes for framing & for single args (rather than arrays of 1) // import ( "bufio" "bytes" "fmt" "io" "io/ioutil" "net/rpc" "sync" "github.com/ugorji/go/codec" ) // ------------------------------------- // r...
// 一个微博搜索的例子。 package main import ( "bufio" "encoding/gob" "encoding/json" "flag" "io" "log" "net/http" "os" "os/signal" "reflect" "strconv" "strings" "github.com/huichen/wukong/engine" "github.com/huichen/wukong/types" ) const ( SecondsInADay = 86400 MaxTokenProximity = 2 ) var ( searcher ...
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** package multai import ( "github.com/pkg/errors" "github.com/pulumi/pulumi/sdk/go/pulumi" ) // Provides a Spotinst Multai Target Set. // // > Thi...
package sessions // import "github.com/pomerium/pomerium/internal/sessions" import ( "errors" "fmt" "strings" "time" "github.com/cespare/xxhash/v2" "github.com/mitchellh/hashstructure" oidc "github.com/pomerium/go-oidc" "golang.org/x/oauth2" "gopkg.in/square/go-jose.v2/jwt" ) const ( // DefaultLeeway defin...
/* * Copyright 2022 LimeChain Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
package vm import ( "encoding/binary" "errors" "github.com/nspcc-dev/neo-go/pkg/crypto/hash" "github.com/nspcc-dev/neo-go/pkg/smartcontract" "github.com/nspcc-dev/neo-go/pkg/util" "github.com/nspcc-dev/neo-go/pkg/vm/opcode" ) // Context represents the current execution context of the VM. type Context struct { ...
package chserver import ( "net/http" "strings" "sync/atomic" "time" chshare "github.com/jpillora/chisel/share" "github.com/jpillora/chisel/share/cnet" "github.com/jpillora/chisel/share/settings" "github.com/jpillora/chisel/share/tunnel" "golang.org/x/crypto/ssh" "golang.org/x/sync/errgroup" ) // handleClie...
package cluster import ( "context" "fmt" "os" "sort" "strings" "sync" "text/tabwriter" "time" etcdclient "github.com/coreos/etcd/client" "github.com/coreos/etcd/clientv3" "bytes" "github.com/openshift/origin/pkg/diagnostics/types" ) // EtcdWriteVolume is a Diagnostic to check the writes occurring again...
package mtls import ( v1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/labels" "github.com/kiali/kiali/business/checkers/common" "github.com/kiali/kiali/kubernetes" ) const ( MTLSEnabled = "MTLS_ENABLED" MTLSPartiallyEnabled = "MTLS_PARTIALLY_ENABLED" MTLSNotEnabled = "MTLS_NOT_ENABLED" MTLSDi...
package jenkins import ( "crypto/tls" "errors" "fmt" "io" "net/http" "os" "github.com/jenkins-x/golang-jenkins" jenkauth "github.com/jenkins-x/jx/pkg/auth" "github.com/jenkins-x/jx/pkg/log" "github.com/jenkins-x/jx/pkg/util" "gopkg.in/AlecAivazis/survey.v1/terminal" ) func GetJenkinsClient(url string, bat...
package aws import ( "fmt" "log" "strings" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hashicorp/terraform-plugin-sdk/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "github.com/terraform-provide...
package ztime import ( "fmt" "math/rand" "reflect" "testing" "time" "zgo.at/zstd/zruntime" ) func TestDurationsGrow(t *testing.T) { d := NewDurations(0) test := func(wantCap, wantLen int, vals ...time.Duration) { t.Helper() if cap(d.list) != wantCap || len(d.list) != wantLen { t.Errorf("wrong size:\n...
package conversion import ( "fmt" "strings" v2 "github.com/maistra/istio-operator/pkg/apis/maistra/v2" ) const ( searchSuffixGlobal = "global" searchSuffixNamespaceGlobalTemplate = "{{ valueOrDefault .DeploymentMeta.Namespace \"%s\" }}.global" clusterDomainDefault = "cluster.local" ) // popu...
package video import ( "github.com/curt-labs/API/helpers/apicontextmock" "github.com/curt-labs/API/models/brand" // "github.com/curt-labs/API/models/products" . "github.com/smartystreets/goconvey/convey" "testing" ) func TestVideo_New(t *testing.T) { var v Video var ch Channel var cdn CdnFile var cdnft CdnFi...
// Copyright 2020 New Relic Corporation. All rights reserved. // SPDX-License-Identifier: Apache-2.0 package sampler import ( "fmt" "github.com/newrelic/infrastructure-agent/pkg/trace" "reflect" "regexp" "strings" ) var ( typesToEvaluate = map[string]bool{"ProcessSample": true} ) // ExpressionMatcher is an in...
package elasticsql import ( "errors" "fmt" "strings" "github.com/xwb1989/sqlparser" ) // handleComparisonExpr ... // 处理表达式 // step 0 func handleComparisonExpr(comparisonExpr *sqlparser.ComparisonExpr, topLevel bool) (dslExpr string, err error) { var colName, colVal = ``, `` if colName, err = getComparisonExprL...
package app import ( "os" "yap/nlp/format/conllu" "yap/nlp/format/lattice" "yap/nlp/format/raw" "yap/nlp/parser/ma" nlp "yap/nlp/types" // "yap/util" "fmt" "log" // "os" "strings" "github.com/gonuts/commander" "github.com/gonuts/flag" ) var ( dictFile, inRawFile, outLatticeFile string maxOOVMSRPerPO...
// Copyright 2020 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 errorstest import ( "bytes" "os" "os/exec" "path/filepath" "strings" "testing" "unicode" ) // A manually modified object file could pass unexpe...