text
stringlengths
3.08k
10.4k
package packages import ( "archive/zip" "go/ast" "go/parser" "go/token" "gotomate/log" "io" "io/ioutil" "os" "path/filepath" "regexp" "strings" ) type GotomatePackages struct { Packages []*Package } // Package Declare the structure of a package type Package struct { Name string Functions []string ...
package kubeconfig // Copyright (c) Microsoft Corporation. // Licensed under the Apache License 2.0. import ( "crypto/x509" "encoding/json" "encoding/pem" "fmt" "log" "net/http" "net/http/httputil" "strings" "time" "github.com/gorilla/mux" uuid "github.com/satori/go.uuid" "github.com/sirupsen/logrus" v1...
package gofinancial import ( "encoding/json" "fmt" "io" "os" "path" "time" "github.com/shopspring/decimal" "github.com/go-echarts/go-echarts/v2/charts" "github.com/go-echarts/go-echarts/v2/opts" "github.com/razorpay/go-financial/enums/interesttype" ) // Amortization struct holds the configuration and fina...
package pholcus_lib_lagou // 基础包 import ( "github.com/henrylee2cn/pholcus/app/downloader/request" //必需 "github.com/henrylee2cn/pholcus/common/goquery" //DOM解析 . "github.com/henrylee2cn/pholcus/app/spider" //必需 "strings" "net/http" ) //修改这个为其他岗位的,可以爬取其他岗位的数据 // const positionURL =...
package defaultnet import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net" "os" "path/filepath" "regexp" "text/template" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) // TODO: A smarter implementation would make sure cni-podman0 was unused before // making the default, and adjust if necessary co...
/* Copyright 2017 The OpenEBS 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 builtin import ( "compress/flate" "compress/gzip" "fmt" "io" "net/http" "runtime" "strings" "sync" log "github.com/sirupsen/logrus" "github.com/zalando/skipper/filters" ) const ( // DecompressionNotPossible is the state-bag key to indicate // to the subsequent filters during response processing t...
// Package jojo implements session interfaces for jwt // tokens for long-season application. package jojo import ( "context" "encoding/json" "fmt" "net/http" "strings" "time" "github.com/cristalhq/jwt/v3" "github.com/hakierspejs/long-season/pkg/models" "github.com/hakierspejs/long-season/pkg/services/happie...
// // Copyright (c) 2019, 2022 Oracle and/or its affiliates. All rights reserved. // // Licensed under the Universal Permissive License v 1.0 as shown at // https://oss.oracle.com/licenses/upl/ // // The basic example shows how to perform basic operations on an Oracle NoSQL table. // For example: // // Create a tab...
// Copyright (c) 2004-present Facebook All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package resolverutil import ( "context" "fmt" "reflect" "strconv" "github.com/facebookincubator/symphony/pkg/ent/user" "github.com/facebookincubat...
package main import ( "flag" "io/ioutil" "log" "sync" "time" "github.com/jhump/protoreflect/desc" "github.com/jhump/protoreflect/dynamic" "github.com/m3db/m3/src/dbnode/client" "github.com/m3db/m3/src/dbnode/encoding/proto" "github.com/m3db/m3/src/x/ident" xtime "github.com/m3db/m3/src/x/time" yaml "gopkg...
// Copyright 2021 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 audit import ( "bytes" "fmt" "go/token" "go/types" "strings" "golang.org/x/tools/go/callgraph" "golang.org/x/tools/go/types/typeutil" "golang...
package business import ( "sync" apps_v1 "k8s.io/api/apps/v1" "k8s.io/apimachinery/pkg/labels" "github.com/kiali/kiali/config" "github.com/kiali/kiali/kubernetes" "github.com/kiali/kiali/log" "github.com/kiali/kiali/models" ) // SvcService deals with fetching istio/kubernetes services related content and con...
package docstore import ( "github.com/v2pro/plz/countlog" "github.com/v2pro/quokka/kvstore" "time" "sync" "encoding/json" "context" ) var subscribers []*eventSubscriber var subscribersMutex = &sync.Mutex{} type eventProcessor struct { partitionId uint64 entityType string offset uint64 inbox eve...
/***************************************************************** * terraform-provider-vcloud-director * Copyright (c) 2017 VMware, Inc. All Rights Reserved. * SPDX-License-Identifier: BSD-2-Clause ******************************************************************/ package provider import ( "fmt" "os" "testing" ...
package quantile import ( "fmt" "math" "testing" "github.com/StackVista/stackstate-agent/pkg/quantile/summary" "github.com/stretchr/testify/require" ) func TestMerge(t *testing.T) { var ( c = Default() values []float64 s1 = &Sketch{} s2 = &Sketch{} sInsert = &Sketch{} s...
package main import ( "fmt" "log" "os" "os/exec" "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/jpillora/backoff" "github.com/pkg/errors" ) func volumeFromID(svc *ec2.EC2, volumeID, az string) (*ec2.Volume, error)...
package model import ( "github.com/fogleman/gg" "image" "math/rand" "studyImage/util" ) type Point struct { X, Y int } type Triangle struct { Points [3]Point R, G, B, A int //三角形颜色 } func (this *Triangle) RandInit(size Size) { this.R = rand.Intn(256) this.G = rand.Intn(256) this.B = rand.Intn(256) thi...
/* Copyright 2018 OpenEBS 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...
package remoteexec import ( "bytes" "fmt" "io" "io/ioutil" "log" "os" "strings" "time" "github.com/hashicorp/terraform/communicator" "github.com/hashicorp/terraform/communicator/remote" "github.com/hashicorp/terraform/terraform" "github.com/mitchellh/go-linereader" ) // ResourceProvisioner represents a r...
// // Copyright 2020 Pantacor 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 dti import ( //"strconv" "math" "strconv" ) const( CLOSE = "CLOSE" OPEN = "OPEN" HIGH = "HIGH" LOW = "LOW" VOL = "VOL" RSV = "RSV" KDJ_K = "KDJ_K" KDJ_D = "KDJ_D" KDJ_J = "KDJ_J" EMA12 = "EMA12" EMA26 = "EMA26" DIF = "DIF" DEA = "DEA" MACD = "MACD" BOLL = "BOLL" UB = "UB" L...
package main; import ( "math" "fmt" "os" ) type Node struct { p Point dir Direction fScore int32 gScore int32 parent *Node } func (n *Node) String() string { return fmt.Sprintf("%+v", *n); } const MAX_INT32 = int32((^uint32(0)) >> 1) func astar_search( state State, start *Nod...
// Copyright 2022 Northern.tech AS // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable ...
package mqtt import ( "encoding/json" "fmt" "github.com/koesie10/smartmeter/smartmeter" "go.uber.org/zap" "os" "time" mqttclient "github.com/eclipse/paho.mqtt.golang" ) var _ smartmeter.Publisher = (*publisher)(nil) type publisher struct { client mqttclient.Client logger *zap.SugaredLogger options Publis...
package bitcask import ( "encoding/binary" "hash/crc32" "os" "path/filepath" ) const ( // UnCommitted represents the tx unCommitted status UnCommitted uint16 = 0 // Committed represents the tx committed status Committed uint16 = 1 // Persistent represents the data persistent flag Persistent uint32 = 0 /...
package dac import ( "fmt" "sync" "github.com/ndss-2020-anonymized/fabric-amcl/amcl" "github.com/ndss-2020-anonymized/fabric-amcl/amcl/FP256BN" ) // Groth holds internal values such as y-values and PRG type Groth struct { q *FP256BN.BIG prg *amcl.RAND g1 interface{} g2 interface{} y []interface{} } /...
package memory // Memory Bank Controllers. Source: // [PANMBC] https://gbdev.io/pandocs/#mbc1 // 6000-7FFF - ROM/RAM Mode Select const ( ROMBanking = 0x00 RAMBanking = 0x01 ) // MBC1 (max 2MByte ROM and/or 32KByte RAM) type MBC1 struct { *ROM // Complete ROM (will be addressed according to ROMBank) *R...
package main import ( "context" "encoding/json" "flag" "fmt" "os" "path" "path/filepath" "regexp" "github.com/ViBiOh/httputils/v4/pkg/flags" "github.com/ViBiOh/httputils/v4/pkg/logger" "github.com/ViBiOh/httputils/v4/pkg/request" ) var ( chapterTitleRegex = regexp.MustCompile(`^#\s+(.*)\s*`) imgRegex ...
package middleware import ( "errors" "github.com/labstack/echo/v4" "net/http" ) type ( // KeyAuthConfig defines the config for KeyAuth middleware. KeyAuthConfig struct { // Skipper defines a function to skip middleware. Skipper Skipper // KeyLookup is a string in the form of "<source>:<name>" or "<source>...
package eval import ( "bufio" "fmt" "io" "os" "sync" "github.com/elves/elvish/pkg/eval/vals" "github.com/elves/elvish/pkg/strutil" ) // Port conveys data stream. It always consists of a byte band and a channel band. type Port struct { File *os.File Chan chan interface{} closeFile bool closeChan ...
package configurations import ( "log" "os" "path/filepath" "strconv" "github.com/dapr/cli/pkg/standalone" scheme "github.com/dapr/dapr/pkg/client/clientset/versioned" "github.com/dapr/dapr/pkg/config" "github.com/dapr/dashboard/pkg/age" meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // Configurations is a...
// Public Domain (-) 2010-present, The Web4 Authors. // See the Web4 UNLICENSE file for details. // Package process provides utilities for managing the current system process. package process import ( "context" "fmt" "os" "os/signal" "path/filepath" "runtime/debug" "sync" "syscall" ) // OSExit is the functio...
package pods import ( "context" "fmt" "os" "sync/atomic" "time" "github.com/jenkins-x-plugins/jx-verify/pkg/rootcmd" "github.com/jenkins-x/jx-helpers/v3/pkg/kube/pods" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/client-go/informers" ...
package main import ( "encoding/json" "errors" "fmt" "os" "path/filepath" "github.com/bitrise-io/go-utils/fileutil" "github.com/bitrise-io/go-utils/log" "github.com/bitrise-io/go-utils/pathutil" "github.com/bitrise-io/go-utils/sliceutil" "github.com/bitrise-tools/go-steputils/stepconf" "github.com/bitrise-...
// Copyright 2017 <NAME> // Use of this source code is governed by a Apache-style // license found in the LICENSE file. It also can be found at // https://github.com/pborman/pdp8/blob/master/LICENSE package os8fs import ( "fmt" "reflect" "unsafe" ) // nativeOrder is true if we can read the bytes from the image f...
package master import ( "errors" "fmt" "time" "github.com/InVisionApp/go-logger" "github.com/InVisionApp/go-master/backend" "github.com/InVisionApp/go-master/fakes/fakebackend" "github.com/InVisionApp/go-master/safe" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/relistan/go-director" ) ...
package common import ( "encoding/json" "errors" "fmt" "net" "net/http" "runtime" "time" "github.com/apcera/nats" . "github.com/cloudfoundry/gorouter/common/http" "github.com/cloudfoundry/yagnats" "github.com/pivotal-golang/lager" "github.com/pivotal-golang/localip" ) var procStat *ProcessStatus type Vc...
package generic import ( "../utils" ) type RandomMemoryBenchmark struct { *BenchmarkBaseBase } type ParallelRandomMemoryBenchmark struct { *RandomMemoryBenchmark } func newRandomMemoryBenchmarkBase(writer utils.WriterType, printToConsole bool) *BenchmarkBaseBase { var benchBase = NewBenchmarkBase(writer, printT...
package services import ( "fmt" "os" "os/exec" "path/filepath" "sync" "syscall" "time" "github.com/kpango/glg" "github.com/vetcher/easystarter/backend/util" ) type goService struct { info ServiceInfo // Общая, описательная информация о сервисе externalCmd *exec.Cmd // Внеш...
package command import ( "flag" "fmt" "os" "strings" "github.com/funkygao/gafka/ctx" "github.com/funkygao/gafka/zk" "github.com/funkygao/gocli" "github.com/go-ozzo/ozzo-dbx" "github.com/olekukonko/tablewriter" ) type WhoisAppInfo struct { AppId string `db:"AppId"` ApplicationName string `db:"A...
// Copyright 2017 <NAME> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
// Copyright 2015 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...
package astar import ( "errors" "fmt" "math" "time" ) // Config holds important settings // to perform the calculation // // GridWidth and GridHeight are required and represents // the size of the grid // // InvalidNodes can be used to add not accessible nodes like obstacles etc. // WeightedNodes can be used to a...
// See LICENSE.txt for licensing information. package main import ( "flag" "fmt" "os" "path/filepath" "regexp" "strconv" "time" ) const ( VERSION = `0.9.4` timeFmt = `2006-01-02 15:04:05` fileFmt = `2006-01-02_150405` ) var build = `UNKNOWN` // injected in Makefile var ( flagConfig string flagShort ...
// Copyright 2020 <NAME>. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writ...
package main import ( "encoding/json" "fmt" "net/http" "os" "reflect" "github.com/apex/log" bluzelle "github.com/bluzelle/blzgo" ) var ctx *bluzelle.Client const KEY_MUST_BE_A_STRING = "Key must be a string" const NEW_KEY_MUST_BE_A_STRING = "New key must be a string" const VALUE_MUST_BE_A_STRING = "Value mus...
// Copyright © 2017 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) Huawei Technologies Co., Ltd. 2020. All rights reserved. // isula-build licensed under the Mulan PSL v2. // You can use this software according to the terms and conditions of the Mulan PSL v2. // You may obtain a copy of Mulan PSL v2 at: // http://license.coscl.org.cn/MulanPSL2 // THIS SOFTWARE IS ...
// Package server implements the serving of the backend and the web UI. package server import ( "fmt" "os" "path" "strconv" "sync" "time" "github.com/facette/facette/pkg/catalog" "github.com/facette/facette/pkg/config" "github.com/facette/facette/pkg/library" "github.com/facette/facette/pkg/logger" "github...
package commands import ( "bufio" "compress/gzip" "errors" "fmt" "io" "os" gopath "path" "strings" "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/cheggaaa/pb" context "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context" cmds "github.com/ipfs/go-ipfs/commands" core "github.c...
package llb import ( _ "crypto/sha256" "sort" "github.com/gogo/protobuf/proto" "github.com/moby/buildkit/solver/pb" digest "github.com/opencontainers/go-digest" "github.com/pkg/errors" ) var errNotFound = errors.Errorf("not found") func Source(id string) *State { return &State{ metaNext: NewMeta(), sourc...
package gorush import ( "errors" "fmt" "time" "golang.org/x/net/context" firebase "firebase.google.com/go" fcm "firebase.google.com/go/messaging" "google.golang.org/api/option" "github.com/sirupsen/logrus" ) // InitFCMClient use for initialize FCM Client. func InitFCMClient(credentialsFile string) (*fcm.Cl...
// Copyright (c) 2021 PaddlePaddle Authors. 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...
// Copyright (c) 2019 Cisco and/or its affiliates. // // 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...
// A Pseudo-LRU implementation using 1-bit per entry and hit ratio performance // nearly identical to full LRU. package plru import ( "math" ) const ( blockSize = 64 blockMask = blockSize - 1 blockFull = math.MaxUint64 ) // Policy is the type Policy struct { blocks []uint64 counter uint64 } // NewPolicy retu...
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** package v1 import ( "context" "reflect" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // Returns the ACL entry for the specified entity on the specified bucke...
// Copyright (c) 2018, <NAME> // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, this // list of conditions and ...
package cost import ( "fmt" "log" outputflag "github.com/openshift/osdctl/cmd/getoutput" awsprovider "github.com/openshift/osdctl/pkg/provider/aws" "k8s.io/cli-runtime/pkg/genericclioptions" cmdutil "k8s.io/kubectl/pkg/cmd/util" "github.com/aws/aws-sdk-go/service/organizations" "github.com/spf13/cobra" ) //...
package ctxerr import ( "bufio" "bytes" "fmt" "io/ioutil" "strconv" "strings" "unicode/utf8" "github.com/fatih/color" ) var ( // DefaultGutter separates line numbers from content. DefaultGutter = " | " // DefaultPointer is the rune that points up at a region. DefaultPointer = '^' // DefaultContext is th...
package prox5 import ( "bytes" "crypto/tls" "errors" "fmt" "io" "net" "net/http" "strings" // "net/url" "sync/atomic" "time" "golang.org/x/net/proxy" "h12.io/socks" ) func (s *Swamp) prepHTTP() (*http.Client, *http.Transport, *http.Request, error) { req, err := http.NewRequest("GET", s.GetRandomEndpoin...
package authenticate import ( "context" "fmt" "net" "time" "github.com/puppetlabs/relay-core/pkg/model" "github.com/puppetlabs/relay-core/pkg/util/retry" tekton "github.com/tektoncd/pipeline/pkg/client/clientset/versioned" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apima...
package server // Note: Do not run the server tests in parallel. import ( "context" "crypto/tls" "fmt" "io/ioutil" "net" "net/http" "strings" "testing" "time" "github.com/OpenBankingUK/conformance-suite/pkg/client" "github.com/OpenBankingUK/conformance-suite/pkg/test" "github.com/OpenBankingUK/conforman...
package randomizer import ( "fmt" "gopkg.in/yaml.v2" ) // an item slot (chest, gift, etc). it references room data and treasure data. type itemSlot struct { treasure *treasure hasAddr bool addr *address // address of item slot data (only if hasAddr is true) label ...
// Copyright 2019 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 ocagent_test import ( "bytes" "context" "encoding/json" "fmt" "io/ioutil" "net/http" "sync" "testing" "time" "golang.org/x/tools/internal/te...
package main import ( "context" "flag" "fmt" "os" "sort" "time" "google.golang.org/api/appengine/v1" ) var ( dryRun = flag.Bool("dry_run", true, "When true, just print intended modifications and quit") keepDuration = flag.Duration("keep_duration", 24*time.Hour, "Versions older than this will be delete...
/* Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use ...
// Copyright 2019 Istio 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 i...
// Copyright (C) 2019 <NAME>, Inc. // See LICENSE for copying information. package process import ( "flag" "fmt" "net/url" "os" "sort" "strings" "github.com/zeebo/errs" "go.uber.org/zap" "go.uber.org/zap/buffer" "go.uber.org/zap/zapcore" "storj.io/private/cfgstruct" ) var ( // Error is a process error ...
// Package demuxer contains the tools for sending packets to the right goroutine to save them to disk. package demuxer import ( "context" "runtime" "runtime/debug" "time" "github.com/m-lab/go/bytecount" "github.com/google/gopacket" "github.com/m-lab/go/anonymize" "github.com/m-lab/packet-headers/metrics" "g...
package main import ( "bytes" "crypto" "crypto/ecdsa" "crypto/elliptic" "crypto/rand" "crypto/sha256" "crypto/tls" "crypto/x509" "crypto/x509/pkix" "encoding/base64" "encoding/pem" "fmt" "math/big" mrand "math/rand" "net" "net/http" "time" "github.com/caddyserver/certmagic" "github.com/go-chi/chi" ...
package bagman import ( "fmt" "encoding/json" "strings" "time" ) /* GenericFile contains information about a file that makes up part (or all) of an IntellectualObject. IntellectualObject is the object to which the file belongs. Format is typically a mime-type, such as "application/xml", that describes the file...
package autosuggest // 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 // //...
package api import ( "github.com/bmizerany/pat" "github.com/ngerakines/preview/common" "github.com/ngerakines/preview/util" "github.com/rcrowley/go-metrics" "log" "net/http" "path/filepath" "strings" ) type staticBlueprint struct { base string placeholderManager common.PlaceholderManager } ty...
// Copyright 2021 The Chromium OS 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 wifi import ( "context" "time" "chromiumos/tast/common/shillconst" "chromiumos/tast/errors" "chromiumos/tast/remote/bundles/cros/wifi/wi...
package cmd import ( "fmt" "gitea-cli/common" "io/ioutil" "os" "gopkg.in/yaml.v2" ) type CommandHandler func() error type Command struct { Desc string Handler CommandHandler Opts []CmdOpt } type CmdCtx struct { CommandRoot Branch Config *common.Config } func (ctx *CmdCtx) ValidateConfig(withC...
// // Copyright 2019 Insolar Technologies GmbH // // 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...
package command import ( "context" "fmt" "github.com/Azure/go-autorest/autorest/to" "github.com/naveego/bosun/pkg/core" "github.com/naveego/bosun/pkg/util" "github.com/pkg/errors" "io" "os" "os/exec" "strings" ) type ShellExe struct { // Exe is the executable to invoke. Exe *string // Args is the argumen...
// Copyright 2022 MongoDB 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...
// Code generated by protoc-gen-go. // source: peer/fabric_service.proto // DO NOT EDIT! package peer import proto "github.com/golang/protobuf/proto" import fmt "fmt" import math "math" import ( context "golang.org/x/net/context" grpc "google.golang.org/grpc" ) // Reference imports to suppress errors if they are ...
package migration import ( "fmt" "reflect" "strconv" "strings" ) const createTableRaw = `CREATE {{.temporary}} TABLE {{.tableName}}( {{.fields}} ) {{.engine}} {{.charset}};` var ( // 需要带长度的字段类型 typeLenMap = map[string]string{ "char":"char", "varchar":"varchar", "string":"varchar", } // 需要带精度的类型 typePr...
package test_impl import ( "bufio" "strings" "testing" "github.com/oom-ai/oomstore/internal/database/offline" "github.com/oom-ai/oomstore/pkg/oomstore/types" "github.com/stretchr/testify/assert" ) func TestExport(t *testing.T, prepareStore PrepareStoreFn, destroyStore DestroyStoreFn) { t.Cleanup(destroyStore)...
package gotodo import ( "crypto/sha256" "encoding/hex" "encoding/json" "html/template" "io" "net/http" "os" "path/filepath" "strconv" "github.com/gorilla/mux" "golang.org/x/net/context" "google.golang.org/appengine/log" "google.golang.org/appengine/user" ) // Router ... func Router(helper Helper) *mux.R...
package main import ( "errors" "fmt" "net/url" "os" "path/filepath" "strconv" "strings" "time" "github.com/go-telegram-bot-api/telegram-bot-api" "github.com/kballard/go-shellquote" "github.com/lucsky/cuid" "github.com/skip2/go-qrcode" "github.com/tidwall/gjson" "gopkg.in/jmcvetta/napping.v3" ) func mak...
/* 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 ...
package summarize import ( "io" "math" "strings" ) type Summarize struct { Title string Text string Language string StopWordsProvider StopWordsProvider TextSplitter TextSplitter EndSentenceRunes []rune QuoteTuples [][]rune IdealWordCount int } func New(titl...
// 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 crypto import ( "crypto/ecdsa" "crypto/elliptic" "crypto/hmac" "crypto/md5" "crypto/rand" "crypto/sha512" "encoding/hex" "errors" "fmt" "math/big" "golang.org/x/crypto/sha3" ) const ( // SeedBytes seed bytes SeedBytes = 64 // 512 bits // number of bits in a big.Word wordBits = 32 << (uint64(^b...
package command import ( "fmt" "github.com/hpehl/whatunga/model" "github.com/hpehl/whatunga/path" "github.com/oleiade/reflections" "reflect" "strconv" "strings" ) var cmdOrder []string type registry map[string]Command func (r registry) Add(cmd Command) { r[cmd.Name] = cmd cmdOrder = append(cmdOrder, cmd.Na...
package core import ( "fmt" "github.com/docker/infrakit/pkg/discovery" "github.com/docker/infrakit/pkg/fsm" logutil "github.com/docker/infrakit/pkg/log" "github.com/docker/infrakit/pkg/template" "github.com/docker/infrakit/pkg/types" ) var log = logutil.New("module", "core") // ProcessDefinition has the Spec ...
package identity import ( "context" "errors" "fmt" "github.com/0xPolygon/polygon-edge/network/event" "github.com/hashicorp/go-hclog" "sync" "github.com/0xPolygon/polygon-edge/network/proto" "github.com/libp2p/go-libp2p-core/network" "github.com/libp2p/go-libp2p-core/peer" ) const PeerID = "peerID" var ( E...
package main import ( "fmt" "io" "time" ) type Player struct { session *Session username string password string /* TODO: A lot of player data goes here. */ } /** * Detect if Player connection has been reset by peer. * * Side-effect: If the connection isn't closed, set the * default read timeout to 1 minu...
/* Copyright 2018 The Crossplane Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
package main import ( "encoding/json" "fmt" "os" "sort" "strconv" "strings" "time" ) type StarTs int64 func (v *StarTs) UnmarshalJSON(data []byte) error { val := string(data) res, err := strconv.ParseInt(strings.Trim(val, `"'`), 10, 64) if err != nil { return fmt.Errorf("Unable to decode %s to int64: %s...
// Code generated by protoc-gen-go. // source: kittens.proto // DO NOT EDIT! /* Package bmigo_grpc is a generated protocol buffer package. It is generated from these files: kittens.proto It has these top-level messages: Request Response */ package bmigo_grpc import proto "github.com/golang/protobuf/proto" import...
package main import ( "encoding/json" "fmt" "log" "os" "path/filepath" "strings" parser "github.com/autamus/binoc/repo" "github.com/autamus/buildconfig/config" "github.com/autamus/buildconfig/engine" "github.com/autamus/buildconfig/repo" ) type result struct { Name string `json:"name"` Arch str...
// Package oauth2test implements reusable integration tests to run against any // OAuth2 authentication server. package oauth2test import ( "net/http" "testing" ) // Spec declares the needed info for testing an OAuth2 authentication server. type Spec struct { // The server handler. Handler http.Handler // The t...
package middleware import ( "context" "encoding/json" "fmt" "go-server/models" "log" "net/http" "os" "github.com/gorilla/mux" // "github.com/clerkinc/clerk-sdk-go/clerk" "github.com/joho/godotenv" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/bson/primitive" "go.mongodb.org/mongo-driver...
// Copyright © 2015 <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...
// Copyright © 2019 <NAME> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in wri...