text stringlengths 5.51k 28.1k |
|---|
/*
Copyright 2021 The Alibaba Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, sof... |
/*
* Minio Cloud Storage, (C) 2018 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
/*
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... |
package migration_01_to_11
import (
"bytes"
"io"
"time"
"github.com/pkt-cash/pktd/btcutil/er"
"github.com/pkt-cash/pktd/btcutil/util"
"github.com/pkt-cash/pktd/lnd/channeldb/kvdb"
"github.com/pkt-cash/pktd/lnd/lntypes"
"github.com/pkt-cash/pktd/lnd/lnwire"
"github.com/pkt-cash/pktd/lnd/tlv"
"github.com/pkt-... |
/*
Copyright 2021 The KCP 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 validation
import (
"context"
"crypto"
"crypto/tls"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"os"
"regexp"
"sort"
"strings"
"github.com/coreos/go-oidc"
"github.com/dgrijalva/jwt-go"
"github.com/mbland/hmacauth"
"github.com/oauth2-proxy/oauth2-proxy/pkg/apis/options"
"github.com/oauth2-proxy/oaut... |
package controller
import (
"os"
"strings"
"time"
"foremast.ai/foremast/foremast-barrelman/pkg/apis/deployment/v1alpha1"
a "foremast.ai/foremast/foremast-barrelman/pkg/client/analyst"
m "foremast.ai/foremast/foremast-barrelman/pkg/client/metrics"
"github.com/golang/glog"
gocache "github.com/pmylund/go-cache"
... |
package main
import (
"context"
"encoding/json"
"fmt"
"math"
"net/http"
"regexp"
"strconv"
"time"
binance "github.com/adshao/go-binance"
"github.com/alpacahq/marketstore/v4/executor"
"github.com/alpacahq/marketstore/v4/planner"
"github.com/alpacahq/marketstore/v4/plugins/bgworker"
"github.com/alpacahq/m... |
package goeleven
/*
/(sign|encrypt|decrypt)/<slot label>/<key label/
Post data:
Data string `json:"data"`
Mech string `json:"mech"` // using pkscs11 names: signing: CKM_SHA1_RSA_PKCS, CKM_SHA256_RSA_PKCS, CKM_RSA_PKCS(prehashed) decrypting: CKM_RSA_PKCS_OAEP
Digest string `json:"digest" /... |
package model
import (
"encoding/json"
"fmt"
"sort"
"testing"
"time"
"github.com/evergreen-ci/evergreen/model/build"
"github.com/evergreen-ci/evergreen/model/task"
"github.com/evergreen-ci/evergreen"
"github.com/evergreen-ci/evergreen/db"
"github.com/evergreen-ci/evergreen/model/commitqueue"
"github.com/e... |
package vault
import (
"bytes"
"fmt"
"github.com/jenkins-x/jx/v2/pkg/util/json"
"k8s.io/apimachinery/pkg/types"
"github.com/banzaicloud/bank-vaults/operator/pkg/apis/vault/v1alpha1"
"github.com/banzaicloud/bank-vaults/operator/pkg/client/clientset/versioned"
vaultapi "github.com/hashicorp/vault/api"
"github.... |
package handlers
import (
"context"
"encoding/json"
"fmt"
"strconv"
"strings"
"time"
"github.com/containers/image/v5/manifest"
"github.com/containers/libpod/libpod"
"github.com/containers/libpod/libpod/define"
"github.com/containers/libpod/libpod/events"
libpodImage "github.com/containers/libpod/libpod/ima... |
package containerimage
import (
"bytes"
"context"
"encoding/json"
"fmt"
"strings"
"time"
"github.com/containerd/containerd/content"
"github.com/containerd/containerd/diff"
"github.com/containerd/containerd/images"
"github.com/containerd/containerd/platforms"
"github.com/moby/buildkit/cache"
"github.com/mo... |
// +build linux,!no_oci_worker
package main
import (
"context"
"os"
"os/exec"
"path/filepath"
"strconv"
"time"
fuseoverlayfs "github.com/AkihiroSuda/containerd-fuse-overlayfs"
"github.com/BurntSushi/toml"
snapshotsapi "github.com/containerd/containerd/api/services/snapshots/v1"
"github.com/containerd/conta... |
package transformer
import (
"fmt"
"strings"
"github.com/bblfsh/sdk/v3/uast"
"github.com/bblfsh/sdk/v3/uast/nodes"
"github.com/bblfsh/sdk/v3/uast/role"
)
// SavePosOffset makes an operation that describes a uast.Position object with Offset field set to a named variable.
func SavePosOffset(vr string) Op {
retur... |
// Copyright 2019 The gVisor 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... |
// Copyright 2019-present PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agr... |
package scanner
import (
"bufio"
"bytes"
"errors"
"fmt"
"io"
)
// Code heavily inspired by the influxdata/influxql repository
// https://github.com/influxdata/influxql/blob/57f403b00b124eb900835c0c944e9b60d848db5e/scanner.go#L12
// Scanner represents a lexical scanner for Genji.
type Scanner struct {
r *reader... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/ads/googleads/v3/errors/customer_manager_link_error.proto
package errors
import (
fmt "fmt"
math "math"
proto "github.com/catper/protobuf/proto"
_ "google.golang.org/genproto/googleapis/api/annotations"
)
// Reference imports to suppress errors ... |
package processing
import (
"fmt"
"sort"
"strconv"
"strings"
"sync"
"time"
"github.com/lbryio/chainquery/sockety"
"github.com/lbryio/chainquery/lbrycrd"
"github.com/lbryio/chainquery/metrics"
"github.com/lbryio/chainquery/model"
"github.com/lbryio/chainquery/twilio"
"github.com/lbryio/chainquery/util"
"... |
package lb
import (
"context"
"fmt"
"sort"
"strings"
"github.com/kubernetes-sigs/aws-alb-ingress-controller/internal/ingress/controller/config"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/aws/aws-sdk-go/service/elbv2"
"github.com/kubernetes-sigs/aws-alb-ingress-controller/internal/alb/ls"
"github.co... |
// Copyright 2018-2020 <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 ... |
package uvm
import (
"bytes"
"context"
"encoding/gob"
"fmt"
"os"
"path/filepath"
"strconv"
"unsafe"
"github.com/sirupsen/logrus"
"golang.org/x/sys/windows"
"github.com/Microsoft/hcsshim/internal/hcs/resourcepaths"
hcsschema "github.com/Microsoft/hcsshim/internal/hcs/schema2"
"github.com/Microsoft/hcsshi... |
/*
Copyright 2018-2019 Mailgun 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 applicable law or agreed to in writing... |
// Copyright 2017 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 main
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"os"
"sync"
"testing"
"github.com/bradfitz... |
package main
import (
"log"
"os"
"strconv"
"sync"
"time"
"github.com/tuneinsight/lattigo/v3/bfv"
"github.com/tuneinsight/lattigo/v3/dbfv"
"github.com/tuneinsight/lattigo/v3/drlwe"
"github.com/tuneinsight/lattigo/v3/rlwe"
"github.com/tuneinsight/lattigo/v3/utils"
)
func check(err error) {
if err != nil {
... |
package files_sdk
import (
"encoding/json"
"io"
"time"
)
type Site struct {
Name string `json:"name,omitempty"`
Allowed2faMethodSms *bool `json:"allowed_2fa_method_sms,omitempty"`
Allowed2faMethodTotp *bool `json:"allowed_2fa_method_tot... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/ads/googleads/v3/resources/ad_group_feed.proto
package resources
import (
fmt "fmt"
math "math"
proto "github.com/catper/protobuf/proto"
wrappers "github.com/catper/protobuf/ptypes/wrappers"
common "google.golang.org/genproto/googleapis/ads/goog... |
package heap
import "math"
/*
Ported to Go from http://code.google.com/p/graphmaker/source/browse/core/src/com/bluemarsh/graphmaker/core/util/FibonacciHeap.java
The contents of this file are subject to the terms of the Common Development
and Distribution License (the License). You may not use this file... |
package wasm
// DecodeModule parses the configured source into a wasm.Module. This function returns when the source is exhausted or
// an error occurs. The result can be initialized for use via Store.Instantiate.
//
// Here's a description of the return values:
// * result is the module parsed or nil on error
// * err... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package cloudformation
import (
"context"
"fmt"
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/cloudformation/types"
"github.com/awslabs/smithy-go/middleware"
smit... |
// Copyright 2017 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// +build !build_with_native_toolchain
package eth
import (
"context"
"fmt"
"math"
"reflect"
"sync"
"syscall/zx"
"unsafe"
"gen/netstack/link/eth... |
package server
// Copyright (c) 2013-2017 The btcsuite developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
import (
"context"
"errors"
"fmt"
"net"
"strconv"
"github.com/copernet/copernicus/conf"
"github.com/copernet/copernicus/errcode"
"github.com/cop... |
package tracing
import (
"context"
"errors"
"fmt"
"strconv"
"time"
sentry "github.com/getsentry/sentry-go"
opentracing "github.com/opentracing/opentracing-go"
otlog "github.com/opentracing/opentracing-go/log"
"github.com/reddit/baseplate.go/log"
)
var (
_ opentracing.SpanContext = (*Span)(nil)
_ opentrac... |
// Copyright 2020 gorse 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 agreed ... |
// Copyright 2019 Intel Corporation. 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 app... |
/*
Purpose of this hello101.go:
1. Examples of using control statements;
2. Examples of functions;
3. Simple show cases of using primitives and basic data structures;
https://golang.org/ref/spec
*/
package main
import (
"fmt"
"math"
"reflect"
//s "strings"
//"time"
"github.com/bradfitz/iter"
)
func main() {
... |
/*
* 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 Factom Foundation
// Use of this source code is governed by the MIT
// license that can be found in the LICENSE file.
package constants
import (
"fmt"
"time"
)
// Messages
const (
EOM_MSG byte = iota // 0
ACK_MSG // 1
unused1 ... |
package rpc
import (
"bytes"
"encoding/hex"
"fmt"
"math/big"
"github.com/copernet/copernicus/errcode"
"github.com/copernet/copernicus/log"
block2 "github.com/copernet/copernicus/logic/block"
"github.com/copernet/copernicus/logic/undo"
"github.com/copernet/copernicus/model/block"
"github.com/copernet/coperni... |
package devicemanager
import (
"container/list"
"fmt"
"strconv"
"strings"
"sync"
"time"
corev1 "k8s.io/api/core/v1"
"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/klog"
kubesharev1 "github... |
// Copyright 2018 The gVisor 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 maven
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestNewVersion(t *testing.T) {
tests := []struct {
vstr string
expected string
}{
{"1.0.0", "1"},
{"1.ga", "1"},
{"1.final", "1"},
{"1.0", "1"},
{"1.", "1"},
{"1-", "1"},
{"1.0.0-foo.0.0", "1-foo"},
{"1.0.0-0.0.0... |
// Copyright 2020 The Moov Authors
// Use of this source code is governed by an Apache License
// license that can be found in the LICENSE file.
package imagecashletter
import (
"encoding/json"
"fmt"
"strings"
"time"
"unicode/utf8"
)
// Errors specific to a CashLetterHeader Record
// CashLetterHeader Record is... |
// Copyright 2021 iLogtail 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 ... |
package alphabeta
import (
"fmt"
"math/rand"
"squava/src/movekeeper"
)
type board [5][5]int
// Semantically meaningful constant names
const (
WIN = 10000
LOSS = -10000
MAXIMIZER = 1
MINIMIZER = -1
UNSET = 0
)
// AlphaBeta exported to meet playoff5.go's Player interface
type AlphaBeta struct ... |
// Copyright 2014 <NAME> and Contributors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package fetchbot
import (
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
"strings"
"sync"
"time"
"github.com/temoto/robotstxt.g... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/type/datetime.proto
package datetime
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
duration "github.com/golang/protobuf/ptypes/duration"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = ... |
/*
Copyright 2021.
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
distributed un... |
// Copyright 2020 The GMC Author. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// More information at https://github.com/snail007/gmc
package ghttpserver
import (
"compress/gzip"
"context"
"crypto/tls"
"crypto/x509"
"encoding/base64"... |
package launcher_test
import (
"bytes"
"context"
"errors"
"fmt"
"io"
nethttp "net/http"
"strings"
"testing"
"time"
"github.com/influxdata/flux"
"github.com/influxdata/flux/execute"
"github.com/influxdata/flux/execute/executetest"
"github.com/influxdata/flux/lang"
"github.com/influxdata/flux/values"
"gi... |
//go:build ignore
// +build ignore
/*
* Copyright (c) 2021 The GoPlus Authors (goplus.org). 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.apa... |
// Copyright 2018 The Kubeflow 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 compose
import (
"context"
"errors"
"fmt"
"os"
"os/exec"
"os/signal"
"syscall"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/mutagen-io/mutagen/cmd"
"github.com/mutagen-io/mutagen/pkg/compose"
"github.com/mutagen-io/mutagen/pkg/docker"
)
// topLevelProjectFlagNames are the names... |
package logmux
import (
"bytes"
"crypto/tls"
"encoding/json"
"errors"
"fmt"
"net"
"net/http"
"net/url"
"os"
"path/filepath"
"strings"
"sync"
"text/template"
"time"
"github.com/boltdb/bolt"
ct "github.com/flynn/flynn/controller/types"
"github.com/flynn/flynn/discoverd/client"
"github.com/flynn/flynn/... |
// generated by stacks/gong/go/models/orm_file_per_struct_back_repo.go
package orm
import (
"database/sql"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"sort"
"time"
"gorm.io/gorm"
"github.com/tealeg/xlsx/v3"
"github.com/fullstack-lang/gonggooglecharts/go/models"
)
// dummy va... |
package server
import (
"context"
"crypto/tls"
"crypto/x509"
"html/template"
"io/ioutil"
"log"
"net"
"net/http"
"regexp"
noesctmpl "text/template"
"time"
"github.com/NYTimes/gziphandler"
"github.com/elazarl/go-bindata-assetfs"
"github.com/gorilla/websocket"
"github.com/pkg/errors"
"github.com/kost/tt... |
package node
import (
"encoding/binary"
"errors"
"github.com/harmony-one/harmony/p2p/host"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/rlp"
"github.com/harmony-one/bls/ffi/go/bls"
proto_node "github.com/harmony-one/harmony/api/proto/node"
"github.com/harmony-one/harmony/block"... |
package state
import (
"github.com/pkg/errors"
"github.com/diamondburned/arikawa/v3/discord"
"github.com/diamondburned/arikawa/v3/gateway"
"github.com/diamondburned/arikawa/v3/state/store"
)
func (s *State) hookSession() {
s.Session.AddSyncHandler(func(event interface{}) {
// Call the pre-handler before the s... |
package service_test
import (
"crypto/tls"
"encoding/json"
"fmt"
"io/ioutil"
"math/rand"
"net/http"
"net/url"
"os"
"strconv"
"strings"
"time"
"github.com/pborman/uuid"
"github.com/cloudfoundry-incubator/cf-test-helpers/cf"
"github.com/cloudfoundry-incubator/cf-test-helpers/runner"
"github.com/cloudfou... |
package model2d
import (
"math"
"sync"
"github.com/unixpickle/model3d/numerical"
)
// DefaultBezierMaxSplits determines the maximum number of
// subdivisions when computing Bezier arc lengths.
const DefaultBezierMaxSplits = 16
var binomialCoeffs = [][]float64{
{1, 1},
{1, 2, 1},
{1, 3, 3, 1},
{1, 4, 6, 4, 1}... |
// 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 systems
import (
"github.com/EngoEngine/ecs"
"github.com/EngoEngine/engo"
"github.com/EngoEngine/engo/common"
)
type JobSelectPauseMessage struct{}
func (JobSelectPauseMessage) Type() string {
return "Job Select Pause Message"
}
type JobSelectUnpauseMessage struct {
IDs []*ecs.BasicEntity
}
func (JobS... |
package cmdr
import (
"fmt"
"github.com/hedzr/cmdr"
"github.com/hedzr/cmdr/plugin/pprof"
"github.com/hedzr/cmdr/tool"
"golang.org/x/crypto/ssh/terminal"
"io/ioutil"
"os"
"os/exec"
)
// Entry is real main entry for this app
func Entry() {
// logrus.SetLevel(logrus.DebugLevel)
// logrus.SetFormatter(&logrus.T... |
package forest
// This is implementation of the scapegoat tree in Go.
//
// FIXME: not finished yet!
import (
"fmt"
"math"
)
/* NOTE: Node is defined in <bintree.go>; no need to duplicate... */
// The default value of Alpha factor
const defAlpha float64 = 0.667
// helper function that calculates node size: this ... |
// Copyright 2020-2021 the Pinniped contributors. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package authorizationcode
import (
"context"
"crypto/ed25519"
"crypto/x509"
"encoding/json"
"fmt"
"math/rand"
"net/url"
"strings"
"testing"
"time"
fuzz "github.com/google/gofuzz"
"github.com/ory/... |
package router
import (
"encoding/binary"
"encoding/gob"
"fmt"
"log"
"net"
"sync"
"time"
)
type Connection interface {
Local() *Peer
Remote() *Peer
RemoteTCPAddr() string
Outbound() bool
Established() bool
BreakTie(Connection) ConnectionTieBreak
Shutdown(error)
Log(args ...interface{})
}
type Connecti... |
// Copyright Suneido Software Corp. All rights reserved.
// Governed by the MIT license found in the LICENSE file.
// Package ixbuf defines an ordered list ixbuf.T
// with a mutating Insert and a immutable persistent Merge.
// It is designed for intermediate numbers of values, e.g. up to 16k or so.
// It is used mutab... |
/*
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 bactract
// Read/parse the bacpac model.xml file and extract the information
// needed for parsing the BCP data files.
import (
"encoding/json"
"encoding/xml"
"io/ioutil"
"os"
"strings"
//
"golang.org/x/net/html/charset"
)
/*
Annotation []struct {
Text string `xml:",chardata"`
Type ... |
// Package openidconnect implements auth via OIDC.
package openidconnect
import (
"encoding/base64"
"encoding/json"
"fmt"
"net/http"
"strings"
"time"
"github.com/gorilla/csrf"
"github.com/inconshreveable/log15"
"golang.org/x/oauth2"
"github.com/sourcegraph/sourcegraph/cmd/frontend/auth"
"github.com/source... |
// cluster builds on the launch package and implements launching Metropolis
// nodes and clusters in a virtualized environment using qemu. It's kept in a
// separate package as it depends on a Metropolis node image, which might not be
// required for some use of the launch library.
package cluster
import (
"bytes"
"... |
// Copyright 2020 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... |
// +build int
package main
import (
"sync"
"testing"
"github.com/alicebob/miniredis/v2"
)
func TestSubscribe(t *testing.T) {
testCommands(t,
fail("SUBSCRIBE"),
succ("SUBSCRIBE", "foo"),
succ("UNSUBSCRIBE"),
succ("SUBSCRIBE", "foo"),
succ("UNSUBSCRIBE", "foo"),
succ("SUBSCRIBE", "foo", "bar"),
s... |
// Copyright 2017 The LUCI 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.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.17.0
// source: go.chromium.org/lu... |
package service
import (
"database/sql"
"errors"
"gorm.io/gorm"
"pep/constant"
"pep/global"
"pep/model"
"pep/model/request"
"pep/model/response"
"strconv"
"strings"
"time"
)
func GetUserCreditsInfo(username int64) (selected int, have int, cancel int, err error) {
var u model.SysUser
err = global.GVA_DB.S... |
// Copyright the Hyperledger Fabric contributors. All rights reserved.
//
// SPDX-License-Identifier: Apache-2.0
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.13.0
// source: ledger/queryresult/kv_query_result.proto
package queryresult
import (
proto "g... |
/*
* Copyright 2017 Workiva
* 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, s... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.19.1
// source: admin_error.proto
package v1
import (
_ "github.com/go-kratos/kratos/v2/errors"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/p... |
// Copyright (c) 2018, The GoKi 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 gi
import (
"image"
"log"
"sync"
"github.com/goki/gi/gist"
"github.com/goki/ki/ki"
"github.com/goki/ki/kit"
"github.com/goki/mat32"
)
/... |
/*
Package mft provides functions to parse records and their attributes in an NTFS Master File Table ("MFT" for short).
Basic usage
First parse a record using mft.ParseRecord(), which parses the record header and the attribute headers. Then parse
each attribute's data individually using the various mft.Parse...()... |
/*
Copyright 2019 Cisco Systems
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
d... |
package main
import (
"bytes"
"context"
"crypto/x509"
"encoding/pem"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"time"
"github.com/jmhodges/clock"
"github.com/letsencrypt/boulder/cmd"
"github.com/letsencrypt/boulder/core"
"github.com/letsencrypt/boulder/features"
"github.com/letsencrypt/boulder/go... |
package commands
import (
"errors"
)
const (
fmtCmdAutheliaShort = "authelia %s"
fmtCmdAutheliaLong = `authelia %s
An open-source authentication and authorization server providing
two-factor authentication and single sign-on (SSO) for your
applications via a web portal.
Documentation is available at: https://ww... |
package tlsaudit
import (
"encoding/json"
"fmt"
"io/ioutil"
"math/rand"
"net"
"net/http"
"os"
"path/filepath"
"sort"
"strconv"
"strings"
"sync"
"time"
"github.com/adedayo/cidr"
"github.com/mitchellh/go-homedir"
tlsmodel "github.com/adedayo/tlsaudit/pkg/model"
"github.com/carlescere/scheduler"
"gith... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/ads/googleads/v3/enums/education_placeholder_field.proto
package enums
import (
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
_ "google.golang.org/genproto/googleapis/api/annotations"
)
// Reference imports to suppress errors if... |
package cli
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strconv"
"strings"
"github.com/evergreen-ci/baobab"
"github.com/mongodb/grip"
"github.com/mongodb/grip/level"
"github.com/mongodb/grip/message"
"github.com/mongodb/grip/send"
"github.com/mongodb/jasper/options"
"github.com/pkg/errors"
"github.... |
package common
import (
"encoding/json"
"reflect"
"testing"
"github.com/stretchr/testify/assert"
"github.com/romberli/go-util/constant"
)
type nestStruct struct {
ID int
slice []string
}
type trimStruct struct {
ID int
Name string `middleware:"name"`
B bool
s string
NSA *nestStruct
NSB *n... |
package gazelle
import (
"context"
"fmt"
"os"
"path/filepath"
"sort"
"strings"
"unicode"
"github.com/bazel-contrib/rules_jvm/java/gazelle/javaconfig"
"github.com/bazel-contrib/rules_jvm/java/gazelle/private/java"
"github.com/bazel-contrib/rules_jvm/java/gazelle/private/javaparser"
"github.com/bazel-contrib... |
package language
type Language string
const (
Abaza Language = "Abaza"
Abenaki Language = "Abenaki"
Abkhaz Language = "Abkhaz"
Adyghe Language = "Adyghe"
Afar Language = "Afar"
Afrikaans Language = "Afrikaans"
Ainu Language = "Ainu"
Akan ... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc (unknown)
// source: protobuf/proto/discountcalculator/discont_calculator.proto
package discountcalculator
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/prot... |
package set
import (
"fmt"
"reflect"
"github.com/nofeaturesonlybugs/errors"
)
// V returns a new Value.
//
// Memory is possibly created when calling this function:
// // No memory is created because b is a local variable and we pass its address.
// var b bool
// v := set.V(&b)
//
// // No memory is created becau... |
package algorithms
import (
"crypto/elliptic"
"testing"
"github.com/stretchr/testify/require"
)
// generated by: $ openssl ecparam -name prime256v1 -genkey -noout -outform PEM -out ecdsa256.key
var testEC256PrivateKey = `
-----<KEY>
-----END EC PRIVATE KEY-----`
// generated by: $ openssl ec -in ./ecdsa256.key -... |
/*
schema package Copyright 2020 <NAME>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at:
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
sof... |
/*
Copyright 2019 Cisco Systems
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
d... |
package main
import (
"bufio"
"errors"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"os/signal"
"path"
"runtime/pprof"
"strconv"
"sync"
"time"
)
const (
argInput = "input"
argMapper = "mapper"
argMappers = "mappers"
argMemoryString = "memory"
argOutput = "output"
argProfile ... |
// Copyright 2021-2022 Zenauth Ltd.
// SPDX-License-Identifier: Apache-2.0
package index
import (
"context"
"errors"
"fmt"
"io"
"io/fs"
"path/filepath"
"sort"
"sync"
"go.opencensus.io/stats"
"go.uber.org/zap"
"golang.org/x/sync/singleflight"
policyv1 "github.com/cerbos/cerbos/api/genpb/cerbos/policy/v1"... |
package jwt
import (
"context"
"net/http"
"time"
"github.com/lestrrat-go/backoff/v2"
"github.com/lestrrat-go/jwx/jwa"
"github.com/lestrrat-go/jwx/jwe"
"github.com/lestrrat-go/jwx/jwk"
"github.com/lestrrat-go/jwx/jws"
"github.com/lestrrat-go/option"
)
type Option = option.Interface
// GlobalOption describes... |
package main
import (
"bytes"
"context"
"encoding/csv"
"encoding/json"
"errors"
"fmt"
"log"
"math"
"net/http"
"net/url"
"os"
"reflect"
"sort"
"strings"
"time"
"github.com/ourrootsorg/cms-server/stdtext"
"github.com/ourrootsorg/cms-server/utils"
"github.com/ourrootsorg/cms-server/stdplace"
"githu... |
// Copyright 2020 The gVisor 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.