text stringlengths 3.08k 10.4k |
|---|
// Copyright 2022 The CubeFS 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 agree... |
package patriciaaccumulator
import (
"fmt"
logrus "github.com/sirupsen/logrus"
)
// verifyBatchProof takes a block proof and reconstructs / verifies it.
// takes a blockproof to verify, list of leafHashes at the targets, and the state root to check against.
// it returns a bool of whether the proof worked
func ver... |
// A GIN middleware providing low-fi security for sites with simple needs.
//
// Redirects users to a login page until they provide a secret code.
// No CSRF protection, so any js on the web can log you
// out (or in, if they know the password).
//
// Protects you from brute-force attacks by making all login attempts
/... |
package cake
import (
"compress/gzip"
"compress/zlib"
"context"
"fmt"
"io"
"net/http"
"reflect"
"strings"
)
var _emptyValue reflect.Value
var _nilError = reflect.Zero(reflect.TypeOf((*error)(nil)).Elem())
type requestTemplate struct {
ctx context.Context
url string
body io.Reader
header http.Head... |
/*
* Copyright 2018 Primas Lab 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 law o... |
package awssm
// Use this code snippet in your app.
// If you need more information about configurations or implementing the sample code, visit the AWS docs:
// https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/setting-up.html
import (
"encoding/base64"
"fmt"
"os"
"github.com/aws/aws-sdk-go/service/ssm"
... |
/*
Copyright 2019 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, ... |
/*
Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
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 ... |
package session
import (
"errors"
"fmt"
"io"
)
// Start is the APDU magic number.
const start byte = 0x68
var (
errStart = errors.New("part5: APDU start mismatch")
errLength = errors.New("part5: APDU length out of range")
)
// APDU (Application Protocol Data Unit) is a transport layer datagram.
// The first 6... |
package consensus
import (
"context"
"crypto/ed25519"
"crypto/x509"
"fmt"
"net"
"strconv"
"go.etcd.io/etcd/clientv3"
"source.monogon.dev/metropolis/node"
"source.monogon.dev/metropolis/node/core/consensus/client"
"source.monogon.dev/metropolis/node/core/identity"
"source.monogon.dev/metropolis/pkg/event"
... |
package breaker
import (
"math"
"math/rand"
"testing"
"time"
metric2 "github.com/1024casts/snake/pkg/metric"
"github.com/stretchr/testify/assert"
xtime "github.com/1024casts/snake/pkg/time"
)
func getSRE() Breaker {
return NewGroup(&Config{
Window: xtime.Duration(1 * time.Second),
Bucket: 10,
Reque... |
// Copyright 2016 The Prometheus 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... |
// Copyright 2020 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Package arcappcompat will have tast tests for android apps on Chromebooks.
package arcappcompat
import (
"context"
"time"
"chromiumos/tast/loca... |
// Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
package ghttp
import (
"context"
"fmt"
"github.com/g... |
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build ignore
package main
// This program generates tables.go:
// go run maketables.go | gofmt > tables.go
import (
"bufio"
"fmt"
"log"
"net/http"
"... |
package aws
import (
"fmt"
"github.com/infracost/infracost/internal/schema"
"github.com/shopspring/decimal"
)
func GetEBSVolumeRegistryItem() *schema.RegistryItem {
return &schema.RegistryItem{
Name: "aws_ebs_volume",
RFunc: NewEBSVolume,
}
}
func NewEBSVolume(d *schema.ResourceData, u *schema.UsageData)... |
package locks
// Copyright (c) Microsoft and contributors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unles... |
// Copyright 2015 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.
package engine
import (
"fmt"
"strings"
"github.com/keybase/client/go/libkb"
keybase1 "github.com/keybase/client/go/protocol/keybase1"
)
type CryptocurrencyEngine struct {
libkb.Contextified... |
package typecover
import (
"fmt"
"go/ast"
"go/types"
"regexp"
"strconv"
"strings"
"golang.org/x/tools/go/analysis"
"golang.org/x/tools/go/analysis/passes/inspect"
)
const Doc = `typecover checks that a code block is assigning to all exported fields of a struct or calling all exported methods of an interface.... |
// Copyright 2019 The Kanister 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 2019 Pusher Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... |
package mongodbx
import (
"context"
"errors"
"reflect"
"sort"
"time"
"github.com/tal-tech/go-zero/core/logx"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo/options"
"go.mongodb.org/mongo-driver/x/mongo/driver/connstring"
table2 "github.com/tal-tech/cds/tools/table"
)
func ToClickhou... |
package lblock
import (
"bytes"
"testing"
"github.com/copernet/copernicus/model/block"
"github.com/copernet/copernicus/model/blockindex"
"github.com/copernet/copernicus/model/chain"
"github.com/copernet/copernicus/util"
)
// mainNetGenesisHash is the hash of the first block in the block chain for the
// main n... |
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2018 Datadog, Inc.
package integration
import (
"fmt"
"hash/fnv"
"regexp"
"strconv"
yaml "gop... |
package name
import (
"errors"
"fmt"
"io"
"time"
cmdenv "github.com/TRON-US/go-btfs/core/commands/cmdenv"
cmds "github.com/TRON-US/go-btfs-cmds"
iface "github.com/TRON-US/interface-go-btfs-core"
options "github.com/TRON-US/interface-go-btfs-core/options"
path "github.com/TRON-US/interface-go-btfs-core/path"... |
package cmd
import (
"fmt"
"io"
"github.com/spf13/cobra"
"github.com/openshift/origin/pkg/cmd/util/clientcmd"
)
func NewCmdGet(fullName string, f *clientcmd.Factory, out io.Writer) *cobra.Command {
cmd := f.NewCmdGet(out)
longDesc := `Display one or many resources.
Possible resources include builds, buildCon... |
package processor
import (
"context"
"errors"
"fmt"
"github.com/benthosdev/benthos/v4/internal/bloblang/field"
"github.com/benthosdev/benthos/v4/internal/component"
"github.com/benthosdev/benthos/v4/internal/component/cache"
"github.com/benthosdev/benthos/v4/internal/component/metrics"
"github.com/benthosdev/... |
/*
Copyright 2016 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 OpenTelemetry 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... |
/*
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... |
package schema
import (
"context"
"errors"
"fmt"
"sync"
"github.com/hashicorp/go-multierror"
"github.com/hashicorp/terraform/config"
"github.com/hashicorp/terraform/terraform"
)
// Provisioner represents a resource provisioner in Terraform and properly
// implements all of the ResourceProvisione... |
package logs
import (
"fmt"
"io"
"os"
"strings"
"sync"
"time"
"github.com/containers/podman/v2/libpod/logs/reversereader"
"github.com/hpcloud/tail"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
const (
// LogTimeFormat is the time format used in the log.
// It is a modified version of RFC3339Nan... |
package main
import (
"crypto/sha256"
"encoding/hex"
"errors"
"fmt"
"io/ioutil"
"log"
"mime"
"net/http"
"os"
"path/filepath"
"strconv"
"sync"
"time"
)
// 断点续传
// refer:https://mp.weixin.qq.com/s/dt5emM2IsJ3DKmL502Zm8A
func parseFileInfoFrom(resp *http.Response) string {
contentDisposition := resp.Header... |
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.
package netflow
import (
"fmt"
"io/ioutil"
"math"
"os"
"strconv"
"github.com... |
// Copyright 2019 Istio Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
package cmd
import (
"fmt"
"log"
"github.com/OJ/gobuster/v3/cli"
"github.com/OJ/gobuster/v3/gobusterdir"
"github.com/OJ/gobuster/v3/helper"
"github.com/OJ/gobuster/v3/libgobuster"
"github.com/spf13/cobra"
)
var cmdDir *cobra.Command
func runDir(cmd *cobra.Command, args []string) error {
globalopts, pluginop... |
package crd
import (
"context"
"fmt"
"strings"
"sync"
"time"
"github.com/rancher/norman/store/proxy"
"github.com/rancher/norman/types"
"github.com/rancher/norman/types/convert"
"github.com/sirupsen/logrus"
apiext "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
"k8s.io/apiextensions-apiserve... |
package views
import (
"fmt"
"strings"
"github.com/derailed/k9s/internal/k8s"
"github.com/derailed/k9s/internal/resource"
"github.com/gdamore/tcell"
"github.com/rs/zerolog/log"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const containerFmt = "[fg:bg:b]%s([hilite:bg:b]%s[fg:bg:-])"
type podView struct {
... |
package push
import (
"errors"
"fmt"
"strings"
"time"
"github.com/lfq7413/tomato/config"
"github.com/lfq7413/tomato/errs"
"github.com/lfq7413/tomato/rest"
"github.com/lfq7413/tomato/types"
"github.com/lfq7413/tomato/utils"
)
var adapter pushAdapter
var queue *pushQueue
var worker *pushWorker
// init 初始化推送模... |
// Copyright 2012, Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package tabletserver
import (
"fmt"
"html/template"
"net/http"
"sort"
"time"
log "github.com/golang/glog"
"github.com/youtube/vitess/go/acl"
"github.com/... |
// Copyright (c) 2013-2016 The btcsuite developers
// Copyright (c) 2018 The metasv developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package merkleblock
import (
"github.com/metasv/bsvd/blockchain"
"github.com/metasv/bsvd/chaincfg/chainhash"
"github.com/... |
// Copyright 2019 Istio Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
package crypto
import (
"crypto/sha256"
"crypto/cipher"
"crypto/aes"
"crypto/hmac"
"crypto/subtle"
"encoding/base64"
"hash"
"fmt"
"errors"
"time"
"bytes"
"strconv"
)
// HMACEncoder is an encoder that can verify and optionally encrypt message
type HMACEncoder struct {
hashKey []byte
blockKey []byte
has... |
// Copyright Fuzamei Corp. 2018 All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package executor
import (
"testing"
"github.com/33cn/chain33/types"
pty "github.com/33cn/plugin/plugin/dapp/trade/types"
)
//----------------------------- d... |
package ackhandler
import (
"time"
"github.com/lucas-clemente/quic-go/internal/congestion"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/utils"
"github.com/lucas-clemente/quic-go/internal/wire"
)
type receivedPacketTracker struct {
largestObserved ... |
// Copyright 2017 Pilosa Corp.
//
// 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) 2013 Zhen, LLC. http://zhen.io. All rights reserved.
// Use of this source code is governed by the Apache 2.0 license.
package bytebuffer
import (
"encoding/binary"
"fmt"
"github.com/reducedb/ringbuffer"
"log"
//"math"
"sync"
)
var _ = log.Ldate
const (
// Number of overhead bytes for each d... |
package aws
import (
"context"
"github.com/turbot/go-kit/types"
"github.com/turbot/steampipe-plugin-sdk/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/plugin"
"github.com/turbot/steampipe-plugin-sdk/plugin/transform"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)
ty... |
package life
import (
"bytes"
"compress/flate"
"encoding/base64"
"encoding/gob"
"fmt"
"github.com/enescakir/emoji"
"github.com/maxence-charriere/go-app/v8/pkg/app"
"net/url"
"strings"
"time"
)
type Life struct {
app.Compo
generation int64
dx int
dy int
colony *[][]bool
ticker *... |
// Copyright 2020 <NAME> <<EMAIL>>. All rights reserved.
// Use of this source code is governed by Apache License 2.0 that
// can be found in the LICENSE file.
package generator
import (
"errors"
"os"
"path"
"path/filepath"
"sync"
"text/template"
"github.com/alimy/mir/v2/core"
"github.com/alimy/mir/v2/intern... |
package gosundheit
import (
"fmt"
"sync"
"time"
"github.com/pkg/errors"
)
// Health is the API for registering / deregistering health checks, and for fetching the health checks results.
type Health interface {
// RegisterCheck registers a health check according to the given configuration.
// Once RegisterCheck... |
// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the Lice... |
// Copyright 2016-2019, Pulumi 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 2019 PlanetScale 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, softwar... |
package ocischema
import (
"bytes"
"encoding/json"
"reflect"
"testing"
"github.com/sequix/distribution"
"github.com/sequix/distribution/manifest"
"github.com/opencontainers/image-spec/specs-go/v1"
)
var expectedManifestSerialization = []byte(`{
"schemaVersion": 2,
"mediaType": "application/vnd.oci.image... |
// The MIT License
//
// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved.
//
// Copyright (c) 2020 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Soft... |
package encoding
import (
"encoding/binary"
"errors"
"fmt"
"io"
"google.golang.org/protobuf/encoding/protowire"
"google.golang.org/protobuf/proto"
"github.com/mutagen-io/mutagen/pkg/stream"
)
const (
// protobufEncoderInitialBufferSize is the initial buffer size for encoders.
protobufEncoderInitialBufferSi... |
// Copyright (c) 2018 The Ecosystem Authors
// Distributed under the MIT software license, see the accompanying
// file COPYING or or or http://www.opensource.org/licenses/mit-license.php
package core
import (
"math/big"
"reflect"
"testing"
"github.com/davecgh/go-spew/spew"
"github.com/ecosystem/go-ecosystem/c... |
package testmocks
import (
"time"
"github.com/teleclimber/DropServer/cmd/ds-host/domain"
"github.com/teleclimber/DropServer/internal/nulltypes"
)
//go:generate mockgen -destination=models_mocks.go -package=testmocks -self_package=github.com/teleclimber/DropServer/cmd/ds-host/testmocks github.com/teleclimber/DropS... |
// Copyright (c) The Thanos Authors.
// Licensed under the Apache License 2.0.
package receive
import (
"context"
"errors"
"fmt"
"sort"
"sync"
"github.com/cespare/xxhash"
"github.com/prometheus/prometheus/prompb"
)
const sep = '\xff'
// insufficientNodesError is returned when a hashring does not
// have eno... |
package v1alpha1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
configv1 "github.com/sjenning/api/config/v1"
)
type ManagementState string
const (
// Managed means that the operator is actively managing its resources and trying to keep the component active
Managed ManagementState = "Managed"
// Unmanag... |
/*
Copyright 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 to in writing, software
dis... |
package slack
import (
"context"
"fmt"
"github.com/oklahomer/go-kasumi/logger"
"github.com/oklahomer/go-kasumi/retry"
"github.com/oklahomer/go-sarah/v4"
"github.com/oklahomer/golack/v2/event"
"github.com/oklahomer/golack/v2/rtmapi"
"strings"
"time"
)
const pingSignalChannelID = "ping"
type rtmAPIAdapter str... |
// Copyright (c) 2021 Wireleap
package relay
import (
"context"
"crypto/tls"
"fmt"
"io"
"log"
"net"
"net/http"
"os"
"time"
"github.com/wireleap/common/api/sharetoken"
"github.com/wireleap/common/api/status"
"github.com/wireleap/common/wlnet"
"github.com/wireleap/common/wlnet/flushwriter"
"github.com/wi... |
package params
import (
"errors"
"fmt"
"strconv"
"strings"
"github.com/mimuret/golang-iij-dpf/pkg/api"
"github.com/mimuret/golang-iij-dpf/pkg/apis"
)
var (
groupMap = NewGroupMap()
)
type GroupMap struct {
groupMap map[string]APISetSlice
cmdMap map[string]*APISet
}
func NewGroupMap() *GroupMap {
return... |
// Copyright 2015 go-swagger maintainers
//
// 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 dns
import (
"bytes"
"ddns-go/config"
"ddns-go/util"
"encoding/json"
"fmt"
"log"
"net/http"
"strconv"
"time"
)
const (
huaweicloudEndpoint string = "https://dns.myhuaweicloud.com"
)
// https://support.huaweicloud.com/api-dns/dns_api_64001.html
// Huaweicloud Huaweicloud
type Huaweicloud struct {
D... |
// 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... |
package resolver
import (
"context"
"errors"
"log"
"strconv"
"time"
graphql "github.com/graph-gophers/graphql-go"
"github.com/mmcdole/gofeed"
"github.com/rendom/gopodcast/model"
"github.com/rendom/gopodcast/service"
)
type podcastResolver struct {
p *model.Podcast
EpisodeService *service.Epis... |
package raftkv
import (
"labgob"
"labrpc"
"log"
"raft"
"sync"
"time"
)
const Debug = 0
var kvOnce sync.Once
func DPrintf(format string, a ...interface{}) (n int, err error) {
if Debug > 0 {
log.Printf(format, a...)
}
return
}
type PutAppendCommand struct {
AppendCh chan (bool)
Req PutAppendArgs
}... |
package partas
import (
"context"
"fmt"
"sort"
"github.com/spf13/cobra"
"github.com/twmb/franz-go/pkg/kerr"
"github.com/twmb/franz-go/pkg/kmsg"
"github.com/twmb/kcl/client"
"github.com/twmb/kcl/flagutil"
"github.com/twmb/kcl/out"
)
func Command(cl *client.Client) *cobra.Command {
cmd := &cobra.Command{
U... |
// *** 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 sqlvirtualmachine
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// A SQL virtual machine group.
... |
/*
* 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 ... |
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
// Package status defines metadata for errors returned by fabric-sdk-go. This
// information may be used by SDK users to make decisions about how to handle
// certain error conditions.
// Status codes are divided by g... |
// Copyright 2016 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 snaps
import (
"bufio"
"flag"
"fmt"
"io/ioutil"
"os"
"path/filepath"
)
// Clean runs checks for identifying obsolete snapshots and prints a Test Summary.
//
// Should be called in a TestMain
// func TestMain(t *testing.M) {
// v := t.Run()
//
// // After all tests have run `go-snaps` can check for ... |
// Copyright 2020 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Package c2e2etest contains constants and utilities for the prebuilt android test APK.
package c2e2etest
import (
"context"
"encoding/json"
"fmt"... |
package porter
import (
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"strings"
"testing"
instancestorage "get.porter.sh/porter/pkg/instance-storage"
"get.porter.sh/porter/pkg/manifest"
buildprovider "get.porter.sh/porter/pkg/build/provider"
"get.porter.sh/porter/pkg/cache"
cnabprovider "get.porter.sh/porte... |
package grammar
import (
"fmt"
"io"
)
type ActionType string
const (
ActionTypeShift = ActionType("shift")
ActionTypeReduce = ActionType("reduce")
ActionTypeError = ActionType("error")
)
type actionEntry int16
const actionEntryEmpty = actionEntry(0)
func newShiftActionEntry(state StateNum) actionEntry {
r... |
package server
import (
"fmt"
"net/http"
)
const OAuthTemplate = `
<!DOCTYPE html>
<html>
<style type="text/css">
body {
width: 100%;
height: 100%;
font-family: Alright Sans LP, Avenir Next, Helvetica Neue, Helvetica, Arial, PingFang SC, Source Han Sans SC, Hiragino Sans GB, Microsoft YaHei, WenQuanYi Micro... |
package sobel
import (
"image"
"image/color"
"image/draw"
"math"
"go.skia.org/infra/gold-client/go/imgmatching/fuzzy"
)
// testMatcher is an exact copy of the imgmatching.Matcher interface for the sole purpose of
// avoiding an import cycle between packages imgmatching and sobel.
type testMatcher interface {
M... |
package serverstats
//go:generate sqlboiler --no-hooks psql
import (
"context"
"database/sql"
"github.com/jonas747/discordgo"
"github.com/jonas747/yagpdb/bot/botrest"
"github.com/jonas747/yagpdb/common"
"github.com/jonas747/yagpdb/serverstats/models"
"github.com/mediocregopher/radix.v3"
log "github.com/sirups... |
package isteam_user
import (
"strings"
steam "github.com/luanruisong/g-steam"
)
const (
UserServerName = "ISteamUser"
)
type (
ISteamUser interface {
GetFriendList(steamId string, relationship string) ([]SteamFriend, error)
GetPlayerBans(steamIds ...string) ([]PlayerBans, error)
GetPlayerSummaries(steamId... |
package hkcam
import (
"fmt"
"github.com/brutella/hc/accessory"
"github.com/brutella/hc/characteristic"
"github.com/brutella/hc/log"
"github.com/brutella/hc/rtp"
"github.com/brutella/hc/service"
"github.com/brutella/hc/tlv8"
"net"
"reflect"
"strings"
"github.com/brutella/hkcam/ffmpeg"
)
// SetupFFMPEGStre... |
// Copyright 2019 Dolthub, 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 i... |
/*
Copyright 2021 The Ceph-COSI 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, so... |
package main
import (
"flag"
"fmt"
"os"
"strings"
"sync"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
)
var usageStr = `
Usage: %s [options]
Options:
-p, --pattern search pattern
-g, --group search specific l... |
// Copyright 2014 <NAME>.
// This software is licensed under the MIT license, see LICENSE.txt for details.
// Package tai64 implements conversion from the TAI64 and TAI64N formats. See
// http://cr.yp.to/daemontools/tai64n.html and
// http://cr.yp.to/libtai/tai64.html for more information on these formats.
package tai... |
// Copyright 2022 The Okteto 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 ... |
// Copyright 2018 <NAME> (<EMAIL>)
// and <NAME> (github.com/pschou)
//
// 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
/... |
// Copyright (C) 2020, 2021, Oracle and/or its affiliates.
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
package constants
import (
"time"
corev1 "k8s.io/api/core/v1"
)
// DefaultImagePullPolicy default pull policy for images
const DefaultImagePullPolicy... |
package def
import (
"errors"
)
// login error
var (
ErrStartLogin = errors.New("start login error")
ErrShutdownLogin = errors.New("shutdown login error")
ErrHandleLogin = errors.New("handle login error")
)
// logic error
var (
ErrStartLogic = errors.New("start logic error")
ErrShutdownLogic = errors.Ne... |
package http
import (
"context"
"fmt"
"net/http"
"path"
"github.com/influxdata/httprouter"
"github.com/influxdata/influxdb/v2"
"github.com/influxdata/influxdb/v2/kit/platform"
"github.com/influxdata/influxdb/v2/kit/platform/errors"
"github.com/influxdata/influxdb/v2/kit/tracing"
"github.com/influxdata/influ... |
// Copyright 2015 The go-ethereum Authors
// Copyright 2017 The cypherBFT Authors
// This file is part of the cypherBFT library.
//
// The cypherBFT library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundat... |
package service
import (
"context"
"flag"
"math/rand"
"testing"
"time"
"go-common/app/job/main/figure-timer/conf"
"go-common/app/job/main/figure-timer/dao/mock_dao"
"go-common/app/job/main/figure-timer/model"
"go-common/library/log"
"github.com/golang/mock/gomock"
. "github.com/smartystreets/goconvey/conv... |
package client
import (
discovery "github.com/liqotech/liqo/apis/discovery/v1alpha1"
sharing "github.com/liqotech/liqo/apis/sharing/v1alpha1"
discovery2 "github.com/liqotech/liqo/pkg/discovery"
)
//createForeignClusterController creates a new CRDController for the Liqo ForeignCluster CRD.
func createForeignCluster... |
package gatekeeper
import (
"context"
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"time"
"go.etcd.io/etcd/client"
"github.com/gliderlabs/ssh"
"github.com/rs/zerolog/log"
gossh "golang.org/x/crypto/ssh"
"github.com/Xide/rssh/pkg/utils"
)
// Gate represent the me... |
package p2p
import (
"fmt"
cmn "github.com/tendermint/tmlibs/common"
"strings"
)
const (
maxNodeInfoSize = 10240 // 10Kb
maxNumChannels = 16 // plenty of room for upgrades, for now
)
// Max size of the NodeInfo struct
func MaxNodeInfoSize() int {
return maxNodeInfoSize
}
// NodeInfo is the basic node info... |
// 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... |
package controller
import (
"bytes"
"crypto/md5"
"encoding/hex"
"encoding/json"
"fmt"
"io"
"github.com/golang/glog"
batch "k8s.io/api/batch/v1"
batchv2 "k8s.io/api/batch/v2alpha1"
api "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.