text stringlengths 3.08k 10.4k |
|---|
package main
import (
"crypto/md5"
"encoding/hex"
"fmt"
"io/ioutil"
"path"
"time"
"github.com/Songmu/prompter"
"github.com/lucsky/cuid"
"gopkg.in/yaml.v2"
)
type state struct {
here string
Nodes map[string]*Node
Rels map[string]*Rel
schema schema
}
type representable interface {
repr() string
}
... |
package aws
import (
"fmt"
"log"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/service/servicecatalog"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/hashicorp/terrafo... |
package handshake
import (
"crypto/rand"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"fmt"
"log"
"github.com/lucas-clemente/quic-go/fuzzing/internal/helper"
"github.com/lucas-clemente/quic-go/internal/handshake"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/ut... |
package main
import (
"fmt"
"io/ioutil"
"os"
"strings"
"github.com/pkg/errors"
"github.com/spf13/cobra"
yaml "gopkg.in/yaml.v1"
"k8s.io/helm/pkg/helm"
"k8s.io/helm/pkg/strvals"
"k8s.io/helm/pkg/tlsutil"
)
type cmdFlags struct {
cliValues []string
resetValues bool
valueFiles valueFiles
useTLS bo... |
// Copyright 2016-2018 <NAME>. 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 applicabl... |
// Copyright (c) 2021-present, Teamgram Studio (https://teamgram.io).
// All rights reserved.
//
// Author: teamgramio (<EMAIL>)
//
package bff_proxy_client
import (
"context"
"fmt"
"reflect"
"strings"
"time"
"github.com/teamgram/marmota/pkg/net/rpcx"
"github.com/teamgram/proto/mtproto"
"github.com/teamgra... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package servicediscovery
import (
"context"
"fmt"
"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/servicediscovery-2017-03-14/ListNamespacesRequest... |
package main
import (
"fmt"
"github.com/hajimehoshi/ebiten"
"github.com/hajimehoshi/ebiten/inpututil"
. "github.com/shnifer/magellan/commons"
. "github.com/shnifer/magellan/draw"
"github.com/shnifer/magellan/graph"
"github.com/shnifer/magellan/input"
. "github.com/shnifer/magellan/log"
"github.com/shnifer/mag... |
/*
* This file is part of the KubeVirt project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
package v1alpha1
import (
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// FlowState describes the global state of a Flow
type FlowState string
const (
// FlowStateUnknown represents an Unknown State of the Flow. When in this state, it might
// have never been reconciled.
FlowStateUnkn... |
package lib
import (
"fmt"
"github.com/astaxie/beego"
"github.com/ljt000/openvpn-manage/models"
"golang.org/x/text/encoding/simplifiedchinese"
"io"
"io/ioutil"
"os"
"os/exec"
"runtime"
"strings"
"time"
)
//Cert
//https://groups.google.com/d/msg/mailing.openssl.users/gMRbePiuwV0/wTASgPhuPzkJ
type Cert struc... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package sfn
import (
"context"
"fmt"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type CreateActivityInput struct {
_ struct{} `type:"structure"`
// The name of the activity to create. This na... |
package upcmd
import (
"errors"
"fmt"
"os"
"strings"
"github.com/martinnirtl/dockma/internal/commands/argvalidators"
"github.com/martinnirtl/dockma/internal/commands/envcmd"
"github.com/martinnirtl/dockma/internal/commands/hooks"
"github.com/martinnirtl/dockma/internal/config"
"github.com/martinnirtl/dockma/... |
package main
import (
"log"
"time"
//"strings"
"os"
"fmt"
"strconv"
zmq "github.com/pebbe/zmq4"
"github.com/hashicorp/consul/api"
"github.com/golang/protobuf/proto"
"./OpWire"
)
var (
dialTimeout = 2 * time.Second
requestTimeout = 10 * time.Second
)
func put(cli *api.Client, op *OpWire.Operation_Put, i... |
// user.go - version 0.4
// @Note
// - Definition of User Struct
// - Format: <Header> ... <Body> ... <Footer>
// <Header>: <Type>(<scope>): <subject>
// <Body>: ... anything ... could have many lines
// <Footer>: Close #12345
//
// - First we show menu to user;
// - Then we take us... |
/*
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this fi... |
package token
import (
"crypto/md5"
"crypto/sha1"
"encoding/hex"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"sort"
"strconv"
"strings"
"time"
"github.com/astaxie/beego"
"gopkg.in/redis.v5"
)
const TOKENKEY = "CLOUD:TOKEN:"
type AuthCodePayload struct {
UID string `json:"UID"`
AppID string `... |
package kubernetes
import (
"crypto/tls"
"encoding/json"
"fmt"
"github.com/golang/glog"
"io/ioutil"
"k8s.io/api/admission/v1beta1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/serializer"
"net/http"
"os"
)
var ... |
package server
import (
cEvent "eventrigger.com/operator/common/event"
"eventrigger.com/operator/common/k8s"
"fmt"
"github.com/pkg/errors"
"github.com/viney-shih/go-lock"
"go.uber.org/zap"
v1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/ap... |
/*
Copyright 2019 The Vitess 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... |
/*
* Tencent is pleased to support the open source community by making 蓝鲸 available.
* Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the Li... |
package main
import (
"fmt"
)
/*
A type determines the set of values and operations specific to values of that type.
Types may be named or unnamed.
Named types are specified by a(possibly qualified) type name
Unnamed types are specified using a type literal, which composes a new type from existing types.
*/
/* func... |
package gobustergcs
import (
"bufio"
"bytes"
"context"
"encoding/json"
"fmt"
"github.com/OJ/gobuster/v3/libgobuster"
"net/http"
"regexp"
"strings"
"text/tabwriter"
)
// GobusterGCS is the main type to implement the interface
type GobusterGCS struct {
opts *OptionsGCS
globalopts *libgobuster.Option... |
package zabbixsvc
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"strings"
"time"
"github.com/devopyio/zabbix-alertmanager/zabbixsender/zabbixsnd"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
log "github.com/sirups... |
// Copyright © 2019 <NAME> <<EMAIL>>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... |
package advanced_types
import (
"log"
"sort"
"testing"
"github.com/stretchr/testify/assert"
)
func TestDeclarationsAndInitializationsOfMaps(t *testing.T) {
t.Run("non-initialized map is nil", func(t *testing.T) {
var mapList map[string]int
assert.Nil(t, mapList)
})
t.Run("maps are referenced types", func... |
package keys
import (
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"crypto/sha256"
"crypto/x509"
"encoding/hex"
"fmt"
"math/big"
"github.com/btcsuite/btcd/btcec"
"github.com/nspcc-dev/neo-go/pkg/crypto/hash"
"github.com/nspcc-dev/neo-go/pkg/util"
"github.com/nspcc-dev/rfc6979"
)
// PrivateKey represent... |
// Copyright 2018 <NAME>.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.a... |
package client
import (
"bufio"
"context"
"errors"
"io"
"io/ioutil"
"github.com/LiveRamp/gazette/v2/pkg/broker/teststub"
pb "github.com/LiveRamp/gazette/v2/pkg/protocol"
gc "github.com/go-check/check"
)
type RetrySuite struct{}
func (s *RetrySuite) TestReaderRetries(c *gc.C) {
var ctx, cancel = context.Wit... |
package main
import (
"context"
"flag"
"fmt"
"github.com/hawtio/hawtio-operator/pkg/controller/hawtio"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/rest"
"os"
"runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/client/config"
"sigs.k8s.... |
package operands
import (
"errors"
"os"
"path/filepath"
"reflect"
"strings"
log "github.com/go-logr/logr"
imagev1 "github.com/openshift/api/image/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
hcov1beta1 "github.com/kubevirt/... |
package policy
import (
"go.aporeto.io/enforcerd/trireme-lib/common"
"go.aporeto.io/enforcerd/trireme-lib/controller/pkg/usertokens"
)
// ServiceType are the types of services that can are suported.
type ServiceType int
// Values of ServiceType
const (
ServiceL3 ServiceType = iota
ServiceHTTP
ServiceTCP
Servic... |
package service
import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"strings"
"time"
"crypto/md5"
"github.com/SubGame-Network/SubGameModuleService/domain"
"github.com/pkg/errors"
"github.com/shopspring/decimal"
"go.uber.org/zap"
)
type MarketInfo struct {... |
package main
import (
"fmt"
"os"
"os/exec"
"regexp"
"runtime"
"strconv"
"sync"
"github.com/axllent/ghru"
"github.com/spf13/pflag"
)
var (
quality int
maxWidth int
maxHeight int
outputDir string
preserveModTimes bool
jpegoptim string
jpegtran string
optip... |
/*
Copyright (C) 2019 Synopsys, Inc.
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
"... |
/*
* Tencent is pleased to support the open source community by making Blueking Container Service available.
* Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obta... |
// Copyright 2017 syzkaller project authors. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
package main
import (
"bytes"
"os"
"runtime"
"syscall"
"time"
"unsafe"
"github.com/google/syzkaller/pkg/log"
"github.com/google/syzkaller/prog"
... |
// Copyright 2020 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package polling
import (
"context"
"fmt"
"time"
appsv1 "k8s.io/api/apps/v1"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime/schema"
"sigs.k8s.io/cli-utils/pkg/kstatus/polling/aggregator"
"sigs.k8s.io/cli-util... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package sagemaker
import (
"context"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type ListMonitoringExecutionsInput struct {
_ struct{} `type:"structure"`
// A filter that returns only jobs cr... |
/*
Copyright 2020 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 2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"). You may not
// use this file except in compliance with the License. A copy of the
// License is located at
//
// http://aws.amazon.com/apache2.0/
//
// or in the "license" fil... |
package time
import (
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestTime(t *testing.T) {
t.Run("ParseTime() - unix no format", testParseTimeFunc("1605312000", "", time.Unix(1605312000, 0)))
t.Run("ParseTime() - rfc3339 no format", testParseTimeFunc("2009-01-01T12:59:59Z", "", time.Date(2009, ... |
package x509
import (
"encoding/json"
"errors"
"github.com/teamnsrg/zcrypto/encoding/asn1"
)
type QCStatementASN struct {
StatementID asn1.ObjectIdentifier
StatementInfo asn1.RawValue `asn1:"optional"`
}
func (s *QCStatementASN) MarshalJSON() ([]byte, error) {
aux := struct {
ID string `json:"id,omitem... |
/*
Copyright 2020 The Flux authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softwar... |
package main
import (
"database/sql"
"flag"
"fmt"
"net/http"
"os"
"strings"
"github.com/drone/config"
"github.com/drone/drone/server/middleware"
"github.com/drone/drone/server/pubsub"
"github.com/drone/drone/server/router"
"github.com/drone/drone/shared/build/log"
"github.com/GeertJohan/go.rice"
"code.... |
package sarama
import (
"hash"
"hash/fnv"
"math/rand"
"time"
)
// Partitioner is anything that, given a Kafka message and a number of partitions indexed [0...numPartitions-1],
// decides to which partition to send the message. RandomPartitioner, RoundRobinPartitioner and HashPartitioner are provided
// as simple ... |
package v1alpha2
import (
"fmt"
"github.com/openshift/library-go/pkg/image/reference"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// ImageSetConfiguration object kind.
const ImageSetConfigurationKind = "ImageSetConfiguration"
// ImageSetConfiguration configures image set creation.
type ImageSetConfiguration ... |
package pool
import (
"context"
"fmt"
"math/rand"
"testing"
"time"
"github.com/jolestar/go-commons-pool/v2/concurrent"
)
type BenchObject struct {
Num int32
}
func BenchmarkPoolBorrowReturn(b *testing.B) {
ctx := context.Background()
pool := NewObjectPoolWithDefaultConfig(ctx, NewPooledObjectFactorySimple(... |
// Copyright 2015 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 The Crossplane Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: xds/core/v3/authority.proto
package xds_core_v3
import (
fmt "fmt"
_ "github.com/cncf/xds/go/udpa/annotations"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppres... |
// Copyright 2017 clair 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... |
package jsonconfig
import (
"encoding/json"
"fmt"
"path"
"regexp"
"strings"
"github.com/davecgh/go-spew/spew"
log "github.com/sirupsen/logrus"
"github.com/twitter/scoot/ice"
)
// Schema holds the different Implementations's the client wants to configure
type Schema map[string]Implementations
// EmptySchema... |
// *** 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 batch
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Provides a Batch Job Definition resource.
//
// ##... |
package s3
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/s3/s3iface"
"github.com/pkg/errors"
"github.com/wal-g/wal-g/internal/storages/storage"
"io"
"strings"
)
const (
NotFoundAWSErrorCode = "NotFoun... |
// Copyright 2019-present Open Networking Foundation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applica... |
// Code generated by go-swagger; DO NOT EDIT.
package voucher
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/... |
// 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 ... |
/*
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
// Copyright (c) 2017 Cisco and/or its affiliates.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicabl... |
// *** 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 v20200320
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type PrivateCloud struct {
pulumi.Custo... |
/*
* Copyright (c) 2008-2021, Hazelcast, 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 b... |
/**
* Copyright 2021 uk
*
* 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 2018 Eryx <evorui аt gmail dοt com>, 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 re... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: service.proto
/*
Package example is a generated protocol buffer package.
It is generated from these files:
service.proto
It has these top-level messages:
Hat
Size
*/
package example
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import... |
package script
import (
"reflect"
"strings"
)
/* Byte code could be described as a tree where functions and contracts are on the top level and
nesting goes further according to nesting of bracketed. Tree nodes are structures of
'CodeBlock' type. For instance,
func a {
if b {
while d {
}
}
if c {
}
... |
package main
import (
"fmt"
"sync/atomic"
"time"
"github.com/huajiao-tv/qchat/client/gateway"
"github.com/huajiao-tv/qchat/logic"
)
var (
requestStat = newGatewayStat()
qpsData = newGatewayStat()
qpsCounterInterval = uint64(1)
)
func newGatewayStat() *gateway.GatewayStat {
stat := &gatewa... |
/*
* 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 writi... |
// *** 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 v20190101preview
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type MDATPDataConnector struct {
... |
package scheduler
import (
"sync"
"time"
"code.cloudfoundry.org/lager"
"github.com/concourse/atc"
"github.com/concourse/atc/config"
"github.com/concourse/atc/db"
"github.com/concourse/atc/db/algorithm"
"github.com/concourse/atc/scheduler/buildstarter"
"github.com/concourse/atc/scheduler/inputmapper"
)
type ... |
package farm
import (
"fmt"
"reflect"
"runtime"
"testing"
"github.com/soundcloud/roshi/common"
"github.com/soundcloud/roshi/instrumentation"
)
func TestAllRepairs(t *testing.T) {
// Build farm around mock clusters.
n := 5
clusters := newMockClusters(n)
farm := New(clusters, (n/2)+1, SendAllReadAll, NoRepai... |
// Copyright (c) 2020 IoTeX
// 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 of the cod... |
/*
* Copyright (c) 2018 Uber Technologies, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicabl... |
// Copyright 2015 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 main
import (
"bufio"
"encoding/csv"
"fmt"
"io/ioutil"
"os"
"strconv"
"strings"
"github.com/fatih/color"
"github.com/gosimple/slug"
)
var LANGS = map[string]string{
"golang": "Golang",
"go": "Golang",
"python": "Python",
"cpp": "CPP",
"java": "Java",
}
var EXTENSIONS = map[string]stri... |
package service
import (
"sort"
"strings"
"time"
"github.com/umputun/remark/backend/app/store"
)
// Tree is formatter making tree from the list of comments
type Tree struct {
Nodes []*Node `json:"comments"`
Info store.PostInfo `json:"info,omitempty"`
}
// Node is a comment with optional replies
type N... |
package commands
import (
"fmt"
"io"
"time"
"github.com/UpCloudLtd/upcloud-cli/internal/config"
"github.com/UpCloudLtd/upcloud-cli/internal/output"
"github.com/UpCloudLtd/upcloud-cli/internal/resolver"
internal "github.com/UpCloudLtd/upcloud-cli/internal/service"
"github.com/gemalto/flume"
)
var (
logger =... |
package tfresource
import (
"context"
"errors"
"math/rand"
"sync"
"time"
"github.com/hashicorp/aws-sdk-go-base/v2/awsv1shim/v2/tfawserr"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
)
// Retryable is a function that is used to decide if a function's error is retryable or not.
// The error ar... |
package main
import (
"context"
"flag"
"fmt"
"log"
"os"
"runtime"
"runtime/pprof"
"sync"
"sync/atomic"
"time"
"github.com/plgd-dev/go-coap/v2/net"
"github.com/plgd-dev/go-coap/v2/udp"
"github.com/plgd-dev/go-coap/v2/udp/client"
"github.com/plgd-dev/go-coap/v2/udp/message"
"github.com/plgd-dev/go-coap/v... |
package web
import (
"encoding/json"
"fmt"
"hahajing/com"
"hahajing/door"
"hahajing/kad"
"log"
"net"
"net/http"
"os"
"strings"
"text/template"
"time"
"golang.org/x/net/websocket"
)
const (
keywordCheckWaitingTime = 5
kadSearchWaitingTime = 15
)
// webError is for user browser.
type webError struct... |
package types
import (
"bytes"
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/params"
)
var (
// key for constant fee parameter
ParamStoreKeyIssueFee = []byte("IssueFee")
ParamStoreKeyMintFee = []byte("MintFee")
ParamStoreKeyFreezeFee = []byte("FreezeFe... |
package main
import (
"context"
"io/ioutil"
"os"
"strings"
"github.com/opentracing/opentracing-go"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
admin "google.golang.org/api/admin/directory/v1"
crmv1 "google.golang.org/api/cloudresourcemanager/v1"
iam "google.golang.org/api/iam/v1"
)
type GsuiteClient... |
package database
import (
"database/sql"
"encoding/json"
"errors"
"fmt"
"time"
"github.com/EricLagerg/pnwconference/cleanup"
"github.com/EricLagerg/pnwconference/helpers"
"github.com/garyburd/redigo/redis"
"github.com/golang/glog"
"github.com/gorilla/sessions"
_ "github.com/lib/pq"
)
const (
getUserStm... |
// Copyright (c) 2020 <NAME> <<EMAIL>>
//
// 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, publi... |
package services
import (
"crypto/sha256"
"fmt"
"github.com/bloXroute-Labs/gateway/types"
"github.com/struCoder/pidusage"
"math/rand"
"os"
"sync"
"testing"
"time"
)
type TestManager struct {
listTxHashes types.SHA256HashList
quit1 chan bool
quit2 chan bool
}
func generateSixHundredThousandT... |
// Copyright (c) 2016 <NAME>. All rights reserved.
// Use of this source code is governed by the MIT license
// that can be found in the LICENSE file.
package main
// HTTP server for accessing weather station data.
import (
"encoding/json"
"fmt"
"net"
"net/http"
//_ "net/http/pprof"
"strconv"
"time"
)
type h... |
// Code generated by protoc-gen-go.
// source: echo.proto
// DO NOT EDIT!
/*
Package echo is a generated protocol buffer package.
It is generated from these files:
echo.proto
It has these top-level messages:
Request
Response
*/
package echo
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import ... |
package redis
import (
"net"
"testing"
"time"
"github.com/gomodule/redigo/redis"
"github.com/rafaeljusto/redigomock"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/config"
"gitlab.com/gitlab-org/gitlab-workhorse/internal/helper"
)
func mockRedisServer(t *testing.T, co... |
package main
import (
"bytes"
"fmt"
"gioui.org/app"
"gioui.org/io/system"
"gioui.org/layout"
"gioui.org/unit"
"gioui.org/widget/material"
"github.com/ajstarks/svgo"
"github.com/gioapp/helpers"
"github.com/vdobler/chart"
"image/color"
)
var (
icsLogo, _ = material.NewIcon(pieChart())
)
//
// Pie Charts
//... |
package main
import (
"bufio"
"encoding/json"
"fmt"
"net"
"strings"
"time"
)
type Slots struct {
Slots []Slot `json:"slots"`
}
type Slot struct {
ID string `json:"id"`
Status string `json:"status"`
Description string `json:"description"`
Reason string `json:"reason"`
Idle bool ... |
package rotate
import (
"bufio"
"compress/gzip"
"fmt"
"github.com/bingoohuang/gg/pkg/timex"
"io"
"os"
"path/filepath"
"regexp"
"strconv"
"strings"
"time"
)
// bufWriter is a Writer interface that also has a Flush method.
type bufWriter interface {
io.Writer
io.Closer
Flush() error
}
type FileWriter str... |
// Copyright 2018 The ZikiChombo Authors. All rights reserved. Use of this source
// code is governed by a license that can be found in the License file.
package czt
import (
"fmt"
"math"
"math/cmplx"
"github.com/zikichombo/dsp/fft"
"github.com/zikichombo/sound/freq"
)
type T struct {
nS, nB, nPad int
s... |
package event
import (
"crypto/sha1"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"github.com/Cepave/open-falcon-backend/common/utils"
"time"
log "github.com/sirupsen/logrus"
)
type EventCases struct {
// uniuq
Id string `json:"id" orm:"pk"`
Endpoint string `json:"endpoint"`
Metric string `js... |
// Copyright 2019 <NAME>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writi... |
/*
Copyright 2020 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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, s... |
// 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.
package rpc
import (
"bufio";
"gob";
"http";
"io";
"log";
"net";
"os";
"sync";
)
// Call represents an active RPC.
type Call struct {
ServiceMethod s... |
/*
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 (
"encoding/json"
"flag"
"fmt"
"strings"
"time"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes"
pcounter "github.com/synerex/proto_pcounter"
storage "github.com/synerex/proto_storage"
api "github.com/synerex/synerex_api"
pbase "github.com/synerex/synerex_proto"
... |
package service
import (
"github.com/peter-mount/go-kernel/rest"
"github.com/peter-mount/nre-feeds/darwind3"
d3client "github.com/peter-mount/nre-feeds/darwind3/client"
"github.com/peter-mount/nre-feeds/darwinref"
refclient "github.com/peter-mount/nre-feeds/darwinref/client"
"time"
)
type ServiceResult struct {... |
package v4l2
/*
#include <linux/videodev2.h>
*/
import "C"
import (
"errors"
"fmt"
"unsafe"
)
// FmtDescFlag image format description flags
// https://elixir.bootlin.com/linux/latest/source/include/uapi/linux/videodev2.h#L794
// https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/vidioc-enum-fmt.html#f... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.