text stringlengths 3.08k 10.4k |
|---|
// 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... |
package uploader
import (
"crypto/md5"
"fmt"
"io"
"net/url"
"sync/atomic"
"os"
"strings"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/s3/s3iface"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
"github.com/aws/aws-sdk-go/service/s3/s3manage... |
package server
import (
"cirello.io/goherokuname"
"errors"
"github.com/globalsign/mgo"
"github.com/globalsign/mgo/bson"
fb "github.com/huandu/facebook"
"spaceship/model"
)
func AuthenticateFingerprint(fingerprint string, conn *mgo.Session) (*model.User, error) {
if fingerprint == "" {
return nil, errors.New... |
package main
import (
"runtime"
"time"
"io"
"strings"
"fmt"
"flag"
"crypto/md5"
"encoding/hex"
)
const tickFrequency = 1 * 1000 * 1000
type UpdateType uint
const (
TICK UpdateType = iota
MATCH
DONE
)
type WorkerState struct {
Log chan StatusUpdate
Start *string
TicksRequested uint64
Ti... |
package dohserver
import (
"context"
"encoding/json"
"fmt"
"github.com/m13253/dns-over-https/json-dns"
"github.com/miekg/dns"
"golang.org/x/net/idna"
"log"
"net"
"net/http"
"strconv"
"strings"
"time"
)
func (doh *DohServer) parseRequestGoogle(ctx context.Context, w http.ResponseWriter, r *http.Request) *D... |
package internal_test
import (
"bytes"
"image"
_ "image/png"
"os"
"strings"
"testing"
"github.com/rustyoz/svg"
"github.com/spf13/cobra"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/lonnblad/gopuml/cmd/gopuml/internal"
"github.com/lonnblad/gopuml/example"
)
const... |
// 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... |
/*
Copyright 2018 Turbine Labs, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... |
package main
import (
"fmt"
"github.com/containernetworking/cni/pkg/types"
"github.com/containernetworking/plugins/pkg/ip"
"log"
"net"
)
type Range struct {
RangeStart net.IP
RangeEnd net.IP
Subnet types.IPNet
Gateway net.IP
ip []byte
}
// 给定一个IP地址的范围
func (r *Range) Canonicalize() error {... |
/*
Copyright 2021 <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 writing, software
distrib... |
// Copyright 2020 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, ... |
package worker
import (
"fmt"
"github.com/pkg/errors"
"github.com/stitchfix/flotilla-os/queue"
"gopkg.in/tomb.v2"
"time"
"github.com/stitchfix/flotilla-os/config"
"github.com/stitchfix/flotilla-os/execution/engine"
flotillaLog "github.com/stitchfix/flotilla-os/log"
"github.com/stitchfix/flotilla-os/state"
)
... |
package scanner
import "io"
func NewScanner(r io.Reader) *scanner {
return &scanner{r: r}
}
type scanner struct {
r io.Reader
buf []byte // buffer for content hunks.
buf2 []byte // buffer for potential section header.
one [1]byte
foundSection bool // if true, we've encoun... |
package main
import (
. "../utils"
"fmt"
"reflect"
"strconv"
"strings"
)
type Progline struct {
cmd string
operands []int
}
func main() {
DEBUG = false
infile := ReadFile("input")
registers := make([]int, 6)
addi := func(a, b, c int) {
registers[c] = registers[a] + b
}
addr := func(a, b, c int... |
package command
import (
"crypto/sha1"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"time"
"github.com/mackerelio/mackerel-agent/agent"
"github.com/mackerelio/mackerel-agent/config"
"github.com/mackerelio/mackerel-agent/logging"
"github.com/mackerelio/mackerel-agent/mackerel"
"github.com/mackerelio/mackerel-agen... |
package staking
import (
"fmt"
"math/big"
"net/http"
"strconv"
"strings"
"github.com/ethereum/go-ethereum/common"
"github.com/labstack/echo"
"github.com/y2labs-0sh/dada-api/data"
"github.com/y2labs-0sh/dada-api/data/harvestfarm"
"github.com/y2labs-0sh/dada-api/erc20"
sf "github.com/y2labs-0sh/dada-api/sta... |
package template
import (
"bytes"
"fmt"
"reflect"
"regexp"
"text/template"
"github.com/foundatn-io/go-pic/pkg/lex"
)
var (
// TODO: investigate https://github.com/masterminds/sprig for better
// templating?
//
// Global state for funcMap reference when templating
newStart = 1
newEnd = 1
savedStart... |
package pubsub
import (
"log"
"sync"
"sync/atomic"
"time"
"github.com/febytanzil/gobroker"
"github.com/streadway/amqp"
)
type rabbitMQPub struct {
conn *amqp.Connection
channel *sync.Map
m *sync.Mutex
cm *sync.Mutex
msgQ chan rabbitMQPubMsg
config *config
state ... |
// Copyright (c) 2021, <NAME> <<EMAIL>>
// All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package boltron
import (
"encoding/binary"
"encoding/json"
"fmt"
"strconv"
"time"
)
// Encoding defines serialization of any type to and from by... |
package net
import (
"bytes"
"encoding/json"
"fmt"
"os"
"os/exec"
"path/filepath"
"sort"
"strings"
"github.com/containernetworking/cni/libcni"
"github.com/containernetworking/cni/pkg/types/current"
"github.com/containernetworking/cni/pkg/version"
specs "github.com/opencontainers/runtime-spec/specs-go"
"g... |
package main
import (
"bytes"
"crypto/tls"
"encoding/json"
"fmt"
"net/http"
"net/http/httputil"
"net/url"
"os"
"path"
"strings"
"time"
"github.com/google/uuid"
log "github.com/sirupsen/logrus"
)
const (
defaultPort = "8080"
defaultGoogleAnalyticsUrl = "https://www.google-analytics.com/co... |
package api
import (
"errors"
"time"
"github.com/blang/semver"
)
var (
// ErrRegisterInstanceFailed indicates that the instance registration did
// not succeed.
ErrRegisterInstanceFailed = errors.New("coreroller: register instance failed")
// ErrUpdateInProgressOnInstance indicates that an update is currentl... |
package cluster
import (
"bytes"
"context"
"encoding/binary"
"encoding/gob"
"errors"
"io"
"sync"
"sync/atomic"
"time"
"github.com/golang/protobuf/proto"
"github.com/hashicorp/raft"
"github.com/vontikov/stoa/pkg/logging"
"github.com/vontikov/stoa/pkg/pb"
)
var timeNow = time.Now
// ErrUnknownCommand is... |
package eax
/*
Package eax implements cryptographic block ciphers' EAX mode
*/
import (
"crypto/cipher"
"errors"
)
const BLOCK_SIZE = 16
type CmacCtx struct {
cipher cipher.Block
_X [16]byte
count int
}
func NewCMAC(cipher cipher.Block) (*CmacCtx, error) {
if cipher.BlockSize() != BLOCK_SIZE {
return nil,... |
// Copyright 2020 The ZKits 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 obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law o... |
/*
* Copyright 2019 <NAME>, Inc. and Contributors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable... |
// Copyright 2021 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 ... |
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
//
// Copyright 2020 IBM 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 agreed to ... |
package dicom
import (
"bytes"
"encoding/binary"
"fmt"
)
type dicomBuffer struct {
*bytes.Buffer
bo binary.ByteOrder
implicit bool
p uint32 // element start position
}
// The default DicomBuffer reads a buffer with Little Endian byteorder
// and explicit VR
func newDicomBuffer(b []byte) *dicomBuf... |
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writi... |
// Copyright (c) 2020 Zededa, Inc.
// SPDX-License-Identifier: Apache-2.0
package vaultmgr
import (
"regexp"
etpm "github.com/lf-edge/eve/pkg/pillar/evetpm"
"github.com/lf-edge/eve/pkg/pillar/types"
"github.com/lf-edge/eve/pkg/pillar/vault"
)
const (
defaultSecretDataset = vault.DefaultZpool + "/vault"
def... |
package arith
import (
"crypto/rand"
"io"
"math/big"
mrand "math/rand"
"testing"
)
func TestLength(t *testing.T) {
tests := [...]struct {
i uint64
l int
}{
{i: 0, l: 1},
{i: 1, l: 1},
{i: 10, l: 2},
{i: 100, l: 3},
{i: 1000, l: 4},
{i: 10000, l: 5},
{i: 100000, l: 6},
{i: 1000000, l: 7},
... |
package events
import (
"github.com/ethereum/go-ethereum/event"
ethLog "github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/rpc"
"github.com/lukso-network/lukso-orchestrator/shared/types"
"sync"
"time"
)
// Type determines the kind of filter and is used to put the filter in to
// the correct b... |
/*******************************************************************************
* Copyright (c) 2018 charles
*
* 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, incl... |
// Copyright 2013 <NAME>
// License: MIT
// Line: Chapter 19, Bodies in Straight Line
package line
import (
"errors"
"math"
"github.com/mooncaker816/learnmeeus/v3/interp"
"github.com/soniakeys/unit"
)
// Time computes the time at which a moving body is on a straight line (great
// circle) between two fixed poin... |
package keys
import "fmt"
var allMiscKeys []string
func MiscKeys() []string {
if len(allMiscKeys) == 0 {
var formats = []string{
"%[1]vleading-%[2]v",
"%[1]v/leading-%[2]v-path",
"%[1]v/%[1]v/leading-multiple-%[2]v-path",
"trailing-%[2]v%[1]v",
"trailing-%[2]v-path/%[1]v",
"trailing-multiple-%[... |
// Copyright 2017 The Serulian 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 grok
import (
"fmt"
"github.com/serulian/compiler/compilercommon"
"github.com/serulian/compiler/graphs/srg"
"github.com/serulian/compiler/gr... |
/*******************************************************************************
*
* Copyright 2017 SAP SE
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You should have received a copy of the License along with this
* program. If... |
package project
import (
"context"
"fmt"
"io/ioutil"
"path/filepath"
"sort"
"strings"
"time"
"golang.org/x/tools/go/packages"
"golang.org/x/tools/internal/lsp/cache"
"golang.org/x/tools/internal/lsp/protocol"
"golang.org/x/tools/internal/lsp/source"
)
const (
modExt = "go.mod"
vendorDir = "vendor"
)
... |
//
// (C) Copyright 2019 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 ... |
/*
Copyright 2015 <NAME> 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 agreed to in writing, ... |
// Copyright © 2022 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
// 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
//
// Unle... |
package main
import (
"bytes"
"io"
"io/ioutil"
"net/http"
"os"
"sort"
"strings"
"github.com/prometheus/common/expfmt"
"gopkg.in/yaml.v3"
dto "github.com/prometheus/client_model/go"
)
const (
unitBytes = "bytes"
unitSeconds = "seconds"
unitMilliseconds = "milliseconds"
prefixFieldLength... |
package logger
import (
"context"
"errors"
"fmt"
"github.com/IBM/ibmcloud-storage-utilities/block-storage-attacher/utils/crn"
uid "github.com/satori/go.uuid"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"os"
)
const (
//CrnLabel is label in log for the crn
CrnLabel = "crn"
// PodNameEnvVar is the pod name ... |
// Copyright © 2013 Galvanized Logic Inc.
// Use is governed by a FreeBSD license found in the LICENSE file.
package move
import (
"math"
"vu/math/lin"
)
// Shapes are physics collision primitives used to enclose a 3D model.
// A Shape is always in local space centered at the origin. Combine a
// shape with a tran... |
package os
import (
"fmt"
"os"
"sort"
"path/filepath"
"encoding/json"
"github.com/elastic/beats/libbeat/common"
"github.com/elastic/beats/libbeat/common/cfgwarn"
"github.com/elastic/beats/libbeat/logp"
"github.com/elastic/beats/libbeat/paths"
"github.com/elastic/beats/metricbeat/mb"
"github.co... |
package cli
import (
"errors"
"strings"
)
type args []string
// The CLI program itself, this stores all of the program commands, and program
// level flags.
type Cli struct {
cmds commands
flags Flags
main *Command
}
func addCommand(name string, parent *Command, handler commandHandler, cmds commands) *Comman... |
package day08
import (
"errors"
"math"
)
// A Program is a set of instructions and the state of the virtual processor.
type Program struct {
// Instructions is the list of instructions the program should execute.
Instructions []Instruction
// Accumulator is the current value of the virtual processor's accumulato... |
package process
import (
"math"
"raytracer/models"
"raytracer/utility"
"github.com/go-gl/mathgl/mgl32"
)
type RaycastResult struct {
Triangle *models.Triangle
T float32
U float32
V float32
Point mgl32.Vec3
}
// Path traces a given pixel ray
func Trace(context *models.RenderContext, ... |
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: platform/v1/classification.proto
package platformv1
import (
fmt "fmt"
proto "github.com/gogo/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.In... |
/*
Copyright 2018 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... |
package funcs
import (
"bytes"
"encoding/json"
"fmt"
"github.com/cihub/seelog"
_ "github.com/mattn/go-sqlite3"
"github.com/smartping/smartping/src/g"
"github.com/smartping/smartping/src/nettools"
"net/smtp"
"strconv"
"strings"
"time"
)
func StartAlert() {
seelog.Info("[func:StartAlert] ", "starting run Al... |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package network
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about... |
package config
import (
"fmt"
"os"
"path/filepath"
"strings"
"sync"
"github.com/namsral/flag"
"github.com/ligato/cn-infra/logging/logrus"
)
const (
// FlagSuffix is added to plugin name while loading plugins configuration.
FlagSuffix = "-config"
// EnvSuffix is added to plugin name while loading plugins ... |
///////////////////////////////////////////////////////////////////////////
// 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/licens... |
package parsers
import (
"bufio"
"database/sql"
"fmt"
"os"
"strconv"
"strings"
"github.com/pkg/errors"
"golang.org/x/text/encoding/charmap"
"golang.org/x/text/transform"
)
var (
// ErrCNPJNotFound error
ErrCNPJNotFound = fmt.Errorf("CNPJ not found")
)
func populateFRE(db *sql.DB, file string) (int, error... |
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package refactorspaces
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Definition of AWS::RefactorSpaces::Ro... |
package alarm
import (
"fmt"
"sync"
"strings"
"strconv"
"errors"
"net"
"net/http"
"time"
"util/log"
"model/pkg/alarmpb"
"google.golang.org/grpc"
"google.golang.org/grpc/reflection"
"golang.org/x/net/context"
"github.com/gomodule/redigo/redis"
)
type AlarmServer interface {
NodeRangeAlarm(context.Cont... |
package main
import (
"context"
"fmt"
"io/ioutil"
"log"
"net"
"os"
"os/exec"
"runtime"
"sync"
"testing"
"time"
"github.com/fhs/acme-lsp/internal/acme"
"github.com/fhs/acme-lsp/internal/lsp/acmelsp/config"
)
func TestMain(m *testing.M) {
// TODO: Replace Xvfb with a fake devdraw.
var x *exec.Cmd
var a... |
package main
import (
"github.com/btcsuite/btcd/rpcclient"
"fmt"
"github.com/go-pg/pg"
"github.com/go-pg/pg/orm"
"log"
"os"
"strings"
"time"
)
// A Worker contains all the components necessary to make RPC calls to bitcoind, and
// to place data into PostgreSQL.
type Worker struct {
client *rpcclient.Client
... |
package bi
import (
"sync"
"time"
"github.com/jeckbjy/gsk/util/idgen/xid"
)
const (
statusNone = 0
statusRun = 1
statusStop = 2
)
const (
defaultMax = 100000
defaultBatch = 100
defaultRetry = 10
defaultWait = time.Minute * 10
)
// 配置信息,通常只需要设置URL,其他使用默认值
type Options struct {
Tran Transport //... |
// Copyright 2021 The Chromium 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 rules provides methods to evaluate test name clustering rules.
package rules
import (
"fmt"
"regexp"
"strings"
"go.chromium.org/luci/comm... |
// ORIGINAL: java/QueryParamPagePattern.java
// Copyright (c) 2020 <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
/... |
/*
Copyright 2021 The Alibaba 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 rubban
import (
"context"
"fmt"
"regexp"
"strings"
"sync"
"time"
"github.com/dustin/go-humanize"
"github.com/robfig/cron/v3"
"github.com/sherifabdlnaby/gpool"
"github.com/sherifabdlnaby/rubban/config"
"github.com/sherifabdlnaby/rubban/rubban/kibana"
)
//GeneralPattern hold attributes for a General... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package rds
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
// Please also see https://docs.aws.amazon.com/goto/WebAPI/rds-2014-10-31/ModifyDBClusterEndpointMessage
type Modify... |
package builder
import (
"go/ast"
"go/token"
"log"
"github.com/lawrsp/pigo/pkg/parser"
)
func getAllVariables(b Builder) *VariableList {
vl := NewVariableList()
//oder: inner to outer
for ob := b; ob != nil; ob = ob.Outer() {
vl = vl.Concat(ob.Variables())
}
return vl
}
func GetVariable(b Builder, t par... |
package main
import (
"context"
"net"
"strings"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
ttesting "github.com/tektoncd/pipeline/pkg/reconciler/testing"
test "github.com/tektoncd/pipeline/test"
_ "github.com/mattn/go-sqlite3"
"github.com/tektoncd/expe... |
/*
Copyright The Helm 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, software
di... |
package merging
import (
"encoding/json"
"regexp"
"strconv"
"github.com/valyala/fastjson"
)
var floatRegex = regexp.MustCompile("^[+-]?([0-9]+[.][0-9]+)$")
var intRegex = regexp.MustCompile("^[+-]?([0-9]+)$")
// Config is an adapter to merging the response body.
type Config struct {
ResponseBody []byte
data ... |
// Copyright (c) 2018, 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 main
import (
"os"
"os/exec"
"path"
"strings"
... |
package timex
/*
File contains a latency tracker, of which the primary purpose is to track how
much (average) latency some processes have during some time window.
It is a linked list where each link/node represents some discrete time, and
store data about cumulative latency and amount of additions (for average calc).
... |
package broker
import (
"context"
"time"
"github.com/LiveRamp/gazette/v2/pkg/allocator"
"github.com/LiveRamp/gazette/v2/pkg/fragment"
pb "github.com/LiveRamp/gazette/v2/pkg/protocol"
gc "github.com/go-check/check"
)
type ReplicaSuite struct{}
// TODO(johnny): Additional unit-test coverage needed here (issue #... |
/*
Copyright the Velero contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... |
package autopilot
import (
prand "math/rand"
"net"
"time"
"github.com/btcsuite/btcd/btcec"
"github.com/btcsuite/btcutil"
)
// ConstrainedPrefAttachment is an implementation of the AttachmentHeuristic
// interface that implement a constrained non-linear preferential attachment
// heuristic. This means that given... |
package main
import (
"encoding/json"
"flag"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"path/filepath"
"strings"
"github.com/otiai10/copy"
)
var cinder_path string = ""
var dest_path string = ""
var app_name string = ""
// DownloadFile will download a url to a local file. It's efficient because it will
// wr... |
// Copyright 2020 The Fuchsia 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 main
// ninja_buildstats is an utility for extracting useful stats out of build
// artifacts from Ninja.
//
// It combines information ninjalog, com... |
package grpcx
import (
"context"
"errors"
"fmt"
"net"
"strings"
"sync"
"github.com/smallnest/rpcx/client"
"github.com/smallnest/rpcx/protocol"
"github.com/smallnest/rpcx/share"
"google.golang.org/grpc"
)
// Errors for grpc client.
var (
ErrNotSupported = errors.New("feature ... |
// Copyright 2017 <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package gui
import (
"bytes"
"fmt"
"net/url"
"reflect"
"strconv"
"strings"
"github.com/vdobler/ht/errorlist"
)
// Message is a typed text message.
type Messa... |
package kong
import (
"fmt"
)
// RoutesOperations interface holds Kong Routes Methods
type RoutesOperations interface {
Get(id string) *Routes
Exist(id string) bool
Create(body Route) *Routes
Update(body Route) *Routes
Delete(id string) error
Purge() error
Plugins() map[string]Plugin
AsMap() map[string]Rou... |
package server
import (
"errors"
"fmt"
"net"
"net/http"
"os"
"os/signal"
"sync"
"syscall"
"time"
"github.com/facebookgo/grace"
"github.com/fritzpay/paymentd/pkg/config"
"golang.org/x/net/context"
"gopkg.in/inconshreveable/log15.v2"
)
const (
serverWaitTimeout = 10 * time.Second
)
// Wait is a global W... |
package main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"github.com/GeertJohan/go.linenoise"
"github.com/sath33sh/infra/wapi"
"github.com/sath33sh/infra/util"
"os"
"regexp"
"strings"
)
type env struct {
host string // Host url string.
credStr string // Credentials string.
verbose bool // Enable v... |
package acceptance
import (
"gopkg.in/yaml.v2"
"log"
"os"
"github.com/onsi/gomega/gexec"
"github.com/pivotal-cf/go-pivnet/v4"
"github.com/pivotal-cf/go-pivnet/v4/logshim"
"github.com/pivotal-cf/pivnet-resource/gp"
"github.com/robdimsdale/sanitizer"
"testing"
. "github.com/onsi/ginkgo"
. "github.com/onsi/... |
// Copyright 2011 The GoGL Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE.mkd file.
package main
import (
"flag"
"fmt"
"os"
"path/filepath"
)
func generatePackages(
specsDir string,
enumextFile string,
specFiles []string,
typeMa... |
package cassandra
import (
"context"
"fmt"
"github.com/getumen/gogo_crawler/domains/models"
"github.com/getumen/gogo_crawler/domains/repository"
"github.com/gocql/gocql"
"github.com/vmihailenco/msgpack"
"log"
"net/http"
"net/url"
"strings"
"time"
)
type requestRepository struct {
session *gocql.Session
}
... |
package cxcore
import (
"github.com/skycoin/cx/cx/ast"
"github.com/skycoin/cx/cx/constants"
)
//TODO: Rename opSliceLen
func opLen(expr *ast.CXExpression, fp int) {
inp1, out1 := expr.Inputs[0], expr.Outputs[0]
elt := ast.GetAssignmentElement(inp1)
if elt.IsSlice || elt.Type == constants.TYPE_AFF {
var sliceO... |
// Copyright 2020 SunJun <<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 t... |
package main
import (
"flag"
"fmt"
"image"
"image/color"
"io/ioutil"
"log"
"os"
"path/filepath"
"strings"
"fyne.io/fyne"
"fyne.io/fyne/app"
"fyne.io/fyne/canvas"
"fyne.io/fyne/layout"
"fyne.io/fyne/theme"
"fyne.io/fyne/widget"
)
type toolbarLabel struct {
}
func (t *toolbarLabel) ToolbarObject() fyne... |
// Copyright (C) 2017 <NAME>. All Rights Reserved.
package channel
import (
"bufio"
"bytes"
"errors"
"fmt"
"io"
"strconv"
"strings"
)
// StrictHeader defines a framing that transmits and receives messages using a
// header prefix similar to HTTP, in which mimeType describes the content type.
//
// Specificall... |
package main
import (
"database/sql"
"fmt"
"log"
"math/rand"
"os"
"strconv"
"time"
"github.com/google/uuid"
_ "github.com/lib/pq"
)
var host = getEnvString("PG_HOST")
var port = getEnvInt("PG_PORT")
var user = getEnvString("PG_USER")
var password = getEnvString("PG_PASSWORD")
var dbname = getEnvStr... |
package ssz
import (
"reflect"
"unsafe"
)
// During deepValueEqual, must keep track of checks that are
// in progress. The comparison algorithm assumes that all
// checks in progress are true when it reencounters them.
// Visited comparisons are stored in a map indexed by visit.
type visit struct {
a1 unsafe.Poin... |
/*
* MinIO Cloud Storage, (C) 2019 MinIO, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
package serverctlNoRedis
import (
"fmt"
"log"
"net/http"
"time"
pb "RoomStatus/proto"
"github.com/gin-gonic/gin"
"github.com/golang/protobuf/proto"
"github.com/gorilla/websocket"
)
const (
// Time allowed to write a message to the peer.
writeWait = 10 * time.Second
// Time allowed to read the next pong ... |
//go:generate easytags $GOFILE json:camel
package actions
import (
"github.com/handshake-labs/blockexplorer/pkg/db"
"github.com/handshake-labs/blockexplorer/pkg/types"
)
type Block struct {
Hash types.Bytes `json:"hash"`
Height int32 `json:"height"`
Weight int32 `json:"weig... |
// Package life contains the logic running the game of life.
package life
import (
"bufio"
"errors"
"fmt"
"os"
"path"
"strconv"
"strings"
)
type boardSymbol uint8
const alive boardSymbol = '*'
const dead boardSymbol = ' '
const configFolder = "predefined_configs"
// The game is represented by its current sta... |
// Copyright © 2016 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 ... |
package iam
import (
"time"
)
// User represents a user profile in IAM
type User struct {
PreferredLanguage string `json:"preferredLanguage"`
PreferredCommunicationChannel string `json:"preferredCommunicationChannel,omitempty"`
EmailAddress string `... |
// Copyright © 2019 Circonus, Inc. <<EMAIL>>
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
package config
import (
"encoding/json"
"expvar"
"fmt"
"io"
"github.com/circonus-labs/circonus-cloud-agent/internal/config/defaults"
toml "github.com/pelletier... |
//go:build linux
package test
import (
"fmt"
"io"
"log"
"net"
"os"
"os/exec"
"github.com/pion/ice/v2"
g "github.com/stv0g/gont/pkg"
nl "github.com/vishvananda/netlink"
"golang.zx2c4.com/wireguard/wgctrl"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"riasc.eu/wice/pkg/crypto"
"riasc.eu/wice/pkg/socket"
)
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.