text
stringlengths
3.08k
10.4k
/* Copyright (c) 2019 Snowflake Inc. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable...
// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
/* Copyright 2021 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
package midlayer import ( "fmt" "sort" "sync" "time" "github.com/digitalrebar/provision/backend" "github.com/digitalrebar/provision/models" ) type AvailableAction struct { models.AvailableAction Plugin *RunningPlugin ma *Actions lock sync.Mutex inflight int unloading bool } /* * Actions are...
package upcloud import ( "context" "fmt" "time" "github.com/UpCloudLtd/upcloud-go-api/upcloud" "github.com/UpCloudLtd/upcloud-go-api/v4/upcloud/client" "github.com/UpCloudLtd/upcloud-go-api/v4/upcloud/request" "github.com/UpCloudLtd/upcloud-go-api/v4/upcloud/service" "github.com/hashicorp/vault/sdk/framework"...
// Copyright 2020 GM Cruise LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to i...
package main import ( "encoding/json" "errors" "flag" "fmt" "io" "net/http" "os" "path/filepath" "strconv" "strings" "sync" "time" "github.com/op/go-logging" ) var log = logging.MustGetLogger("ooni-downloader") var outputDirectory string var getParameters map[string]string const URL = "https://measurem...
package node import ( "bytes" "fmt" "log" "text/template" "time" natsgo "github.com/nats-io/nats.go" "github.com/simpleiot/simpleiot/data" "github.com/simpleiot/simpleiot/db/genji" "github.com/simpleiot/simpleiot/msg" ) // Manager is responsible for maintaining node state, running rules, etc type Manager s...
package mr import ( "fmt" "log" "net" "net/http" "net/rpc" "os" "sync" "time" ) type reduceTask struct { files []string reduceNum int } const maxWaitTime = 10 * time.Second type Coordinator struct { // Your definitions here. sync.Mutex id int nReduce int activeMapTasks ...
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
package main import ( "bufio" "bytes" "errors" "fmt" "os" "runtime" "strconv" "strings" "github.com/ebfe/scard" "github.com/taglme/string2keyboard" ) type Service interface { Start() Flags() Flags } func NewService(flags Flags) Service { return &service{flags} } type Flags struct { CapsLock bool Rev...
package main import ( "encoding/json" "flag" "fmt" "html/template" "log" "net/http" "os" "strconv" ) // Data 구조체는 이번 회차의 결과를 저장합니다. type Data struct { Numbers []string `json:"Numbers"` // Numbers 필드는 당첨 번호를 저장합니다. NumWinners int `json:"NumWinners"` // NumWinners 필드는 당첨자가 몇명인지를 저장합니다. RemainWinners int ...
package scenariolib import ( "errors" "math/rand" "time" ) // DEFAULTTIMEBETWEENVISITS The time for the bot to wait between visits, between 0 and X Seconds const DEFAULTTIMEBETWEENVISITS int = 300 // DEFAULT_STANDARD_DEVIATION_BETWEEN_VISITS The standard deviation when updating time between visits const DEFAULT_S...
package router import ( "context" "encoding/json" "fmt" "io" "net/http" "net/url" "strings" logger "github.com/Nivl/go-logger" reporter "github.com/Nivl/go-reporter" "github.com/Nivl/go-rest-tools/request" "github.com/Nivl/go-rest-tools/security/auth" "github.com/Nivl/go-rest-tools/types/apperror" "githu...
// Copyright 2022 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
/// Author: <NAME>, <EMAIL> (c) 2015 package bbhw import "sync" // Uses the memory mapped IO to directly interface with AM335x registers. // Same as MMappedGPIO, but part of a collection of GPIOs you can set all at once using database-like transactions. type MMappedGPIOInCollection struct { MMappedGPIO collection...
/* Copyright 2021 VMware, Inc. SPDX-License-Identifier: Apache-2.0 */ package vcdclient import ( "context" "crypto/tls" "fmt" "k8s.io/klog" "net/http" "sync" swaggerClient "github.com/vmware/cloud-provider-for-cloud-director/pkg/vcdswaggerclient" "github.com/vmware/go-vcloud-director/v2/govcd" ) var (...
// Copyright (c) 2018 Northwestern Mutual. // // 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, p...
// Copyright (c) 2020, The OTNS Authors. // 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 conditi...
// Copyright (c) 2017-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...
// SPDX-License-Identifier: Apache-2.0 // Copyright © 2021 Wrangle Ltd package wrgl import ( "fmt" "io" "sort" "time" "github.com/schollz/progressbar/v3" "github.com/spf13/cobra" "github.com/wrgl/wrgl/cmd/wrgl/utils" "github.com/wrgl/wrgl/pkg/objects" "github.com/wrgl/wrgl/pkg/ref" ) func newPruneCmd() *co...
package main import ( "encoding/json" "fmt" "github.com/tophubs/TopList/Common" "log" "net/http" "regexp" ) func GetTypeInfo(w http.ResponseWriter, r *http.Request) { err := r.ParseForm() if err != nil { log.Fatal("系统错误" + err.Error()) } id := r.Form.Get("id") re := regexp.MustCompile("[0-9]+") id = re....
package routes import ( "github.com/gin-contrib/sessions" "github.com/gin-gonic/gin" "shenzhen/controllers/api" "shenzhen/controllers/publicApi" "shenzhen/kits/ginResp" ) func AddPublicApi(e *gin.Engine) { group := e.Group("/public-api") group.POST("/journals/:journalSID", publicApi.JournalViewCtl) } func add...
package main import ( "database/sql" ) const ( Madsportslab = "madsportslab" ShortForm = "2006-01-02 15:04:05 -0700" ) // Database table structures type User struct { ID string `json:"id"` Name sql.NullString `json:"name"` Email string `json:"email"` Mobile ...
package gcal import ( "fmt" "regexp" "strings" "time" "github.com/senorprogrammer/wtf/wtf" ) func (widget *Widget) sortedEvents() ([]*CalEvent, []*CalEvent) { allDayEvents := []*CalEvent{} timedEvents := []*CalEvent{} for _, calEvent := range widget.calEvents { if calEvent.AllDay() { allDayEvents = app...
package params import ( "math/big" "time" "github.com/elastos/Elastos.ELA.SideChain/config" "github.com/elastos/Elastos.ELA/common" ) // These variables are the chain proof-of-work limit parameters for each default // network. var ( // bigOne is 1 represented as a big.Int. It is defined here to avoid // the ...
/** * 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 agre...
package store import ( "sync" "github.com/launchdarkly/ld-relay/v6/internal/core/streams" "gopkg.in/launchdarkly/go-sdk-common.v2/ldlog" "gopkg.in/launchdarkly/go-server-sdk.v5/interfaces" "gopkg.in/launchdarkly/go-server-sdk.v5/interfaces/ldstoretypes" ) // SSERelayDataStoreAdapter is used to create the data ...
package scraper import ( "fmt" "regexp" "strconv" "strings" "github.com/PuerkitoBio/goquery" "github.com/eoussama/anusic-api/src/shared/enums" "github.com/eoussama/anusic-api/src/shared/models" "github.com/eoussama/anusic-api/src/shared/utils" ) // Themes scraps related theme songs func Themes(malID uint16, ...
package envelope import ( "bufio" "bytes" "errors" "fmt" "io" "log" "net/mail" "strconv" "strings" "time" enmime "github.com/jhillyerd/go.enmime" sha256 "github.com/minio/sha256-simd" ) // Metadata holds key details about a message from the body of a journal envelope type Metadata struct { Sender, OnBeh...
/* * // Copyright Aeraki 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 app...
// Copyright 2018-2019 "<NAME>" <<EMAIL>>. // Use of this source code is governed the MIT license. // license that can be found in the LICENSE file. package traceroute import ( "fmt" "net" "regexp" "testing" ) type IPTest struct { ip string result bool } type IPParseTest struct { input string ip ...
package frechet import ( "github.com/artpar/frechet/deque" "math" // "fmt" ) type FrechetDistance interface { ComputeDistance(p, q [][]float64) float64 initializeColumnUpperEnvelope(column int, P [][]float64) UpperEnvelope initializeRowUpperEnvelope(row int, Q [][]float64) UpperEnvelope distance(p, q []float64)...
package hit import ( "fmt" "io" "net/http" "golang.org/x/xerrors" ) //go:generate go run generate_template_framework.go // Callback will be used for Custom() functions type Callback func(hit Hit) type Hit interface { // Request returns the current request Request() *HTTPRequest // SetRequest sets the reque...
// Copyright 2016 <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 writi...
package main import ( "fmt" "encoding/json" "sigs.k8s.io/kustomize/api/hasher" "sigs.k8s.io/kustomize/api/resmap" "sigs.k8s.io/kustomize/api/types" apiv1 "sigs.k8s.io/kustomize/pseudo/k8s/api/core/v1" metav1 "sigs.k8s.io/kustomize/pseudo/k8s/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/kustomize/pseudo/k8s/ap...
package main import ( "io/ioutil" "bytes" "encoding/json" "os" "flag" "fmt" "io" "log" "net/http" "net/http/cookiejar" "net/url" "strings" "path" "code.google.com/p/go.net/html" "github.com/steveyen/gkvlite" ) func Split2(str, sep string) (string, string) { s := strings.Split(str, sep)...
package target import ( "bytes" "fmt" "io" "os" "strings" yaml "gopkg.in/yaml.v2" "github.com/upsight/ron/color" "github.com/upsight/ron/execute" ) const ( // ExecSentinel is the first character looked for in envs to // signify that the value should be executed in the shell // and the output assigned to ...
package errorsx import ( "context" "crypto/tls" "errors" "net" "github.com/lucas-clemente/quic-go" ) // QUICContextDialer is a dialer for QUIC using Context. type QUICContextDialer interface { // DialContext establishes a new QUIC session using the given // network and address. The tlsConfig and the quicConfi...
// Licensed to SolID under one or more contributor // license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright // ownership. SolID licenses this file to you under // the Apache License, Version 2.0 (the "License"); you may // not use this file except in compli...
package testing import ( "context" "encoding/hex" "errors" "path" "testing" fssz "github.com/ferranbt/fastssz" ethpb "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1" "github.com/prysmaticlabs/go-ssz" "github.com/prysmaticlabs/prysm/beacon-chain/state" pb "github.com/prysmaticlabs/prysm/proto/beacon/p2p/...
package lmsensors import ( "fmt" "io/ioutil" "os" "path/filepath" "strings" ) // A filesystem is an interface to a filesystem, used for testing. type filesystem interface { ReadFile(filename string) (string, error) Readlink(name string) (string, error) Stat(name string) (os.FileInfo, error) Walk(root string,...
// +build darwin package poll import ( "fmt" "syscall" "github.com/cofepy/gn/common" ) var log = common.GetLogger() type Poll struct { fd int changes []syscall.Kevent_t //事件列表 } func NewPoll(port int) (*Poll, error) { poll := new(Poll) //获取kqueue队列操作具柄,并绑定到Poll kq, err := syscall.Kqueue() if err ...
package uvr1611 import ( "errors" "fmt" "github.com/brutella/gouvr/uvr" ) const PacketByteCount = 64 // Packet represents an UVR1611 packet. type Packet struct { // Bytes DeviceType uvr.DeviceType // 1 DeviceTypeInverted uvr.DeviceType // 2 Unkown uvr.Byte // 3 T...
package veneur import ( "crypto/tls" "fmt" "net" "os" "sync" "github.com/sirupsen/logrus" flock "github.com/theckman/go-flock" ) // StartStatsd spawns a goroutine that listens for metrics in statsd // format on the address a. As this is a setup routine, if any error // occurs, it panics. func StartStatsd(s *S...
/* Package stats implements an online computation of summary statistics. The primary idea of this package is that samples are coming in at real time, and online computations of the shape of the distribution: the mean, variance, and range need to be computed on-demand. Rather than keeping an array of values, online alg...
// Copyright 2019 The go-ethereum Authors // This file is part of the go-ethereum library. // // The go-ethereum library is free software: you can redistribute it and/or modify // it under the terms of the GNU Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License...
package loadbalancer // LoadBalancer - implements loadbalancer package logic. type LoadBalancer struct { // Avi - implements Avi logic. Avi *Avi // Netscaler - implements Netscaler logic. Netscaler *Netscaler } // Data - resource configuration. type Data struct { // ClusterUUID - unique id of cluster...
package main import ( "flag" "log" "net" "sync" "time" "encoding/json" "github.com/GoogleCloudPlatform/kubernetes/pkg/api" "github.com/GoogleCloudPlatform/kubernetes/pkg/client" pconfig "github.com/GoogleCloudPlatform/kubernetes/pkg/proxy/config" "github.com/GoogleCloudPlatform/kubernetes/pkg/util" "githu...
package main import ( "bufio" "encoding/json" "errors" "flag" "fmt" "log" "os" "path" "strings" "sync" "github.com/drsigned/corsmisc/pkg/corsmisc" "github.com/drsigned/gos" "github.com/logrusorgru/aurora/v3" ) type options struct { concurrency int method string noColor bool silent bool...
package main import ( "context" "encoding/json" "regexp" "github.com/qingstor/log" "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/qingstor/qsctl/v2/constants" "github.com/qingstor/qsctl/v2/internal/pkg/ilog" "github.com/qingstor/qsctl/v2/pkg/i18n" "github.com/qingstor/qsctl/v2/utils" ) //go...
// Copyright 2018-2021 (c) Cognizant Digital Business, Evolutionary AI. All rights reserved. Issued under the Apache 2.0 License. package resources // This file contains the implementation of a resource tracker for a local host on // which CUDA, storage, and main motherboard resources can be found and tracked on // b...
// Copyright (c) 2019 IoTeX Foundation // This is an alpha (internal) release and is not suitable for production. This source code is provided 'as is' and no // warranties are given as to title or non-infringement, merchantability or fitness for purpose and, to the extent // permitted by law, all liability for your use...
package mouse 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 ( mooseBirthday = nook.Birthday{ Day: 13, Month...
/* Copyright 2015 The Kubernetes 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 applicable law or ag...
// Code generated by go-swagger; DO NOT EDIT. package provisioning // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "net/http" "time" "golang.org/x/net/context" "github.com/go-openapi/errors" "github.com/go-openapi/ru...
// 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 wri...
// Copyright (c) 2020, devgo.club // All rights reserved. package crypto import ( "crypto/rand" "io" "math/big" ) // DHPulbic : public value type DHPulbic struct { p *big.Int // public base g *big.Int // public modulus } // NewDHPublic : create custom DHPublic // WARNING: Do not use it if you do not know what ...
// Copyright (C) 2019 Cisco Systems 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 agr...
// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
package service import ( "context" "go-common/app/service/live/wallet/model" "go-common/library/database/sql" "go-common/library/ecode" "go-common/library/log" ) type ModifyHandler struct { service *WalletService } func (handler *ModifyHandler) NeedCheckUid() bool { return true } func (handler *ModifyHandler)...
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package qldb 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" ) type GetRevisionInput struct { _ struct{} `type:"structure"` // The block l...
package interval // Code generated by generate/generate.go. DO NOT EDIT import ( "fmt" "strconv" ) // WrapFloat32 normalizes the value that "wraps around" within the [min,max) range. // WrapFloat32 always assumes that `min` is [inclusive, and `max` is exclusive). func WrapFloat32(min, max, value float32) float32 {...
package transfer import ( "fmt" "sync" "time" "github.com/git-lfs/git-lfs/errors" "github.com/rubyist/tracerx" ) const ( // objectExpirationToTransfer is the duration we expect to have passed // from the time that the object's expires_at property is checked to // when the transfer is executed. objectExpirat...
package proxy import ( "context" "encoding/json" "errors" "fmt" "io" "net/http" "time" "github.com/cailloumajor/opcua-proxy/internal/centrifugo" "github.com/cailloumajor/opcua-proxy/internal/opcua" "github.com/centrifugal/gocent/v3" "github.com/go-kit/log" "github.com/go-kit/log/level" gopcua "github.com...
package secrets import ( "encoding/base64" "encoding/json" "fmt" "os" "github.com/hootsuite/vault-ctrl-tool/v2/briefcase" "github.com/hootsuite/vault-ctrl-tool/v2/config" "github.com/hootsuite/vault-ctrl-tool/v2/util" "github.com/rs/zerolog" zlog "github.com/rs/zerolog/log" ) func WriteComposite(composite c...
// Copyright 2020 by Blank-Xu. 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 applicab...
// Copyright 2018 Sean.ZH package net import ( "fmt" "math/big" "sort" "strconv" "strings" "github.com/dilfish/tools/err" "github.com/dilfish/tools/io" ) // StateCount hold country name and ipv6 address count type StateCount struct { Name string Count uint64 } // StateCountSlice impl sort.Sort type State...
package commands import ( "crypto/aes" "crypto/cipher" "crypto/rand" "encoding/json" "errors" "fmt" "io" "io/ioutil" "os" "os/exec" "os/user" "path" "path/filepath" "runtime" "github.com/AlecAivazis/survey" logger "github.com/alecthomas/log4go" "github.com/boxproject/agent/config" ) const ( Service...
package middleware import ( "encoding/json" "errors" "github.com/tal-tech/go-zero/rest/httpx" "go-zero-template/cmd/global" "go-zero-template/cmd/model" "go.uber.org/zap" "net/http" "strconv" "time" "go-zero-template/cmd/internal/types" "github.com/dgrijalva/jwt-go" ) func JWTAuth(next http.HandlerFunc) ...
// Copyright 2009 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. // Internet protocol family sockets package net import "time" var supportsIPv6, supportsIPv4map bool func init() { sysInit() supportsIPv6, supportsIPv4ma...
package uaa import ( "bytes" "crypto/tls" "encoding/gob" "encoding/json" "errors" "io/ioutil" "log" "net/http" "net/url" "strings" "time" "github.com/cfmobile/oauth2-route-service/oauth" "github.com/gorilla/sessions" ) const ( UAA_REDIRECT_PATH = "UAA_REDIRECT_PATH" UAA_CLIENT_ID = "UAA_CLIENT_ID...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: envoy/config/filter/listener/original_dst/v2/original_dst.proto package envoy_config_filter_listener_original_dst_v2 import ( fmt "fmt" _ "github.com/cncf/udpa/go/udpa/annotations" proto "github.com/golang/protobuf/proto" math "math" ) // Reference impo...
package internal import ( "bytes" "fmt" "go/ast" "io" "log" "strings" "golang.org/x/tools/imports" ) type Generator struct { buf bytes.Buffer PackageName string } func NewGenerator() *Generator { return &Generator{} } func (g *Generator) Printf(format string, args ...interface{}) { fmt.Fprintf(&...
// // Copyright 2019-2020 Nestybox, 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 // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ag...
// Copyright 2015 <NAME> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use 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...
// Copyright 2015-2017, Cyrill @ <EMAIL> and the CoreStore contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless r...
package ops import ( "context" "encoding/json" "expinc/sunagent/command" "expinc/sunagent/common" "expinc/sunagent/log" "fmt" "io/fs" "io/ioutil" "os" "os/exec" "path/filepath" "strings" "time" "github.com/google/uuid" ) type CombinedScriptResult struct { Output string `json:"output"` ExitStatus ...
package main import ( "fmt" "os" "testing" "time" "strconv" _"github.com/paypal/hera/client/gosqldriver/tcp" "github.com/paypal/hera/tests/functionaltest/testutil" "github.com/paypal/hera/utility/logger" ) /* The test will start Mysql server docker. Hera server connects to this Mysql DB docker No setup...
package main import ( "fmt" "io" "log" "os" "os/signal" "time" "github.com/rapidloop/sop/api" "github.com/rapidloop/sop/input" "github.com/rapidloop/sop/model" "github.com/rapidloop/sop/output" "github.com/rapidloop/sop/sopdb" "github.com/rapidloop/sop/sopdb/rdb" ) var ( VERSION = "1.0-beta.1" // overri...
package powerdns import ( "context" "encoding/json" "net/http" "reflect" "testing" "github.com/google/go-cmp/cmp" ) var expectedZoneStruct = Zone{ Account: "", DNSSec: false, ID: "example.com.", Kind: "Native", LastCheck: 0, Masters: []string{}, Name: ...
/* * Copyright 2018-2020 the original author or 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by a...
// Copyright 2018 <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 ...
package vpc import ( "context" "fmt" "log" "time" "github.com/aiven/aiven-go-client" "github.com/aiven/terraform-provider-aiven/internal/schemautil" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v...
package main import ( "bufio" "fmt" "log" "os" "strconv" "strings" "text/tabwriter" "github.com/codegangsta/cli" "github.com/fatih/color" ) const VERSION = "1.0.0" var ( blink = color.New(color.BlinkSlow).SprintfFunc() bold = color.New(color.Bold).SprintfFunc() magenta = col...
package job import ( "fmt" "reflect" latticev1 "github.com/mlab-lattice/lattice/pkg/backend/kubernetes/customresource/apis/lattice/v1" kubeutil "github.com/mlab-lattice/lattice/pkg/backend/kubernetes/util/kubernetes" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/ap...
package graviton import "fmt" import "bytes" import "encoding/binary" const ( member byte = iota + 1 collision deadend ) func NewProof() *Proof { return &Proof{ trace: make([][]byte, 0, HASHSIZE*32), } } //This structure is used to prove existence/non-existence of a key type Proof struct { version int64 pt...
package providers import ( "bytes" "net/http" "net/url" "strings" api "github.com/bhaveshkumarraj/oauth2_proxy/api" ) type IAM struct { Host string AccountId string ApiKey string AccessToken string RefreshToken string TokenExpiration int RootUrl string } type IAM...
// Copyright 2019 <NAME> // Licensed under the Apache License, Version 2.0 (the "License") package ice import ( "sync" "sync/atomic" ) //BufElement - kind of buffer page type bufElement struct { locked int32 len int buffer []byte next *bufElement prev *bufElement mux sync.Mutex } // BufferQueue - ...
// Hello! // // This is the source code for @TeknumCaptchaBot where you can find // the ugly code behind @TeknumCaptchaBot's captcha feature and more. // // If you are learning Go for the first time and about to browse this // repository as one of your first steps, you might want to read the // other repository on the ...
package slice_test import ( "strconv" "strings" "testing" "github.com/jh9aea/slice" "github.com/stretchr/testify/require" ) func TestContains(t *testing.T) { list := []string{"foo", "bar", "zee"} require.True(t, slice.Contains(list, "foo")) require.False(t, slice.Contains(list, "toodles")) } func TestSubtr...
package platform import ( "context" "database/sql" "fmt" "strings" "github.com/volatiletech/sqlboiler/v4/boil" "github.com/volatiletech/sqlboiler/v4/queries" "github.com/volatiletech/sqlboiler/v4/queries/qm" "google.golang.org/genproto/googleapis/rpc/errdetails" "github.com/jwilner/rv/internal/models" "git...
package idl import ( "fmt" "io" "github.com/lugu/qiloop/meta/signature" "github.com/lugu/qiloop/type/object" ) // generateMethod writes the method declaration. Does not use // methodName, because is the Go method name generated to avoid // conflicts. QiMessage do not have such constraint and thus we don't // use...
package sdc import ( "errors" "io/ioutil" "os/exec" "regexp" "strconv" "strings" "confd/backends/etcd" "confd/backends/etcdv3" "github.com/BurntSushi/toml" ) // The StoreClient interface is implemented by objects that can retrieve // key/value pairs from a backend store. type StoreClient interface { GetVal...
package bdb import ( "encoding/binary" "fmt" "io" "github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb/opt" "github.com/syndtr/goleveldb/leveldb/util" "go.etcd.io/etcd/raft" pb "go.etcd.io/etcd/raft/raftpb" ) type LdbWALStorage = *ldbWALStorage type ldbWALStorage struct { db *leveldb.D...
package sqlingo import ( "errors" "testing" ) func TestExpression(t *testing.T) { assertValue(t, nil, "NULL") assertValue(t, false, "0") assertValue(t, true, "1") assertValue(t, int8(11), "11") assertValue(t, int16(11111), "11111") assertValue(t, int32(1111111111), "1111111111") assertValue(t, int(11111111...
package repository import ( "context" "database/sql" "fmt" "github.com/CzarSimon/httputil/dbutil" "github.com/CzarSimon/tactics-trainer/puzzle-server/internal/models" "github.com/opentracing/opentracing-go" ) // PuzzleRepository interface for storing and querying for stored puzzles. type ProblemSetRepository i...
package pkg import ( "bytes" "encoding/json" "fmt" "os" "reflect" "regexp" "strconv" "text/template" "time" "github.com/Masterminds/sprig/v3" "github.com/goccy/go-yaml" "github.com/pkg/errors" "github.com/spf13/cast" ) func GetTPLFuncsMap() template.FuncMap { tplFuncs := make(template.FuncMap) // Add...
// 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. // +build ignore // +godefs map struct_in_addr [4]byte /* in_addr */ package ipv4 /* #include <time.h> #include <linux/errqueue.h> #include <l...
// 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...