text stringlengths 10 1.05M |
|---|
package models
import (
"errors"
"strings"
"time"
"github.com/PuerkitoBio/goquery"
log "github.com/gophish/gophish/logger"
)
// Page contains the fields used for a Page model
type Page struct {
Id int64 `json:"id" gorm:"column:id; primary_key:yes"`
UserId int64 `json:"-" go... |
/*
* 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 2018 Dell 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/licen... |
package bird
import (
"time"
"github.com/lindsaygelle/nook"
"github.com/lindsaygelle/nook/animal"
"github.com/lindsaygelle/nook/character"
"github.com/lindsaygelle/nook/gender"
"github.com/lindsaygelle/nook/personality"
"golang.org/x/text/language"
)
var (
shoukichiBirthday = nook.Birthday{
Day: 0,
Mon... |
/*
Copyright 2021 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... |
// +build !
/*
Piraeus Operator
Copyright 2019 LINBIT USA, LLC.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or ag... |
package main
import "testing"
type args struct {
s string
t string
}
var tests = []struct {
name string
args args
want bool
}{
{"test ok", args{"egg", "add"}, true},
{"test fail", args{"foo", "tar"}, false},
{"test ok", args{"paper", "title"}, true},
{"test ok", args{"ab", "aa"}, false},
{"test ok", args{"... |
package testdata
import (
"fmt"
"strings"
"github.com/dbaumgarten/yodk/pkg/number"
"github.com/dbaumgarten/yodk/pkg/vm"
)
var TestProgram = `:testsum = (1 + 2) == 3
:testsub = (3 - 1) == 2
:testmul = 2*5 == 10
:testdiv = 20 / 10 == 2
:testmod = 11 % 10 == 1
counter=0
counter++
if counter < 20 then goto 7 end
:te... |
package cmd
import (
"io"
"os"
"github.com/giantswarm/microerror"
"github.com/giantswarm/micrologger"
"github.com/spf13/cobra"
"github.com/giantswarm/crsync/cmd/sync"
)
const (
name = "crsync"
description = "CLI tool to sync images between registries"
)
type Config struct {
Logger micrologger.Logge... |
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
package transport
import (
"context"
"crypto/tls"
"net"
"reflect"
"sync"
"github.com/rsocket/rsocket-go"
"github.com/rsocket/rsocket-go/core/transport"
"github.com/rsocket/rsocket-go/payload"
)
type RSocketServer struct {
IsReady chan struct{}
dispatcher *Dispatcher
ConnMgr *ConnManager
}
func (rs ... |
package v3_test
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/extensions/table"
. "github.com/onsi/gomega"
core_xds "github.com/kumahq/kuma/pkg/core/xds"
. "github.com/kumahq/kuma/pkg/xds/envoy/listeners"
util_proto "github.com/kumahq/kuma/pkg/util/proto"
envoy_common "github.com/kumahq/kuma/... |
package metrics
import (
"fmt"
"github.com/caos/boom/internal/bundle/application/applications/prometheus/servicemonitor"
"github.com/caos/boom/internal/bundle/application/applications/prometheusnodeexporter/info"
"github.com/caos/boom/internal/labels"
)
func getLocalServiceMonitor(appName string, monitorMatching... |
package common
import (
"github.com/gin-gonic/gin"
"net/http"
)
const (
SuccessCode = 2000 //成功的状态码
FailCode = 2003 //失败的状态码
MD5_PREFIX = "jkfldfsf" //MD5加密前缀字符串
TOKEN_KEY = "X-Token" //页面token键名
USER_ID_Key = "X-USERID" //页面用户ID键名
USER_UUID... |
// 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 applicable law... |
// Copyright 2020 IBM Corp.
// SPDX-License-Identifier: Apache-2.0
package utils
import (
"io/ioutil"
"os"
"strings"
"github.com/hashicorp/vault/api"
)
// Attributes that are defined in a config map or the runtime environment
const (
CatalogConnectorServiceAddressKey string = "CATALOG_CONNECTOR_URL"
Credent... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
// Package marketplacecatalog provides the client and types for making API
// requests to AWS Marketplace Catalog.
//
// Catalog API actions allow you to manage your entities through list, describe,
// and update capabilities. An entity can be a prod... |
package serverinterceptors
import (
"context"
"runtime/debug"
"gitlab.deepwisdomai.com/infra/go-zero/core/logx"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
// StreamCrashInterceptor catches panics in processing stream requests and recovers.
func StreamCrashIntercep... |
package main
import (
"fmt"
"io/ioutil"
"os"
"strconv"
"strings"
)
func main() {
fmt.Println("Day 12: Rain Risk\n=====================")
navigationInstructions := readNavInstructions("RawData.txt")
fmt.Printf("Read instructions: %v\n", navigationInstructions)
fmt.Println("\nPart 1: Manhattan distance to ta... |
package pdftk
import (
"context"
"errors"
"fmt"
"os"
"github.com/gotenberg/gotenberg/v7/pkg/gotenberg"
"go.uber.org/zap"
)
func init() {
gotenberg.MustRegisterModule(PDFtk{})
}
// PDFtk abstracts the CLI tool PDFtk and implements the gotenberg.PDFEngine
// interface.
type PDFtk struct {
binPath string
}
//... |
package main
import (
"sync"
)
func main() {
tourists := make(chan tourist)
wg := sync.WaitGroup{}
go pcPool(tourists)
for i := 0; i < 20; i++ {
wg.Add(1)
tourists <- tourist{uint(i), &wg}
}
wg.Wait()
}
func pcPool(personPool chan tourist) {
personBuffer := make(chan tourist, 8)
for i := 0; i < 8; i+... |
package parser_test
import (
"fmt"
"strings"
"testing"
"github.com/goccy/go-yaml/ast"
"github.com/goccy/go-yaml/lexer"
"github.com/goccy/go-yaml/parser"
"github.com/goccy/go-yaml/printer"
)
func TestParser(t *testing.T) {
sources := []string{
"null\n",
"{}\n",
"v: hi\n",
"v: \"true\"\n",
"v: \"fals... |
// Copyright ©2016 The Gonum 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 moreland
import (
"image/color"
"math"
"strings"
"testing"
"math/rand"
"github.com/gopherd/plot/palette"
)
// bitTolerance is the precisio... |
package tpl
func MainTemplate() []byte {
return []byte(`/*
{{ .Copyright }}
{{ if .Legal.Header }}{{ .Legal.Header }}{{ end }}
*/
package main
import "{{ .PkgName }}/cmd"
func main() {
cmd.Execute()
}
`)
}
func RootTemplate() []byte {
return []byte(`/*
{{ .Copyright }}
{{ if .Legal.Header }}{{ .Legal.Header }}{{... |
package integration
import (
msg_parser "github.com/kaifei-bianjie/msg-parser"
"github.com/stretchr/testify/suite"
"testing"
)
type IntegrationTestSuite struct {
msg_parser.MsgClient
suite.Suite
}
type SubTest struct {
testName string
testCase func(s IntegrationTestSuite)
}
func TestSuite(t *testing.T) {
su... |
// SPDX-License-Identifier: Apache-2.0
// Copyright 2016-2021 Authors of Cilium
// Ensure build fails on versions of Go that are not supported by Cilium.
// This build tag should be kept in sync with the version specified in go.mod.
//go:build go1.17
// +build go1.17
package main
import (
"context"
"fmt"
"net"
"... |
package core
import (
"time"
cfg "github.com/ColorPlatform/prism/config"
"github.com/ColorPlatform/prism/consensus"
"github.com/ColorPlatform/prism/crypto"
dbm "github.com/ColorPlatform/prism/libs/db"
"github.com/ColorPlatform/prism/libs/log"
mempl "github.com/ColorPlatform/prism/mempool"
"github.com/ColorPla... |
// (c) 2019-2020, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package constants
import (
"fmt"
"strconv"
"strings"
"github.com/ava-labs/avalanchego/ids"
)
// Const variables to be exported
const (
MainnetID uint32 = 1
CascadeID uint32 = 2
DenaliID uint32 = 3
EverestID u... |
// Code generated by go-swagger; DO NOT EDIT.
package clubs
// 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/go... |
package codebuild
import (
"github.com/awslabs/goformation/v3/cloudformation/policies"
)
// Project_ProjectSourceVersion AWS CloudFormation Resource (AWS::CodeBuild::Project.ProjectSourceVersion)
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-codebuild-project-projectsourceversi... |
// Copyright 2012-2014 Oliver Eilhard. All rights reserved.
// Use of this source code is governed by a MIT-license.
// See http://olivere.mit-license.org/license.txt for details.
package elastic
// AvgAggregation is a single-value metrics aggregation that computes
// the average of numeric values that are extracted ... |
package tasks
import (
"fmt"
"os"
"strings"
printer "github.com/KablamoOSS/go-cli-printer"
)
func checkError(err error) {
if err != nil {
if strings.Contains(err.Error(), "No updates are to be performed") {
printer.Warn(
fmt.Errorf("No updates are to be performed"), "", "")
os.Exit(0)
} else if st... |
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V. licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// Code generated, DO NOT EDIT
package elasticsearch_test
import (
"fmt"
"os"
"strings"
"testing"
"git... |
package conn
import (
"github.com/golang/glog"
"google.golang.org/grpc"
)
// GRPCClient implements Client using gRPC.
type GRPCClient struct {
id uint32
}
// NewGRPCClient returns a new client with the given node ID.
func NewGRPCClient(id uint32) Client {
return &GRPCClient{id: id}
}
func (c *GRPCClient) Dial(a... |
package common
// Target is the interface with the commands for system and docker
type Target interface {
Recover(item string) (string, error)
Kill(item string) (string, error)
} |
package main
import (
"net/http"
"fmt"
"html"
"log"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, %q", html.EscapeString(r.URL.Path))
})
log.Fatal(http.ListenAndServe(":8080", nil))
} |
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
/*
Copyright 2021 Wim Henderickx.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software... |
package provider
import (
"github.com/get-bridge/terraform-provider-spinnaker/client"
)
type canaryConfigMetrics []*canaryConfigMetric
type canaryConfigMetric struct {
// AnalysisConfigurations interface `mapstructure:"analysis_configurations"`
Name string `mapstructure:"name"`
Query ... |
package cgroups
import (
"bufio"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strconv"
"strings"
"github.com/square/p2/pkg/util"
)
var DefaultCgexec = "/bin/cgexec"
// maps cgroup subsystems to their respective paths
type Subsystems struct {
CPU string
Memory string
}
var Default Subsystems = Subsystems{
... |
// Copyright (c) 2018 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 2019, 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 ag... |
package middleware
type Middleware interface {
} |
// Code generated by counterfeiter. DO NOT EDIT.
package dbfakes
import (
"sync"
"github.com/concourse/atc/db"
)
type FakeWorkerLifecycle struct {
StallUnresponsiveWorkersStub func() ([]string, error)
stallUnresponsiveWorkersMutex sync.RWMutex
stallUnresponsiveWorkersArgsForCall []struct{}
stallUn... |
// Copyright (c) 2004-present Facebook All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package resolver
import (
"sort"
"testing"
"github.com/facebookincubator/symphony/graph/ent"
"github.com/facebookincubator/symphony/graph/ent/equipme... |
// Copyright 2020 Coinbase, 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... |
package core
import (
"net/http"
"golang.org/x/net/http2"
"crypto/tls"
)
var publicHttp2Tr = &http2.Transport{
TLSClientConfig: &tls.Config{InsecureSkipVerify: true},
}
func NewHttp2Client() *http.Client {
//tr := publicHttp2Tr
httpClient := new(http.Client)
//httpClient.Transport = tr
return httpClient
}
... |
package jiracmd
import (
"fmt"
"strings"
"github.com/coryb/figtree"
"github.com/coryb/oreo"
"github.com/jhannah/jira"
"github.com/jhannah/jira/jiracli"
"github.com/jhannah/jira/jiradata"
"gopkg.in/AlecAivazis/survey.v1"
kingpin "gopkg.in/alecthomas/kingpin.v2"
)
type EditOptions struct {
jiracli.CommonOpti... |
package emr
//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
//distribut... |
// Copyright 2012 Gary Burd
//
// 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 wr... |
package azure
import (
"context"
"fmt"
"sort"
"strings"
"github.com/Azure/go-autorest/autorest/to"
"github.com/openshift/installer/pkg/types/azure"
"github.com/pkg/errors"
survey "gopkg.in/AlecAivazis/survey.v1"
)
const (
defaultRegion string = "eastus"
)
// Platform collects azure-specific configuration... |
package filehelper
import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"os"
csvmap "github.com/recursionpharma/go-csv-map"
"github.com/shoobyban/mxj"
"github.com/shoobyban/slog"
)
// ParserFunc is to parse a []byte into an interface{}
type ParserFunc func([]byte) (interface{}, error)
// Parser is the main type
type... |
// Copyright © 2018 Kent Gibson <warthog618@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
package charset
var (
portugueseDecoder Decoder
portugueseExtDecoder = Decoder{
0x05: 'ê',
0x09: 'ç',
0x0a: '\f',
0x0b: 'Ô',
0x0c: 'ô',
0... |
package authmanager
import (
"bufio"
"fmt"
"os"
"strings"
"syscall"
"github.com/preslavmihaylov/todocheck/authmanager/authstore"
"github.com/preslavmihaylov/todocheck/common"
"github.com/preslavmihaylov/todocheck/config"
"golang.org/x/crypto/ssh/terminal"
)
const (
githubAPITokenMsg = "Please go to https:... |
package loop
import (
"time"
"github.com/btcsuite/btcutil"
"github.com/lightninglabs/loop/loopdb"
"github.com/lightninglabs/loop/swap"
"github.com/lightningnetwork/lnd/lntypes"
"github.com/lightningnetwork/lnd/routing/route"
)
// OutRequest contains the required parameters for a loop out swap.
type OutRequest ... |
package build
import (
"fmt"
"sync/atomic"
"time"
"k8s.io/klog"
"k8s.io/kubernetes/pkg/api/legacyscheme"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/util/wait"
watchapi "k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go... |
package conditions
import (
"fmt"
"reflect"
"strings"
shipper "github.com/bookingcom/shipper/pkg/apis/shipper/v1alpha1"
)
func CondStr(ci interface{}) string {
if ci == nil || reflect.ValueOf(ci).IsNil() {
return ""
}
var chunks []string
switch c := ci.(type) {
case *shipper.ApplicationCondition:
chunks... |
//Package ansi reference https://github.com/sindresorhus/ansi-escapes
package ansi
import (
"fmt"
)
const csi = "\x1b["
const sep = ";"
//CursorLeft move cursor to the left side
var CursorLeft = fmt.Sprintf("%sG", csi)
//EraseDown Erase the screen from the current line down to the bottom of the
var EraseDown = fm... |
package menu
import (
"gopkg.in/chanxuehong/wechat.v2/mp/core"
)
// 获取自定义菜单配置接口.
func GetMenuInfo(clt *core.Client) (info MenuInfo, isMenuOpen bool, err error) {
const incompleteURL = "https://api.weixin.qq.com/cgi-bin/get_current_selfmenu_info?access_token="
var result struct {
core.Error
IsMenuOpen int ... |
package logging
import (
"github.com/sirupsen/logrus"
"testing"
)
func TestLoggers(t *testing.T) {
Init("logs", "debug", 0)
CLog().Debugf("format debug clog msg [%s]", "test clog msg")
CLog().WithFields(logrus.Fields{"name": "clog_test", "type": "clog"}).Debugf("format debug clog msg [%s]", "test clog msg")
V... |
package main
import (
"crypto/tls"
"errors"
"log"
"net/http"
"net/url"
"sync"
"sync/atomic"
"time"
)
var success int32
var fail int32
var total int32
var clientNum = 5000
var wg = sync.WaitGroup{}
var client = &http.Client{}
var start time.Time
func main() {
u := "http://127.0.0.1:30110/v1/default/kie/kv?la... |
package operators
import (
"encoding/json"
"fmt"
"github.com/emqx/kuiper/common"
"github.com/emqx/kuiper/xsql"
"github.com/emqx/kuiper/xstream/contexts"
"reflect"
"strings"
"testing"
)
func TestMiscFunc_Apply1(t *testing.T) {
var tests = []struct {
sql string
data *xsql.Tuple
result []map[string]i... |
package data
import (
"context"
"strings"
"github.com/avast/retry-go"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
)
//go:generate mockery --name=Gatherer --outpkg=mocks --case=underscore
// Gatherer gathers data from the Kubernetes cluster.
type Gatherer ... |
package peer
import (
"github.com/hedianbin/godcoin/protocol"
"github.com/hedianbin/godcoin/util/hashx"
)
// Peer extends the node to maintain state shared by the server
type Peer struct {
node *Node
boardcastQueue chan *RequestInfo
singleQueue chan *RequestInfo
receiveQueue chan *Request
messageHandler Messag... |
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
package trace
import (
"testing"
)
func TestHintCode(t *testing.T) {
if hc := MakeHintCode(""); !hc.IsEmpty() || hc.IsUltron() {
t.Fatalf("invalid hint code. [hc:%#v]", hc)
}
if hc := MakeHintCode("0"); !hc.IsEmpty() || hc.IsUltron() {
t.Fatalf("invalid hint code. [hc:%#v]", hc)
}
if hc := MakeHintCode("1... |
package migrations
import (
. "github.com/grafana/grafana/pkg/services/sqlstore/migrator"
)
func addUserAuthTokenMigrations(mg *Migrator) {
userAuthTokenV1 := Table{
Name: "user_auth_token",
Columns: []*Column{
{Name: "id", Type: DB_BigInt, IsPrimaryKey: true, IsAutoIncrement: true},
{Name: "user_id", Typ... |
// ----------------------------------------------------------------------------
//
// This file is copied here by Magic Modules. The code for building up a
// storage bucket object is copied from the manually implemented
// provider file:
// third_party/terraform/resources/resource_storage_bucket.go
//
... |
package auth
import "errors"
// ErrNotAuthenticated indicates a request without authentication
var ErrNotAuthenticated = errors.New("not authenticated") |
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the cod... |
package client
const (
DynamicSchemaSpecType = "dynamicSchemaSpec"
DynamicSchemaSpecFieldCollectionActions = "collectionActions"
DynamicSchemaSpecFieldCollectionFields = "collectionFields"
DynamicSchemaSpecFieldCollectionFilters = "collectionFilters"
DynamicSchemaSpecFieldCollectionMethods = "c... |
package jsonx
import (
"bytes"
"encoding/json"
"regexp"
"strings"
)
var re1 = regexp.MustCompile(`"(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})[^"]+"`)
func MapFrom(arg0 interface{}) map[string]interface{} {
var buf []byte
if _buf, ok := arg0.([]byte); ok && len(_buf) > 0 {
buf = _buf
} else if s1, ok := arg0.(... |
package types
import (
"github.com/Ontology/common"
"math/big"
)
func ConvertBigIntegerToBytes(data *big.Int) []byte {
if data.Int64() == 0 {
return []byte{}
}
bs := data.Bytes()
b := bs[0]
if data.Sign() < 0 {
for i, b := range bs {
bs[i] = ^b
}
temp := big.NewInt(0)
temp.SetBytes(bs)
temp2 :=... |
/*
*
* Copyright 2018 gRPC 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... |
// *** 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 v20190801
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Information about the connection monitor.
func LookupConnectionMonitor(ctx *pulumi.Co... |
package a
import (
"b"
"b/bsub"
)
func afunc() {
}
func main() {
b.Func() // want `b\.Func must not be called`
_ = b.Func // OK
f := b.Func // OK
f() // want `b\.Func must not be called`
new(b.Type).Method() // want `\(\*b\.Type\)\.Method must not be called`
_ = new(b.Type).Method ... |
package keys
import (
"bufio"
"bytes"
"errors"
"fmt"
"sort"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/input"
"github.com/cosmos/cosmos-sdk/crypto/keys"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/cosmos/go-... |
// Copyright 2012 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 race,linux,amd64 race,freebsd,amd64 race,darwin,amd64 race,windows,amd64 race,linux,ppc64le
package race
// This file merely ensures that we link in... |
// Copyright 2016-2018, 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... |
package scs
import (
"context"
"errors"
"fmt"
"io/ioutil"
"net/http"
"net/http/cookiejar"
"net/http/httptest"
"reflect"
"sort"
"strconv"
"strings"
"testing"
"time"
)
type testServer struct {
*httptest.Server
}
func newTestServer(t *testing.T, h http.Handler) *testServer {
ts := httptest.NewTLSServer(h... |
package uadmin
import (
"os"
"testing"
"time"
)
type TestModelA struct {
Model
Name string
}
type TestModelB struct {
Model
Name string `uadmin:"help:This is a test help message;search;list_exclude"`
ItemCount int `uadmin:"max:5;min:1;format:%03d;required;read_only:true,edit"`
Phone ... |
package krpc
type CompactIPv4NodeAddrs []NodeAddr
func (CompactIPv4NodeAddrs) ElemSize() int { return 6 }
func (me CompactIPv4NodeAddrs) MarshalBinary() ([]byte, error) {
return marshalBinarySlice(me)
}
func (me CompactIPv4NodeAddrs) MarshalBencode() ([]byte, error) {
return bencodeBytesResult(me.MarshalBinary())... |
// Code generated by mockery v2.4.0. DO NOT EDIT.
package mocks
import (
big "math/big"
bind "github.com/ethereum/go-ethereum/accounts/abi/bind"
common "github.com/ethereum/go-ethereum/common"
event "github.com/ethereum/go-ethereum/event"
flux_aggregator_wrapper "github.com/SeerLink/seerlink/core/internal/get... |
/*
Copyright 2015 Gravitational, 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, soft... |
/*
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, ... |
// run
package main
import (
"fmt"
)
func init() {
fmt.Print("init1!")
}
var A = F()
func F() int {
fmt.Print("F!")
return 42
}
func main() {
fmt.Print("main!")
} |
package request
import (
"bytes"
"net/http"
"net/http/httputil"
"strings"
"github.com/andig/evcc/util"
)
type roundTripper struct {
log *util.Logger
transport http.RoundTripper
}
const max = 2048
// NewTripper creates a logging roundtrip handler
func NewTripper(log *util.Logger, transport http.RoundTr... |
//
// Copyright (c) 2018
// Mainflux
//
// SPDX-License-Identifier: Apache-2.0
//
package postgres_test
import (
"fmt"
"strconv"
"testing"
"github.com/mainflux/mainflux/bootstrap"
"github.com/mainflux/mainflux/bootstrap/postgres"
uuid "github.com/satori/go.uuid"
"github.com/stretchr/testify/assert"
"github.c... |
package sessions
import (
"context"
"log"
"math/rand"
"net/http"
"time"
)
// Session is the interface read and write Store. A bit like `sync.Map`.
type Session interface {
// Delete a key from Store.
Delete(key string)
// Load returns the value stored in the Store for a key,
// or nil if no value is present... |
// Copyright 2019-present Facebook Inc. All rights reserved.
// This source code is licensed under the Apache 2.0 license found
// in the LICENSE file in the root directory of this source tree.
package load
import (
"encoding/json"
"math"
"testing"
"time"
"github.com/facebook/ent"
"github.com/facebook/ent/sche... |
// Code generated by go-swagger; DO NOT EDIT.
// Copyright 2020 The go-netbox 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
... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.12.4
// source: isuxportal/services/contestant/benchmark.proto
package contestant
import (
proto "github.com/golang/protobuf/proto"
resources "github.com/isucon/isucon10-portal/proto.go/isuxportal/resources"... |
package network
// 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
//
// Unl... |
// Copyright 2021 The PipeCD 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 api
import (
"fmt"
"net/url"
"os"
"github.com/google/uuid"
)
//API holds configuration for client
//env for URL and path
//logic for build account paths.
type API struct {
apiURL *url.URL
}
var (
ErrParametersCannotBeNil = fmt.Errorf("parameters cannot be nil")
)
//DefaultAPI returns an API with defa... |
// +build ee
package billing
import (
"net/http"
"github.com/porter-dev/porter/api/server/shared"
"github.com/porter-dev/porter/api/server/shared/config"
"github.com/porter-dev/porter/ee/api/server/handlers/billing"
)
var NewBillingGetTokenHandler func(
config *config.Config,
decoderValidator shared.RequestD... |
// Code generated by 'github.com/containous/yaegi/extract syscall'. DO NOT EDIT.
// +build go1.14,!go1.15
package syscall
import (
"go/constant"
"go/token"
"reflect"
"syscall"
)
func init() {
Symbols["syscall"] = map[string]reflect.Value{
// function, constant and variable definitions
"AF_INET": ... |
package actions
import (
"fmt"
"io/ioutil"
"path/filepath"
"github.com/hasura/graphql-engine/cli"
"github.com/hasura/graphql-engine/cli/internal/cliext"
cliextension "github.com/hasura/graphql-engine/cli/internal/metadataobject/actions/cli_extension"
"github.com/hasura/graphql-engine/cli/internal/metadataobjec... |
// Copyright 2017 Vckai Author. 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 applica... |
/*
Copyright 2014 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, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.