text
stringlengths
3.08k
10.4k
package main import ( "crypto/sha256" "crypto/tls" "crypto/x509" "encoding/base64" "flag" "fmt" "io/ioutil" "log" "net" "net/http" "os" "runtime" "github.com/myfreeweb/443d/demux" "github.com/myfreeweb/443d/keepalive" "github.com/ryanuber/go-glob" "golang.org/x/net/http2" "gopkg.in/yaml.v2" ) type C...
package main import ( "bytes" "context" "encoding/json" "fmt" "io/ioutil" "log" "net/http" "os" "os/signal" "sync/atomic" "time" ) type key int // Service struct type Service struct { ServiceName string `json:"serviceName"` Value int `json:"value"` } const ( requestIDKey key = 0 serverURL...
package main import ( "encoding/csv" "fmt" "github.com/pkg/sftp" "golang.org/x/crypto/ssh" "io/ioutil" "os" "os/user" "regexp" "time" ) const ( OK = "OK" WAR = "WARNING" CRI = "CRITICAL" UNK = "UNKNOWN" OK_CODE = 0 WAR_CODE = 1 CRI_CODE = 2 UNK_CODE = 3 ) type DeviceHistory str...
package gotool import ( "fmt" glog "github.com/snail007/gmc/module/log" ghttp "github.com/snail007/gmc/util/http" gmap "github.com/snail007/gmc/util/map" goinstall "github.com/snail007/gmct/scripts/go/install" "github.com/snail007/gmct/tool" "os" "os/exec" "strings" "time" ) var ( installPkg string aliasD...
package program import ( "encoding/json" "fmt" "io" "io/ioutil" "os" "runtime" "strings" "testing" "github.com/elves/elvish/pkg/buildinfo" "github.com/elves/elvish/pkg/program/shell" "github.com/elves/elvish/pkg/program/web" ) var findProgramTests = []struct { args []string checker func(Program) bool...
package ldvalue import ( "encoding/json" "testing" "gopkg.in/launchdarkly/go-sdk-common.v2/jsonstream" "github.com/stretchr/testify/assert" ) func TestEmptyOptionalString(t *testing.T) { o := OptionalString{} assert.False(t, o.IsDefined()) assert.Equal(t, "", o.StringValue()) s, ok := o.Get() assert.Equal...
package main import ( "flag" "fmt" "os" "strings" log "github.com/Sirupsen/logrus" "github.com/rifflock/lfshook" "github.com/wptechinnovation/worldpay-within-sdk/sdkcore/wpwithin" "github.com/wptechinnovation/worldpay-within-sdk/sdkcore/wpwithin/rpc" ) var applicationVersion string var applicationBuildDate s...
// Copyright © 2018 shoarai // Package washout provides washout filters // to approximately display the sensation of vehicle motions. package washout import ( "math" "github.com/shoarai/washout/internal/integral" ) // A Washout is a washout filter. type Washout struct { TranslationScale, RotationScale float64 ...
package garp import ( "fmt" "github.com/cryptowilliam/goutil/basic/gerrors" "github.com/cryptowilliam/goutil/basic/glog" "github.com/cryptowilliam/goutil/net/gnet" "github.com/cryptowilliam/goutil/safe/gwg" "github.com/google/gopacket" "github.com/google/gopacket/layers" "github.com/google/gopacket/pcap" "net...
package main import ( "bytes" "fmt" "libnet" "net" "protocol" "regexp" "sync" "time" log "user_log" ) func init() { Host = make(map[string]string) index = 1 } var indexLook sync.Mutex var index int type Transfer struct { server *MsgServer listener net.Listener Client_UUID string RemoteAddr s...
// Copyright 2020-present Open Networking 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 applica...
package executor import ( "fmt" "github.com/golang/glog" podutil "github.com/turbonomic/kubeturbo/pkg/discovery/util" "github.com/turbonomic/kubeturbo/pkg/util" api "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/dynamic" kclient "k...
// Copyright © 2018 NAME HERE <EMAIL ADDRESS> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law ...
// Copyright (c) 2020 10X Genomics, Inc. All rights reserved. package refactoring import ( "fmt" "os" "github.com/martian-lang/martian/martian/syntax" ) // Finds calls which have outputs but for which none of the outputs are bound, // either to a pipeline output, another call input, or to a retain. // // The pip...
// Copyright 2014 Unknwon // // Licensed under the Apache License, Version 2.0 (the "License"): you may // not use this file except in compliance with the License. You may obtain // a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writ...
/* Copyright 2019 <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 i...
/* 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 client_test import ( "io/ioutil" "os" "path/filepath" "testing" "github.com/shibukawa/configdir" "github.com/stretchr/testify/require" "github.com/trisacrypto/directory/pkg/gds/client" "gopkg.in/yaml.v2" ) // Test that DefaultProfiles returns a Profiles object with some valid profiles. func TestDefau...
package main import ( "archive/zip" "bytes" "flag" "fmt" "io" "log" "net/http" "os" "path/filepath" "strings" "time" "github.com/bingoohuang/strcase" "github.com/mitchellh/go-homedir" ) // nolint gochecknoglobals var ( pkgName string targetDir string disableCache bool ) // nolint func init()...
// Package gotie provides high-level bindings and a simple command line client // for the DCSO Threat Intelligence Engine (TIE) API. package gotie // DCSO gotie API bindings // Copyright (c) 2016-2018, DCSO GmbH import ( "encoding/json" "fmt" "io" "log" "net/http" "net/http/httputil" "net/url" "os" "strings"...
// // Copyright (c) 2016 Intel Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or...
package models import ( "github.com/peake100/turnup-go/errs" "strings" ) // Price Pattern Enum value // // 0 = "FLUCTUATING" // 1 = "BIG SPIKE" // 2 = "DECREASING" // 3 = "SMALL SPIKE" // 4 = "UNKNOWN" type PricePattern int func (pattern PricePattern) String() string { return [5]string{ "FLUCTUATING", "B...
package main import ( "bytes" "encoding/json" "fmt" "io/ioutil" "log" "net/http" "os" "path/filepath" "sort" "strings" "text/template" "github.com/deiu/rdf2go" "github.com/pkg/errors" "go.uber.org/multierr" "golang.org/x/tools/imports" "github.com/meowpub/meow/ld" ) // Base path to the github.com/me...
// +build !integration package simpleprotocol import ( "testing" "time" "github.com/elastic/beats/libbeat/beat" "github.com/elastic/beats/libbeat/common" "github.com/stretchr/testify/assert" ) type testParser struct { payloads []string simpleprot *simpleprotocolPlugin stream *stream } var testParserC...
package kuma import ( "github.com/layer5io/meshkit/errors" ) var ( // Error code for failed service mesh installation // ErrOpInvalidCode represents the errors which are generated // when an invalid operation is invoked ErrOpInvalidCode = "1002" // ErrInstallKumaCode represents the errors which are generated ...
package scout import ( "bytes" "context" "crypto/tls" "io" "io/ioutil" "net" "net/http" "net/http/httptrace" "strings" "time" ) type HTTPRequestMetrics struct { GetConn int64 GotConn int64 GotFirstResponseByte int64 DNSStart int64 DNSDone int64 Connec...
// Code generated by protoc-gen-go. // source: commands/group_operation.proto // DO NOT EDIT! package commands import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" import protocol_message_misc "go-test/grape/protocol/message/misc" // Reference imports to suppress errors if they are not...
package main import ( "bytes" "context" "errors" "fmt" "io" "os" "strings" "time" "github.com/anexia-it/geodbtools" "github.com/cheggaaa/pb" "github.com/spf13/cobra" "go.uber.org/multierr" ) var cmdConvert = &cobra.Command{ Use: "convert <database> <target>", Short: `Convert a GeoIP database from one...
package pubsub import ( "bufio" "io" "sort" "sync" "time" "github.com/morganhein/gondi/logger" "github.com/morganhein/gondi/schema" ) var log schema.Logger type Publisher struct { device schema.Device input chan schema.MessageEvent s map[int]chan schema.MessageEvent mut sync.RWMutex } type subs...
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. package buildmodel import ( "errors" "flag" "path/filepath" "testing" "github.com/go-test/deep" "github.com/microsoft/go-infra/buildmodel/buildassets" "github.com/microsoft/go-infra/buildmodel/dockermanifest" "github.com/microsoft/go-...
package kit import ( "context" "strings" "time" "golang.org/x/xerrors" addr "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/big" "github.com/filecoin-project/lotus/api" napi "github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/chain/types" lcli "gi...
package hank_client import ( "time" "git.apache.org/thrift.git/lib/go/thrift" "github.com/LiveRamp/hank/hank-core/src/main/go/hank" "github.com/LiveRamp/hank-go/iface" "github.com/LiveRamp/hank-go/syncext" "github.com/LiveRamp/hank-go/thriftext" "github.com/pkg/errors" log "github.com/sirupsen/logrus" ) typ...
package main import ( "bytes" "flag" "html/template" "io/ioutil" "log" "net" "net/http" "os" "path/filepath" "strings" g "github.com/gogits/git" "github.com/lemmi/compress" "github.com/lemmi/ghfs" "github.com/lemmi/glubcms" "github.com/pkg/errors" "github.com/raymondbutcher/tidyhtml" ) const ( tmplP...
package main import ( "context" "crypto/tls" "io" "net" "net/http" "net/http/httptest" "path/filepath" "strings" "testing" ) func TestHandler(t *testing.T) { hosts := map[string]string{ "littleroot.org": ":" + getFreePort(), "passwords.littleroot.org": ":" + getFreePort(), "birthdays.littler...
package nginxconf import ( "strings" "text/template" ) var rootTmpl = template.New("root") var httpToHTTPSRedirectTmpl = template.Must(rootTmpl.New("httpsRedirect").Parse(strings.TrimSpace(` # Redirect HTTP to HTTPS server { listen 80; listen [::]:80; server_name {{.Domain}}; {{if .IsRedirect}} ...
package planner import ( "fmt" "github.com/dgraph-io/badger" "github.com/elliotcourant/arkdb/pkg/distribution" "github.com/elliotcourant/arkdb/pkg/storage" "github.com/elliotcourant/timber" "sort" "time" ) type setItem interface { Path() []byte Encode() []byte } type executeContext struct { start t...
package camalian import ( "sort" utils "github.com/nazarhussain/camalian-go/pkg/utils" ) type Palette []*Color type SortProperty int const ( HSLHue SortProperty = iota HSLSaturation HSLLightness HSVHue HSVSaturation HSVValue Red Green Blue ) var colorSortPropMap = map[SortProperty]func(*Color, *Color, ...
package salad import ( "bufio" "bytes" "flag" "fmt" "io/ioutil" "math" "math/rand" "os" "runtime" "strings" "time" "golang.org/x/net/html/charset" "golang.org/x/text/transform" "github.com/ikawaha/kagome/tokenizer" ) const betterLen = 60 //どのくらいの長さの文章にしたいか(その長さにするとは言ってない) const retryCount = 13 //文章の長...
package apiclient import ( "bytes" "encoding/json" "fmt" "net/http" "testing" "time" "github.com/NathanLBCooper/bandsintown-api-v1/datatypes" ) func TestRecommendedCanReceiveRecommendResponse(test *testing.T) { httpClient, mux, server := testServer() defer server.Close() const actualResponse = `[{"id":212...
package gb import ( "bytes" "os" "path/filepath" "strconv" "strings" "time" ) // cgo support functions // rungcc1 invokes gcc to compile cfile into ofile func rungcc1(pkg *Package, cgoCFLAGS []string, ofile, cfile string) error { args := []string{"-g", "-O2", "-fPIC", "-m64", "-pthread", "-fmessage-length=0",...
package transport import ( "fmt" // "log" "net" "sync" "sync/atomic" "time" "github.com/matthewgao/qtun/config" "github.com/matthewgao/qtun/iface" "github.com/matthewgao/qtun/protocol" "github.com/matthewgao/qtun/utils" "github.com/golang/protobuf/proto" "github.com/rs/zerolog/log" ) type Client struct ...
package main import( "github.com/staheri/goatlib/instrument" "github.com/staheri/goatlib/traceops" "github.com/staheri/goat/evaluate" "fmt" "os" //"strconv" "strings" //"bufio" "path/filepath" ) /*func experiment(path string,iter int,w *bufio.Writer) map[int][]db.Report{ // for each test, execute ...
package predict import ( "github.com/kiteco/kiteco/kite-golib/lexicalv0" "github.com/kiteco/kiteco/kite-golib/lexicalv0/lexer" ) const ( naturalWindowPct = 0.75 minNatural = 50 numLinesAfterCursorForContextAfterCursor = 1 ) func buildContextAfter(in Inputs, ...
// Copyright 2016 <NAME>, Inc. All rights reserved. // Licensed under the Apache License, version 2.0: // http://www.apache.org/licenses/LICENSE-2.0 package main import ( "bytes" "fmt" "io" "sort" "github.com/attic-labs/noms/go/types" ) type expr interface { ranges() queryRangeSlice dbgPrintTree(w io.Writer,...
/* * Copyright © 2019. mutl3y * * 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 wasm import ( "fmt" "strings" ) // Features are the currently enabled features. // // Note: This is a bit flag until we have too many (>63). Flags are simpler to manage in multiple places than a map. type Features uint64 // Features20191205 include those finished in WebAssembly 1.0 (20191205). // // See ht...
/* Copyright © 2020 NAME HERE <EMAIL ADDRESS> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writi...
// Copyright 2022 <NAME> <EMAIL> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to ...
package main import ( "encoding/json" // "gopkg.in/yaml.v2" "errors" "fmt" log "github.com/sirupsen/logrus" "io/ioutil" "path" "path/filepath" "regexp" "strings" ) func getJsonFile(path string) (bool, string) { if checkExt(path, ".json") { content, err := ioutil.ReadFile(path) if err != nil { log.Fa...
package duck import ( "time" "github.com/lindsaygelle/nook" "github.com/lindsaygelle/nook/animal" "github.com/lindsaygelle/nook/character" "github.com/lindsaygelle/nook/gender" "github.com/lindsaygelle/nook/personality" "golang.org/x/text/language" ) var ( derwinBirthday = nook.Birthday{ Day: 25, Month...
/* Copyright 2022. 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 config import "github.com/spaceuptech/space-cloud/utils" // Config holds the entire configuration type Config struct { Projects []*Project `json:"projects" yaml:"projects"` // The key here is the project id SSL *SSL `json:"ssl" yaml:"ssl"` Admin *Admin `json:"admin" yaml:"admin"` Deploy ...
// Copyright (c) 2020 Couchbase, 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 kiss import ( "OPQBot-QQGroupManager/Core" mydraw "OPQBot-QQGroupManager/draw" "bytes" "embed" "encoding/json" "github.com/mcoo/OPQBot" "github.com/mcoo/gg" "github.com/sirupsen/logrus" "image" "image/color" "image/color/palette" "image/draw" "image/gif" "image/png" "strconv" "strings" ) type ...
package main import ( "bufio" "flag" "fmt" "log" "os" "os/exec" "strings" ) func mustExec(cmd *exec.Cmd) { log.Println(strings.Join(cmd.Args, " ")) cmd.Stdout = os.Stdout cmd.Stderr = os.Stderr err := cmd.Run() if err != nil { panic(err) } } func mustGcloud(args ...string) { mustExec(exec.Command("gc...
/* Copyright (c) 2019 the Octant contributors. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package objectstatus import ( "context" "errors" "fmt" "strconv" "time" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/runtime" "github.com/...
package csharp_reflect import ( "fmt" tt "github.com/morphar/go-texttools" "io/ioutil" "log" "path" "reflect" "sort" "strings" ) type Options struct { Namespace string JsonProperty bool OverrideListToArray bool types map[reflect.Kind]string BaseUsings []string Ind...
package uback import ( "fmt" "strconv" "strings" "time" "github.com/sirupsen/logrus" ) var intervalAliases = map[string]string{ "yearly": "1y", "monthly": "1m", "weekly": "1w", "daily": "1d", "hourly": "1h", } type RetentionPolicy struct { Interval int // Minimum interval between two backups Count...
package schedules import ( "encoding/json" "net/http" "time" "github.com/go-chi/chi/v5" "go.uber.org/zap" "github.com/akrantz01/lights/api/database" "github.com/akrantz01/lights/api/events" "github.com/akrantz01/lights/api/handlers" "github.com/akrantz01/lights/api/logging" "github.com/akrantz01/lights/api...
// Copyright (c) 2013 The Vubeologists. All rights reserved // See the license at the root of this project // // For more information // http://redis.io/topics/transactions#cas // http://redis.io/commands/setnx package redigolock import ( "errors" redigo "github.com/garyburd/redigo/redis" "strconv" "time" ) //==...
package main import ( . "./existing_docs" . "./internal" . "./new_docs" . "./new_docs/templates" "fmt" "flag" "log" ) const skipOverrideNumber = -1 /* Generate docs for release. Value for 'branch' flag must be provided. If a failure is encounter, attempts to undo any changes to files in branch doc directory...
// Package lexer contains the definition of the lexer element of the glif interpreter package lexer import ( "github.com/TurnsCoffeeIntoScripts/git-log-issue-finder/pkg/interpreter/gitoken" ) // Lexer is the representation of the glif lexer // It contains the following: // - An input string (the program) // - Positi...
// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei...
package strategy import ( "github.com/markcheno/go-talib" indicator "github.com/xyths/go-indicators" "github.com/xyths/hs" "github.com/xyths/hs/exchange" "github.com/xyths/qtr/exchange/huobi" "go.uber.org/zap" "math" "sync" "time" ) type RtmExecutor interface { Exchange() exchange.Exchange Symbol() string ...
package gocbcore import ( "flag" "log" "os" "runtime" "runtime/pprof" "strings" "sync/atomic" "testing" "time" ) const ( defaultServerVersion = "5.1.0" ) var globalTestHarness *TestHarness type testLogger struct { Parent Logger LogCount []uint64 } func (logger *testLogger) Log(level LogLevel, offset ...
package bit import ( "reflect" "testing" "github.com/google/go-cmp/cmp" ) func sampleSet256() Set256 { var s Set256 s.Add(3) s.Add(63) s.Add(17) s.Add(70) s.Add(200) s.Add(201) s.Add(192) return s } func TestBasics256(t *testing.T) { s := sampleSet256() want := "{3, 17, 63, 70, 192, 200, 201}" got :=...
// Copyright (c) <NAME> @bwplotka // Licensed under the Apache License 2.0. package bingo import ( "bytes" "fmt" "io/ioutil" "os" "path/filepath" "strings" "text/template" "github.com/bwplotka/bingo/pkg/makefile" "github.com/pkg/errors" ) const ( MakefileBinVarsName = "Variables.mk" // TODO(bwplotka): We...
package smithy import ( "encoding/json" "fmt" "io/ioutil" "os" "path/filepath" "strings" "github.com/boynton/smithy/data" ) type Model struct { ast *AST } func (model *Model) String() string { return data.Pretty(model.ast) } func (model *Model) GetAst() *AST { return model.ast } func AssembleModel(paths...
package bose import ( "encoding/xml" "fmt" "io/ioutil" "net/http" "strconv" log "github.com/sirupsen/logrus" ) type Config struct { ErrorCode int `xml:"errorCode"` Message string `xml:"message"` StatusCode int `xml:"statusCode"` Success bool `xml:"success"` } type Client struct { httRespon...
package main import ( "encoding/json" "errors" "flag" "fmt" "github.com/PuerkitoBio/goquery" "github.com/gorilla/feeds" "github.com/gorilla/mux" "github.com/sa7mon/craigsfeed/data" "log" "net/http" "os" "strings" "time" ) func main() { var searchURL string var scrapeInterval int flag.StringVar(&search...
// Copyright (c) 2018-2019, Sylabs Inc. All rights reserved. // This software is licensed under a 3-clause BSD license. Please consult the // LICENSE.md file distributed with the sources of this project regarding your // rights to use or distribute this software. package singularity import ( "fmt" "io/ioutil" "os"...
package mrr import ( "encoding/binary" "encoding/json" "math" "reflect" "strconv" log "github.com/sirupsen/logrus" ) type ( ConversationInterface interface { // Request returns `*Request`. Request() *Request // SetRequest sets `*Request`. SetRequest(r *Request) // Payload Payload() map[string]in...
// © Copyright IBM Corporation 2020. All rights reserved. // SPDX-License-Identifier: Apache2.0 // package utility import ( "encoding/base64" "errors" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/secretsmanager"...
// Package session 使用monggodb进行session存储 // 使用方法 // sess:=session.New() 新建一个session结构体 // sess=sess.StartSession() 从数据库中获取数据到session对象 // sess.Set() sess.Get() // sess.Save() 设置完在之后,使用Save方法持久化保存到数据库里 package session import ( "crypto/rand" "encoding/base64" "io" "log" "net/http" "net/url" "time" "github....
// Copyright 2014 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 oauth2 import ( "context" "fmt" "net/http" "net/url" "strconv" "strings" "time" "github.com/BlancLoup/oauth2/internal" ) // expiryDelta deter...
// Package core contains database record definitions useable for // reading rows from a Stellar Core db package core import ( "bitbucket.org/atticlab/go-smart-base/strkey" "bitbucket.org/atticlab/go-smart-base/xdr" "bitbucket.org/atticlab/horizon/db2" "github.com/guregu/null" ) // Account is a row of data from th...
// 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 gamerules import ( "fmt" "runtime" "testing" . "chunkymonkey/types" ) const ( plankId = ItemTypeId(5) ironOreId = ItemTypeId(15) ironIngotId = ItemTypeId(265) plankFuelTime = Ticks(300) ) var ( emptySlot = Slot{} ) func callerDesc(skip int) string { if _, file...
/* Copyright 2020 The Skaffold 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...
package controller import ( "FoundationHelper_KnightHacks2020/model" // "bytes" "context" "github.com/gofiber/fiber/v2" "io" "log" "os" "os/exec" "strings" "sync" "time" ) // SyncBuf data structure // type SyncBuf struct { // mu sync.Mutex // buf bytes.Buffer // output string // overflow b...
/* Configures a BGP neighbor using a BGP Openconfig model template. It inmidiately starts listening for BGP neighbor state. */ package main import ( "bytes" "context" "flag" "fmt" "html/template" "log" "math/rand" "os" "os/signal" "strings" "time" "github.com/golang/protobuf/proto" xr "github.com/ljm625...
package s3 import ( "fmt" "mime" "net/url" "os" "path" "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" "github.com/aws/aws-sdk-go/service/s3/s3manager" humanize "github.com/dustin/go-humanize" "github.com/pkg/errors" "github.com/sir...
package cep import ( "context" "errors" "net/http" "reflect" "testing" ) type canceler struct{} type notfounder struct{} func (notfounder) Fetch(ctx context.Context, cep string) (Address, error) { return Address{}, &Error{Kind: CEPNotFound, Err: errors.New("CEP not found")} } func (canceler) Fetch(_ context.C...
package synccontroller import ( "encoding/json" "fmt" cscloud "github.com/containership/csctl/cloud" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/client-go/kubernetes" csv3 "github.com/containership/cluster-manager/pkg/apis/containership....
/* 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 1999-2021 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...
// +build windows, functional // 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/ // /...
package v1alpha1 import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) type SourceType string // +kubebuilder:validation:Enum=nodejs12;nodejs14;python38 type Runtime string const ( SourceTypeGit SourceType = "git" ) const ( Nodejs12 Runtime = "nodejs12" Nodejs14 Runtime = "node...
// Copyright 2017 The WPT Dashboard Project. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package webapp import ( "encoding/base64" "encoding/json" "fmt" "net/http" "strings" "time" "github.com/gorilla/mux" "github.com/web-platfo...
package data import ( "context" "fmt" "github.com/google/uuid" "math" "net/http" "os" "sync" "testing" "time" "github.com/edgexfoundry/edgex-go/internal/core/data/messaging" "github.com/edgexfoundry/edgex-go/internal/pkg/correlation/models" "github.com/edgexfoundry/edgex-go/internal/pkg/db" "github.com/...
package ledger import ( "encoding/binary" "github.com/golang/protobuf/proto" "github.com/vitelabs/go-vite/common/types" "github.com/vitelabs/go-vite/crypto" "github.com/vitelabs/go-vite/crypto/ed25519" "github.com/vitelabs/go-vite/log15" "github.com/vitelabs/go-vite/trie" "github.com/vitelabs/go-vite/vitepb" ...
package storage import ( "bytes" "io" mrand "math/rand" "os" "testing" "github.com/docker/distribution/context" "github.com/docker/distribution/digest" "github.com/docker/distribution/registry/storage/driver/inmemory" ) func TestSimpleRead(t *testing.T) { ctx := context.Background() content := make([]byte,...
package main import ( "fmt" "os" "strconv" "strings" "github.com/spreadshirt/f3/meta" "github.com/spreadshirt/f3/server" ftp "github.com/goftp/server" "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/spf13/cobra" ) // AppName is the name of the program. const AppName string = "f3" type cl...
package datasources import ( "context" "encoding/json" "fmt" "io/ioutil" "net" "net/http" "strings" "time" "github.com/cosandr/go-check-updates/api" log "github.com/sirupsen/logrus" "github.com/cosandr/go-motd/utils" ) // ConfUpdates extends ConfBase with a show toggle (same as warnOnly), path to file an...
package canal import ( "encoding/hex" "fmt" "strconv" "strings" "time" "github.com/go-mysql-org/go-mysql/mysql" "github.com/go-mysql-org/go-mysql/schema" "github.com/pingcap/errors" "github.com/shopspring/decimal" "github.com/siddontang/go-log/log" ) type dumpParseHandler struct { c *Canal name string...
package git_commands import ( "fmt" "regexp" "strings" "github.com/jesseduffield/lazygit/pkg/commands/oscommands" "github.com/jesseduffield/lazygit/pkg/common" "github.com/jesseduffield/lazygit/pkg/utils" ) // this takes something like: // * (HEAD detached at 264fc6f5) // remotes // and returns '264fc6f5' as t...
// The MIT License (MIT) // // Copyright (c) 2016, <NAME> // // 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, m...
/* * Copyright (c) 2018 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 applicabl...
// Copyright (c) 2017 The OpenTracing Authors // Copyright (c) 2016 <NAME> // 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 restrict...
/* * update_pods.go * * This source file is part of the FoundationDB open source project * * Copyright 2019-2021 Apple Inc. and the FoundationDB project 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 obtai...