text
stringlengths
3.08k
10.4k
package apcupsd import ( "context" "encoding/binary" "fmt" "net" "testing" "time" "github.com/circonus-labs/circonus-unified-agent/plugins/inputs" "github.com/circonus-labs/circonus-unified-agent/testutil" "github.com/stretchr/testify/require" ) func TestApcupsdDocs(t *testing.T) { apc := &ApcUpsd{} apc.D...
// Package walk implements a path walker which reads audio files under a path and // constructs an index.Library from supported metadata tags (see github.com/dhowden/tag). package walk import ( "crypto/sha1" "fmt" "log" "os" "path/filepath" "strings" "sync" "time" "github.com/dhowden/tag" "tchaik.com/index"...
/* license: https://mit-license.org * * DIMP : Decentralized Instant Messaging Protocol * * Written in 2021 by Moky <<EMAIL>> * * ============================================================================== * The MIT License (MIT) * * Copyright (c) 2021 <NAME> * * Permission...
package edgectl import ( "bufio" "bytes" "context" "fmt" "io" "log" "os" "os/exec" "regexp" "strings" "time" "github.com/pkg/errors" ) var validEmailAddress = regexp.MustCompile("^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-...
/* * Copyright 2019 <NAME> <<EMAIL>> * Copyright 2019 SUSE 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...
// Code generated by smithy-go-codegen DO NOT EDIT. package ec2 import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/ec2/types" smithy "github.com/awslabs/smithy-go" "github.com/awslabs/smithy-go/middlew...
/* * 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...
package timeLag import ( "context" "fmt" "github.com/bookingcom/carbonapi/expr/helper" "github.com/bookingcom/carbonapi/expr/interfaces" "github.com/bookingcom/carbonapi/expr/types" "github.com/bookingcom/carbonapi/pkg/parser" ) type timeLag struct { interfaces.FunctionBase } func GetOrder() interfaces.Order...
package limiter import ( "container/list" "context" "strings" "sync" "testing" "github.com/stretchr/testify/assert" "github.com/platinummonkey/go-concurrency-limits/core" "github.com/platinummonkey/go-concurrency-limits/limit" "github.com/platinummonkey/go-concurrency-limits/strategy" ) type testFifoQueueC...
// Copyright 2018 The Gooid Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package egl /* #cgo android CFLAGS: -DANDROID -D__ANDROID__ #cgo android,!gles3 LDFLAGS: -lGLESv2 -lEGL #cgo android,gles3 LDFLAGS: -lGLESv3 -lEGL #cgo linu...
package bpf import ( "github.com/alecthomas/participle" "github.com/alecthomas/participle/lexer" "github.com/alecthomas/participle/lexer/ebnf" "log" ) // Filter expressions wrapper type Filter struct { Primitives *Expression ` @@ ` } // Expression consists of one or more Primitives type Expression struct { Pri...
package main import ( "fmt" "github.com/charmbracelet/bubbles/textinput" tea "github.com/charmbracelet/bubbletea" "github.com/charmbracelet/lipgloss" "strings" ) var ( inputsTitleBarStyle = lipgloss.NewStyle(). Padding(1, 0, 1, 2) inputsTitleStyle = lipgloss.NewStyle(). Foreground(lipgloss.Color("#FFF...
// Code generated by protoc-gen-go. // source: request_forwarding_service.proto // DO NOT EDIT! /* Package vault is a generated protocol buffer package. It is generated from these files: request_forwarding_service.proto It has these top-level messages: */ package vault import proto "github.com/golang/protobuf/prot...
// Copyright 2019 New Relic Corporation. All rights reserved. // SPDX-License-Identifier: Apache-2.0 package telemetry import ( "io/ioutil" "testing" "time" "github.com/newrelic/newrelic-telemetry-sdk-go/internal" ) func testSpanGroupJSON(t testing.TB, batches []Batch, expect string) { if th, ok := t.(interfac...
package clusterconfig import ( "context" "encoding/base64" "encoding/pem" "fmt" "strings" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" corev1client "k8s.io/client-go/kubernetes/typed/core/v1" "sigs.k8s.io/yaml" "github.com/openshift/insights-operator/pkg/record" ) // GatherC...
package mongobin import ( "archive/tar" "compress/gzip" "crypto/sha256" "encoding/hex" "fmt" "io" "net/http" "net/url" "path" "regexp" "strings" "time" "github.com/antonyho/memongo/memongolog" "github.com/spf13/afero" ) var afs afero.Afero func init() { afs = afero.Afero{ Fs: afero.NewOsFs(), } } ...
package types import ( "github.com/puppetlabs/wash/cmd/internal/find/parser/predicate" ) // EntryPredicate represents a predicate on a Wash entry. type EntryPredicate interface { predicate.Predicate P(Entry) bool SchemaP() EntrySchemaPredicate SetSchemaP(EntrySchemaPredicate) SchemaRequired() bool RequireSchem...
package service import ( "bufio" "encoding/binary" "io" "os" "unsafe" "github.com/indrenicloud/tricloud-agent/app/logg" "github.com/indrenicloud/tricloud-agent/wire" ) const ( ChunkSize = 1024 * 1024 * 10 AckSlots = 3 HeadSize = int(unsafe.Sizeof(DownlodMsg{}) + unsafe.Sizeof(wire.Header{})) ) const ( ...
package evmtest import ( "math/big" "testing" "github.com/smartcontractkit/chainlink/core/chains/evm" evmconfig "github.com/smartcontractkit/chainlink/core/chains/evm/config" evmmocks "github.com/smartcontractkit/chainlink/core/chains/evm/mocks" evmtypes "github.com/smartcontractkit/chainlink/core/chains/evm/ty...
package op import ( "bytes" "fmt" "math" "github.com/emicklei/melrose/core" ) type Merge struct { Target []core.Sequenceable } func (m Merge) Storex() string { var b bytes.Buffer fmt.Fprintf(&b, "merge(") core.AppendStorexList(&b, true, m.Target) fmt.Fprintf(&b, ")") return b.String() } // Replaced is pa...
package fixedwidth import ( "bytes" "fmt" "log" "reflect" "testing" "github.com/pkg/errors" ) func ExampleMarshal() { // define some data to encode people := struct { ID int `fixed:"1,5"` FirstName string `fixed:"6,15"` LastName string `fixed:"16,25"` Grade float64 `fixed:"26,30"` ...
package aws import ( "fmt" "net/http" "os" "strconv" "sync" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/ec2" "github.com/hairyhenderson/gomplate/v3/env" ) var describerClient InstanceDescriber...
// 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...
package manager import ( "fmt" "strconv" appsv1 "k8s.io/api/apps/v1" v1 "k8s.io/api/core/v1" kerrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachine...
/* * Cadence - The resource-oriented smart contract programming language * * Copyright 2019-2020 <NAME>, 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....
// +build linux package ipvs import ( "net" "syscall" "time" "fmt" "github.com/vishvananda/netlink/nl" "github.com/vishvananda/netns" ) const ( netlinkRecvSocketsTimeout = 3 * time.Second netlinkSendSocketTimeout = 30 * time.Second ) // Service defines an IPVS service in its entirety. type Service struct...
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. // See License.txt for license information. package utils import ( "crypto" "crypto/md5" "crypto/rsa" "crypto/sha512" "crypto/x509" "encoding/base64" "encoding/pem" "fmt" "io/ioutil" "os" "strconv" "strings" l4g "github.com/alecthomas/l...
package campaigns import ( "context" "database/sql" "encoding/json" "fmt" "math/rand" "time" "github.com/keegancsmith/sqlf" "github.com/pkg/errors" "github.com/sourcegraph/sourcegraph/internal/db/basestore" "github.com/sourcegraph/sourcegraph/internal/db/dbutil" ) // seededRand is used to populate the Rand...
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 package channels import ( "database/sql" "encoding/json" "log" "net/http" "github.com/mattn/go-sqlite3" "github.com/twitchdev/twitch-cli/internal/database" "github.com/twitchdev/twitch-cli/internal/mock...
/** * (C) 2020 Geotab Inc * * All files and artifacts in the repository at https://github.com/MEAE-GOT/W3C_VehicleSignalInterfaceImpl * are licensed under the provisions of the license provided by the LICENSE file in this repository. * **/ package main import ( "encoding/base64" "encoding/json" "fmt" "io/ioutil" ...
// This file is drived from the code available in linuxkit project under Apache License v2 // https://github.com/linuxkit/linuxkit/blob/master/pkg/init/cmd/service/logging.go package containerd import ( "bufio" "errors" "fmt" "io" "io/ioutil" "net" "os" "path/filepath" "strings" "syscall" "github.com/c...
// Copyright 2018 <NAME>.A.S. Atos Technologies - Bull, Rue Jean Jaures, B.P.68, 78340, Les Clayes-sous-Bois, France. // // 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...
/* * 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 ...
package azure import ( "context" "fmt" "log" "os" "strings" "testing" "time" "github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/resources/mgmt/resources" armStorage "github.com/Azure/azure-sdk-for-go/profiles/2017-03-09/storage/mgmt/storage" "github.com/Azure/azure-sdk-for-go/storage" sasStorage "githu...
package v1migration import ( "io/ioutil" "path/filepath" "strings" "github.com/pkg/errors" log "github.com/sirupsen/logrus" "github.com/spf13/cobra" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/client-go/dy...
package image import ( "fmt" "io/ioutil" "net/http" "net/url" "reflect" "time" "github.com/gorilla/mux" lhv1beta1 "github.com/longhorn/longhorn-manager/k8s/pkg/apis/longhorn/v1beta1" "github.com/pkg/errors" "github.com/rancher/apiserver/pkg/apierror" "github.com/rancher/apiserver/pkg/types" "github.com/ra...
package cluster import ( "context" "fmt" "sync" "github.com/go-kit/log" "github.com/go-kit/log/level" "github.com/golang/protobuf/ptypes/empty" "github.com/gorilla/mux" "github.com/grafana/agent/pkg/agentproto" "github.com/grafana/agent/pkg/metrics/instance" "github.com/grafana/agent/pkg/metrics/instance/co...
package main import ( "fmt" "github.com/IdrisTheDragon/AdventOfCode2018/utils" ) func main() { lines := utils.GetLines("../myInput.txt") opcodes := []OP{ {name:"addr",action:'+',a:'r',b:'r'}, {name:"addi",action:'+',a:'r',b:'v'}, {name:"mulr",action:'*',a:'r',b:'r'}, {name:"muli",action:'*',a:'r',b:'v'}...
package main import ( "context" "fmt" "io/ioutil" "os" "path/filepath" "runtime" "sort" "strings" "time" "github.com/kiteco/kiteco/kite-golib/cmdline" "github.com/kiteco/kiteco/kite-golib/envutil" "github.com/kiteco/kiteco/local-pipelines/python-import-exploration/internal/docker" ) const defaultMachine ...
// Copyright 2017 TiKV 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 or agr...
package accounting import ( "encoding/json" "encoding/xml" "time" "github.com/sipsynergy/xerogolang" "github.com/sipsynergy/xerogolang/helpers" "github.com/markbates/goth" ) //Prepayment are payments made before the associated document has been created type Prepayment struct { // See Prepayment Types Type s...
/* Copyright (c) 2020 Red Hat, 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...
package llbsolver import ( "context" "fmt" "io" "strings" "sync" "github.com/docker/distribution/reference" "github.com/moby/buildkit/cache" "github.com/moby/buildkit/cache/remotecache" "github.com/moby/buildkit/executor" "github.com/moby/buildkit/frontend" gw "github.com/moby/buildkit/frontend/gateway/cli...
// Code generated by gotdgen, DO NOT EDIT. package tdapi import ( "context" "errors" "fmt" "sort" "strings" "go.uber.org/multierr" "github.com/gotd/td/bin" "github.com/gotd/td/tdjson" "github.com/gotd/td/tdp" "github.com/gotd/td/tgerr" ) // No-op definition for keeping imports. var ( _ = bin.Buffer{} _...
package main import ( "bufio" "fmt" "os" ) func readInt(bytes []byte, from int, val *int) int { i := from tmp := 0 for i < len(bytes) && bytes[i] != ' ' { tmp = tmp*10 + int(bytes[i]-'0') i++ } *val = tmp return i } func readNum(scanner *bufio.Scanner) (a int) { scanner.Scan() readInt(scanner.Bytes(),...
// SPDX-License-Identifier: MIT-0 package iputils import ( "bytes" "fmt" "net" ) const ( // IPv4Size contains size of IPv4 in bytes IPv4Size = 4 // IPv6Size contains size of IPv6 in bytes IPv6Size = 16 ) var ( // V4InV6Prefix describes the prefix of a IPv4 address in IPv6 structure V4InV6Prefix = []byte{0...
//go:build integration // +build integration package sqlstore import ( "context" "reflect" "testing" "github.com/grafana/grafana/pkg/components/simplejson" "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/pkg/setting" "github.com/stretchr/testify/require" ) func updateTestDashboard(t *test...
package request import ( "log" "testing" "time" "github.com/google/go-cmp/cmp" "github.com/google/uuid" ) func TestToMap(t *testing.T) { completed := time.Now() midpoint := completed.Add(time.Microsecond * -2) earlier := completed.Add(time.Microsecond * -4) tmpUUID := uuid.New() request := Request{ Requ...
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. package server import ( "context" "fmt" psql "github.com/Azure/azure-sdk-for-go/services/postgresql/mgmt/2017-12-01/postgresql" "github.com/Azure/azure-service-operator/api/v1alpha1" azurev1alpha1 "github.com/Azure/azure-service-operator...
package ip6tun import ( "errors" "fmt" log "github.com/Sirupsen/logrus" "io" "net" "sync" "time" ) var ( ErrTunnelNotFound = errors.New("Tunnel not found") ) // Tunnel is a 4in6 tunnel type Tunnel struct { Id uint32 `json:"id"` Name string `json:"name"` LocalPort uint16 `json:"l...
package clusterinstallation import ( "context" "fmt" "reflect" "github.com/go-logr/logr" mattermostv1alpha1 "github.com/mattermost/mattermost-operator/pkg/apis/mattermost/v1alpha1" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" v1beta1 "k8s.io/api/extensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis...
// Copyright 2016 The Periph Authors. All rights reserved. // Use of this source code is governed under the Apache License, Version 2.0 // that can be found in the LICENSE file. // Package spi defines the API to communicate with devices over the SPI // protocol. // // As described in https://periph.io/x/periph/conn#hd...
package chartserver import ( "encoding/json" "errors" "math" "time" beego_cache "github.com/astaxie/beego/cache" hlog "github.com/goharbor/harbor/src/lib/log" // Enable redis cache adaptor _ "github.com/astaxie/beego/cache/redis" ) const ( standardExpireTime = 3600 * time.Second redisENVKey ...
package parser import ( "errors" "os" "github.com/oleiade/lane" "github.com/romiras/fsql/query" "github.com/romiras/fsql/tokenizer" ) // parseConditionTree parses the condition tree passed to the WHERE clause. func (p *parser) parseConditionTree() (*query.ConditionNode, error) { stack := lane.NewStack() errF...
/* Copyright 2016 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...
package xlsx import "strconv" // Several popular font names that can be used to create fonts const ( Helvetica = "Helvetica" Baskerville = "Baskerville Old Face" TimesNewRoman = "Times New Roman" Bodoni = "Bodoni MT" GillSans = "Gill Sans MT" Courier = "Courier" ) const ( RGB_Light_Gre...
package kopiarunner import ( "regexp" "strconv" "strings" "github.com/pkg/errors" "github.com/kopia/kopia/tests/robustness/snap" ) var _ snap.Snapshotter = &KopiaSnapshotter{} const ( contentCacheSizeMBFlag = "--content-cache-size-mb" metadataCacheSizeMBFlag = "--metadata-cache-size-mb" noCheckForUpdatesF...
package attestation import ( "context" "fmt" "github.com/alibaba/inclavare-containers/shim/runtime/config" "github.com/alibaba/inclavare-containers/shim/runtime/v2/rune/constants" "github.com/opencontainers/runc/libenclave/attestation/sgx" pb "github.com/opencontainers/runc/libenclave/proto" specs "github.com/o...
package config import ( "fmt" "net" "reflect" "strconv" "strings" utilnet "k8s.io/utils/net" ) // HostPort is the object that holds the definition for a host and port tuple type HostPort struct { Host *net.IP Port int32 } // CIDRNetworkEntry is the object that holds the definition for a single network CIDR ...
package headtracker import ( "context" "fmt" "time" "github.com/ethereum/go-ethereum" "github.com/jpillora/backoff" "github.com/pkg/errors" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" "go.uber.org/atomic" "github.com/smartcontractkit/chainlink/...
package main import ( "crypto/x509" "encoding/json" "log" "math/rand" "net" "sort" "time" "github.com/yinghuocho/golibfq/mux" "github.com/yinghuocho/golibfq/sockstun" "github.com/yinghuocho/golibfq/utils" "github.com/yinghuocho/gosocks" ) type tunnelRequest struct { ret chan net.Conn } type tunnelPeer i...
/* Copyright 2019 The Knative Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, soft...
package main import ( "io/ioutil" "net/http" "net/http/httptest" "strings" "testing" "github.com/mattermost/mattermost-server/v5/model" "github.com/mattermost/mattermost-server/v5/plugin" "github.com/mattermost/mattermost-server/v5/plugin/plugintest" "github.com/mattermost/mattermost-server/v5/plugin/plugint...
package locales import ( "regexp" "strconv" "strings" "github.com/nleeper/goment/regexps" ) type ordinalFunction func(int, string) string type meridiemFunction func(int, int, bool) string type calendarFunction func(int, int) string type longDateFormats map[string]string type relativeTimeFormats map[string]st...
package main import ( "flag" "fmt" "log" "os" "strings" "time" "github.com/araddon/dateparse" "github.com/influxdata/influxdb/client/v2" ) var ( // Version number. Set in Makefile. Version string // Build number. Set in Makefile. Build string // Configuration settings. settings Settings ) // Settin...
/* Copyright 2019 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
package main import ( "fmt" "os" "strings" "github.com/ktr0731/go-fuzzyfinder" "github.com/spf13/cobra" "k8s.io/apimachinery/pkg/api/meta" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/cli-runtime/pkg/genericclioptions" "k8s.io/client-go/discovery" _ "k8s.io/client-go/plugin/pkg/client/auth" cmdutil "k8...
package ctk import ( "unicode/utf8" "github.com/go-curses/cdk" cenums "github.com/go-curses/cdk/lib/enums" "github.com/go-curses/cdk/lib/paint" "github.com/go-curses/cdk/lib/ptypes" "github.com/go-curses/cdk/memphis" "github.com/go-curses/ctk/lib/enums" ) const TypeArrow cdk.CTypeTag = "ctk-arrow" func init(...
// Code generated by MockGen. DO NOT EDIT. // Source: github.com/m3db/m3db-operator/pkg/k8sops/m3db/types.go // Copyright (c) 2021 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 ...
// Copyright (c) 2016, 2018, 2021, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei...
/* Copyright 2017 Loopring Project Ltd (Loopring Foundation). Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable ...
// *** 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 v20200601 import ( "context" "reflect" "github.com/pkg/errors" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) type View struct { pulumi.CustomResourc...
package http import ( "context" "encoding/base64" "fmt" "io" "net" "net/http" "net/http/httputil" "strconv" "strings" "time" "github.com/lwch/proxy/addr" ) // ServerHandler server handler type ServerHandler interface { LogDebug(format string, a ...interface{}) LogError(format string, a ...interface{}) ...
/** 跳表实现(两层索引) */ package list_v2 import ( "fmt" "math" "math/rand" "strconv" "time" ) //跳表对象(有两层索引) type SkipList struct { SecondIndex linkedList //二级索引(顶层索引) FirstIndex linkedList //一级索引 List linkedList //数据链表 } //链表对象 type linkedList struct { Head *skipNode Tail *skipNode Length int Level...
/* Stack Messages The Stack message Composer implementations capture a full stacktrace information during message construction, and attach a message to that trace. The string form of the message includes the package and file name and line number of the last call site, while the Raw form of the message includes the ent...
// ------------------------------------------------------------ // Copyright (c) Microsoft Corporation and Dapr Contributors. // Licensed under the MIT License. // ------------------------------------------------------------ package main import ( "context" "encoding/json" "fmt" "log" "net" "sync" "google.gola...
// Copyright 2018 The Cockroach Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ag...
package tower import ( "context" "database/sql" "math" "sync" "github.com/lbryio/transcoder/tower/queue" ) type activeTask struct { id string workerID string restored bool retries int32 exPayload *MsgTranscodingTask payload chan MsgTranscodingTask progress chan MsgWorkerProgress errors ...
/* * Copyright 2021, Offchain 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 ag...
package list import ( "context" "fmt" "text/tabwriter" "time" "github.com/spf13/cobra" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/argoproj/argo-rollouts/pkg/apis/rollouts/v1alpha1" argoprojv1alpha1 "github.com/argoproj/argo-rollouts/pkg/client/clientset/versioned/typed/rollouts/v1alpha1" "git...
package gcp import ( "context" "fmt" "regexp" "github.com/kyma-incubator/hydroform/internal/errs" "cloud.google.com/go/container" "github.com/kyma-incubator/hydroform/internal/operator" "github.com/kyma-incubator/hydroform/types" "github.com/pkg/errors" "google.golang.org/api/option" "k8s.io/client-go/tool...
// Code generated from DGSParser.g4 by ANTLR 4.7.2. DO NOT EDIT. package dgs // DGSParser import "github.com/antlr/antlr4/runtime/Go/antlr" // BaseDGSParserListener is a complete listener for a parse tree produced by DGSParser. type BaseDGSParserListener struct{} var _ DGSParserListener = &BaseDGSParserListener{} /...
// Package addchain provides addition chain types and operations on them. package addchain import ( "errors" "fmt" "math/big" "github.com/mmcloughlin/addchain/internal/bigint" "github.com/mmcloughlin/addchain/internal/bigints" ) // References: // // [efficientcompaddchain] <NAME>., <NAME>. and <NAME>. Efficien...
package main import ( "fmt" "github.com/juju/fslock" "github.com/sirupsen/logrus" "github.com/spf13/viper" "gopkg.in/natefinch/lumberjack.v2" "log" "os" "os/exec" "runtime" "strings" "time" ) var ConfigV = viper.New() var DeviceFiles []string var LogGlobal = logrus.New() var LogConsole = logrus.New() func...
package reconciliation import ( "bytes" "crypto/sha256" "encoding/base64" "fmt" api "github.com/k8ssandra/cass-operator/apis/cassandra/v1beta1" "github.com/k8ssandra/cass-operator/pkg/internal/result" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v...
package apollo import ( "context" "encoding/json" "errors" "fmt" "net/http" "net/url" "sync" "time" "github.com/soyacen/easyhttp" easyhttpheader "github.com/soyacen/easyhttp/interceptor/header" easyhttprespbody "github.com/soyacen/easyhttp/interceptor/respbody" "github.com/soyacen/goutils/backoffutils" "...
// Copyright (c) 2017-2018 Zededa, Inc. // SPDX-License-Identifier: Apache-2.0 package upgradeconverter import ( "flag" "github.com/lf-edge/eve/pkg/pillar/base" "github.com/lf-edge/eve/pkg/pillar/pidfile" "github.com/lf-edge/eve/pkg/pillar/pubsub" "github.com/lf-edge/eve/pkg/pillar/types" "github.com/sirupsen/...
package sc // JPverb is a reverb effect from sc3-plugins. // See https://github.com/supercollider/sc3-plugins // and http://doc.sccode.org/Classes/JPverb.html type JPverb struct { // In is the input signal. In Input // T60 is time for the reverb to decay 60db. // Does not effect early reflections. (0.1..60) T60 ...
package htpasswd import ( "bytes" "io/ioutil" "net/http" "net/http/httptest" "os" "testing" "github.com/docker/distribution/context" "github.com/docker/distribution/registry/auth" ) func TestBasicAccessController(t *testing.T) { testRealm := "The-Shire" testUsers := []string{"bilbo", "frodo", "MiShil", "De...
package tile import ( "fmt" "strings" "github.com/unchartedsoftware/veldt/binning" "github.com/unchartedsoftware/veldt/geometry" "github.com/unchartedsoftware/veldt/util/json" ) const ( numDecimals = 2 ) // Bivariate represents the parameters required for any bivariate tile. type Bivariate struct { XField ...
package frozen import ( "fmt" "math/bits" "testing" ) func TestJoinSimple(t *testing.T) { t.Parallel() a := NewRelation( []interface{}{"x", "y"}, []interface{}{1, 2}, ) b := NewRelation( []interface{}{"y", "z"}, []interface{}{2, 3}, ) expected := NewRelation( []interface{}{"x", "y", "z"}, []inte...
// 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 ...
// Copyright (C) 2017 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 t...
// Copyright 2018 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 w...
// Copyright (c) 2015 Monetas. // Copyright 2016 <NAME>. // Use of this source code is governed by an ISC // license that can be found in the LICENSE file. package peer import ( "errors" "net" "sync" "time" "github.com/DanielKrawisz/maxrate" "github.com/DanielKrawisz/bmutil/wire" ) var errNoConnection = error...
package gof import ( "encoding/json" "fmt" "net/http" ) // MIME types const ( MIMEApplicationJSON = "application/json" MIMEApplicationJSONCharsetUTF8 = MIMEApplicationJSON + "; " + charsetUTF8 MIMEApplicationJavaScript = "application/javascript" MIMEApplicationJavaScriptCharse...
package statsd import ( "time" "github.com/spf13/pflag" "github.com/spf13/viper" "github.com/taosdata/driver-go/v2/common" ) type Config struct { Enable bool Port int DB string User string Password string Worker ...
// Copyright 2016 Andrew 'Diddymus' Rolfe. All rights reserved. // // Use of this source code is governed by the license in the LICENSE file // included with the source code. // Package frontend provides interactive processing of front end pages and // access to the backend game. Note that a 'page' can be anything fro...
package rubban import ( "context" "fmt" "os" "github.com/Masterminds/semver/v3" "github.com/sherifabdlnaby/rubban/config" "github.com/sherifabdlnaby/rubban/log" "github.com/sherifabdlnaby/rubban/rubban/autoindexpattern" "github.com/sherifabdlnaby/rubban/rubban/kibana" "github.com/sherifabdlnaby/rubban/rubban...
/* Copyright The containerd 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...