text stringlengths 3.08k 10.4k |
|---|
package server
import (
"context"
"encoding/json"
"fmt"
"net/http"
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
grpc_zap "github.com/grpc-ecosystem/go-grpc-middleware/logging/zap"
grpc_validator "github.com/grpc-ecosystem/go-grpc-middleware/validator"
grpc_prometheus "github.com/grpc-ecosyst... |
// Support for different target platforms (Operating Systems and Architectures) supported by the Go compiler
package platforms
/*
Copyright 2013 <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 ... |
/*
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, ... |
package push
//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
//distribu... |
package dockerinfra
import (
"context"
"encoding/json"
"fmt"
"io"
"net"
"os"
"strings"
"time"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/network"
"github.com/docker/docker/client"
"github.com/goadapp/goad/infrastructure"
"githu... |
package transaction
import (
"errors"
"strconv"
"strings"
"time"
"github.com/Dexus/go-paypal-classic/client"
)
// TransactionSearch is struct for TransactionSearch API
// see: https://developer.paypal.com/docs/classic/api/merchant/TransactionSearch_API_Operation_NVP/
type TransactionSearch struct {
client.Base... |
package model
import (
"fmt"
"time"
"github.com/evergreen-ci/evergreen/apimodels"
"github.com/evergreen-ci/evergreen/model/testresult"
"github.com/evergreen-ci/utility"
"github.com/mongodb/grip"
)
// APITest contains the data to be returned whenever a test is used in the
// API.
type APITest struct {
Id ... |
// Package nodeconfig includes all the configuration variables for a node.
// It is a global configuration for node and other services.
// It will be included in node module, and other modules.
package nodeconfig
import (
"crypto/ecdsa"
"errors"
"fmt"
"sync"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/h... |
/*
Sniperkit-Bot
- Status: analyzed
*/
// Copyright 2013 <NAME>
// Modifications copyright 2016 Palantir Technologies, Inc.
// Licensed under the MIT License. See LICENSE in the project root
// for license information.
package outparamcheck
import (
"encoding/json"
"fmt"
"go/ast"
"go/build"
"go/token"
"go/type... |
package keymanager
import (
"context"
"crypto"
"crypto/rsa"
"crypto/x509"
"io"
keymanagerv1 "github.com/spiffe/spire-plugin-sdk/proto/spire/plugin/agent/keymanager/v1"
"github.com/spiffe/spire/pkg/common/plugin"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
type V1 struct {
plugin.Facade... |
// Copyright 2020-2021 Buf 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... |
package vm
import "github.com/vsariola/sointu"
// findSuperIntArray finds a small super array containing all
// the subarrays passed to it. Returns the super array and indices where
// the subarrays can be found. For example:
// FindSuperIntArray([][]int{{4,5,6},{1,2,3},{3,4}})
// returns {1,2,3,4,5,6},{3,0,2}
// I... |
package main
import (
"flag"
"fmt"
"log"
"strconv"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc"
pb "github.com/brotherlogic/goserver/proto"
"github.com/brotherlogic/goserver/utils"
_ "google.golang.org/grpc/encoding/gzip"
"google.golang.org/grpc/resolver"
)
func buildState(s *pb.State, upti... |
package walk
import (
"fmt"
"io"
"io/fs"
"log"
"os"
"path/filepath"
"runtime"
"strings"
"sync"
"github.com/komem3/fing/filter"
)
var concurrencyMax = runtime.NumCPU() * 2
const (
defaultDirecotryBuffer = 1 << 7
)
type Walker struct {
// matcher
matcher filter.OrExp
prunes filter.OrExp
// options
... |
package sshmux
import (
"errors"
"fmt"
"io"
"net"
"time"
"golang.org/x/crypto/ssh"
)
// Remote describes the selectable remote server.
type Remote struct {
// The various names that can be used to select this remote
Names []string
// The description used for interactive prompting
Description string
// T... |
package react
import (
"github.com/stretchr/testify/assert"
"strconv"
"testing"
)
func List(num int) *Element {
var items []*Element
for i := 0; i < num; i++ {
items = append(items, CreateElement("li", Props{
"className": "list__item item-" + strconv.Itoa(i+1),
}, Textf("Item %d", i+1)))
}
return Creat... |
package netbox
import (
"fmt"
log "github.com/sirupsen/logrus"
"github.com/h0x91b-wix/go-netbox/netbox/client/ipam"
"github.com/h0x91b-wix/go-netbox/netbox/models"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)
// resourceNetboxIpamVrfDomain is the core Terraform resource structure for the netbox_... |
/*
Copyright 2021 The Skaffold 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... |
// Copyright (c) 2008-2017, Hazelcast, Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License")
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by a... |
package cfe2e
import (
"fmt"
"io/ioutil"
"os"
"regexp"
"strconv"
"strings"
"testing"
"time"
"github.com/mongodb-forks/digest"
c "github.com/mongodb/atlas-osb/pkg/broker/credentials"
"github.com/mongodb/atlas-osb/test/cfe2e/model/test"
cfc "github.com/pivotal-cf-experimental/cf-test-helpers/cf"
"go.mongod... |
package cmd
import (
"fmt"
"io"
"time"
"github.com/spf13/cobra"
kubecmd "k8s.io/kubernetes/pkg/kubectl/cmd"
kcmdutil "k8s.io/kubernetes/pkg/kubectl/cmd/util"
"k8s.io/kubernetes/pkg/util/term"
"github.com/openshift/origin/pkg/cmd/templates"
"github.com/openshift/origin/pkg/cmd/util"
"github.com/openshift/o... |
package config
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"reflect"
"strconv"
"sync"
"time"
log "github.com/sirupsen/logrus"
)
//Config the struct of config instance
type Config struct {
triggers map[string]OnChange
backEnds map[string]Backend
//some backend of config, you can use file, etcd2, etcd3... |
package main
// redstat is a 'stat' command for RED, requests, errors and duration
import (
r "../../pkg/red"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
u "net/url"
"os"
"strconv"
"strings"
"time"
)
func usage() {
fmt.Printf("Usage: %s [-v] url [delay [count]]", os.Args[0])
os.Exit(1)
}
// main pa... |
package lfs
import (
"bytes"
"errors"
"fmt"
"net/http"
"net/url"
"os/exec"
"strings"
"github.com/github/git-lfs/vendor/_nuts/github.com/rubyist/tracerx"
)
// getCreds gets the credentials for the given request's URL, and sets its
// Authorization header with them using Basic Authentication. This is like
// g... |
package models
import (
"errors"
"reflect"
"github.com/fatih/structs"
)
var (
errFeatureNotStored = errors.New("Type of data is not stored.")
)
// Features contains all the data that we store
type Features struct {
Battery []Battery `xml:"battery,omitempty" json:"battery,omitempty"`
Call []Call ... |
package task
import (
"asoul-fan-support/app/service"
"asoul-fan-support/lib/utility"
"encoding/csv"
"fmt"
"os"
"sort"
"strconv"
"strings"
"sync"
"time"
)
const (
tempSaveFile = "temp/recommend_slice.csv"
)
type taskGetRecommendSlice struct {
recommendSlice Videos
}
//bid:BV号
//title:标题
//image_url:封面链接... |
package standard
import (
"context"
"io"
"io/ioutil"
"mime/multipart"
"net/http"
"sync"
"github.com/admpub/realip"
"github.com/webx-top/echo"
"github.com/webx-top/echo/engine"
)
var defaultMaxRequestBodySize int64 = 32 << 20 // 32 MB
type Request struct {
config *engine.Config
requestMu sync.RWMutex
... |
/*
* Copyright 2019 The CovenantSQL 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 o... |
package mutatingwebhook
import (
"bytes"
"encoding/json"
"io/ioutil"
"net/http"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"k8s.io/api/admission/v1"
)
func TestHandleMutateSuccess(t *testing.T) {
// given
ts := httptest.NewServer(http.HandlerFu... |
package npm
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"github.com/pkg/errors"
"github.com/SAP/jenkins-library/pkg/log"
CredentialUtils "github.com/SAP/jenkins-library/pkg/piperutils"
FileUtils "github.com/SAP/jenkins-library/pkg/piperutils"
)
// PublishAllPackages executes npm publish for all package.... |
// Copyright 2016 The go-ethereum Authors
// This file is part of go-ethereum.
//
// go-ethereum is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any la... |
package models
import (
"database/sql"
"database/sql/driver"
"encoding/json"
"fmt"
"strconv"
"strings"
"time"
"github.com/dollarshaveclub/metahelm/pkg/metahelm"
"github.com/google/uuid"
"github.com/lib/pq"
"github.com/pkg/errors"
)
type EventLog struct {
ID uuid.UUID `json:"id"`
C... |
// Copyright (c) WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
//
// WSO2 Inc. licenses this file to you 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/L... |
package engine
import (
"fmt"
"math"
"math/big"
"github.com/hyperledger/burrow/execution/errors"
)
const (
defaultInitialMemoryCapacity = 0x100000 // 1 MiB
defaultMaximumMemoryCapacity = 0x1000000 // 16 MiB
)
// Change the length of this zero array to tweak the size of the block of zeros
// written to the ba... |
// Package testdirtree provides utilities for creating test directory trees for testing.
package testdirtree
import (
cryptorand "crypto/rand"
"encoding/hex"
"fmt"
"io"
"math/rand"
"os"
"path/filepath"
"sync/atomic"
"testing"
"github.com/pkg/errors"
"github.com/kopia/kopia/internal/clock"
"github.com/kop... |
package main
import (
"container/heap"
"bufio"
"os"
"fmt"
)
func readInt(bytes []byte, from int, val *int) int {
i := from
tmp := 0
for i < len(bytes) && bytes[i] != ' ' {
tmp = tmp*10 + int(bytes[i]-'0')
i++
}
*val = tmp
return i
}
func readNum(scanner *bufio.Scanner) (a int) {
scanner.Scan()
readIn... |
package sync
import (
"fmt"
"sync/atomic"
"time"
"github.com/go-redis/redis/v7"
"go.uber.org/zap"
)
const (
StateStopped = 0
StateInterrupting = 1
StateRunning = 2
)
type subscriptionConsumer struct {
state int32 // atomic
notifyCh chan struct{} // must be buffered with cap=1
conn ... |
package recurly
import "encoding/xml"
// Adjustment state constants
const (
AdjustmentStatePending = "pending"
AdjustmentStateInvoied = "invoiced"
)
// Adjustment works with charges and credits on a given account.
type Adjustment struct {
AccountCode string
InvoiceNumber int
SubscriptionUUID... |
package bitcask
import (
"io"
"os"
"path"
"strconv"
"strings"
"time"
"github.com/pkg/errors"
)
// BFile hint file
type BFile struct {
// fp write file handler, val
fp *os.File
fileID uint32
writeOffset uint64
// hintFp hint file
hintFp *os.File
crc bool
}
// openBFile ...
func openBFi... |
package goextensions
import (
"bytes"
"context"
"fmt"
"io"
"os"
"path/filepath"
"strings"
"sync"
"time"
"github.com/samsarahq/taskrunner"
"github.com/samsarahq/taskrunner/clireporter"
"github.com/samsarahq/taskrunner/shell"
"mvdan.cc/sh/interp"
)
var stdlibLookupMu = sync.Mutex{}
var stdlibLookup = make... |
// Copyright 2016 <NAME>. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root
// for license information.
package cmd
import (
"fmt"
"io"
"strings"
"github.com/google/go-github/github"
"github.com/palantir/pkg/cli"
"github.com/palantir/pkg/cli/flag"
"github.com/pkg/errors"
... |
// 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 wire
import (
"encoding/json"
"strings"
)
// OrderingInstitution is the ordering institution
type OrderingInstitution struct {
// tag
tag string
// CoverPaymen... |
// Copyright 2016 IBM 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 (c) Microsoft Corporation.
Licensed under the MIT license.
*/
package genruntime
import (
"fmt"
"strings"
"github.com/pkg/errors"
)
type ResourceHierarchyRoot string
const (
ResourceHierarchyRootResourceGroup = ResourceHierarchyRoot("ResourceGroup")
ResourceHierarchyRootSubscription = ResourceHi... |
package main
import (
"github.com/xyproto/vt100"
)
// MenuWidget represents a TUI widget for presenting a menu with choices for the user
type MenuWidget struct {
title string // title
w uint // width
h uint // height (number of menu ... |
// Copyright 2014 <NAME>. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package gin
import (
"net/http"
"regexp"
)
// IRouter defines all router handle interface includes single and group router.
type IRouter interface {
IRoutes
Grou... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: common/player_info.proto
package common
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This i... |
package repos
import (
"encoding/json"
"fmt"
"strconv"
"strings"
)
const (
v2Url = "api/v2.0"
v1Url = "api"
projectUrl = "/projects"
repositoryUrl = "repositories"
artifactUrl = "/artifacts"
tagUrl = "tags"
)
func NewHarborClient(endpoint, username, password, version string) *ha... |
// Command example is a sample application built with Goji. Its goal is to give
// you a taste for what Goji looks like in the real world by artificially using
// all of its features.
//
// In particular, this is a complete working site for gritter.com, a site where
// users can post 140-character "greets". Any resembl... |
package module
import (
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"
"regexp"
"strings"
"github.com/hashicorp/go-getter"
cleanhttp "github.com/hashicorp/go-cleanhttp"
)
// GetMode is an enum that describes how modules are loaded.
//
// GetModeLoad says that modules will not be downloaded or updated, ... |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package yandex
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Get information about a Yandex Application Load B... |
package commands
import (
"encoding/hex"
"errors"
"fmt"
"time"
"github.com/abiosoft/ishell"
rpc "github.com/qlcchain/jsonrpc2"
"github.com/spf13/cobra"
"github.com/qlcchain/go-qlc/cmd/util"
"github.com/qlcchain/go-qlc/common/types"
"github.com/qlcchain/go-qlc/crypto/random"
"github.com/qlcchain/go-qlc/rpc... |
// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
package models
import (
json "encoding/json"
easyjson "github.com/mailru/easyjson"
jlexer "github.com/mailru/easyjson/jlexer"
jwriter "github.com/mailru/easyjson/jwriter"
)
// suppress unused package warning
var (
_ *json.RawMessage
_ *jle... |
// Copyright 2015 henrylee2cn 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 a... |
// 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.
// Code generated (@generated) by entc, DO NOT EDIT.
package ent
import (
"fmt"
"strings"
"time"
"github.com/facebookincubator/ent/dialect/sql"
"gi... |
package github
import (
"encoding/json"
"fmt"
"github.com/praveenprem/logging"
"net/http"
)
/**
* Package name: github
* Project name: ProjectNeptune
* Created by: <NAME>
* Created on: 25/03/2020 20:33
*/
type (
//Key defines the structure for the response of Github when requesting user's keys
Key struct ... |
package main
import (
"flag"
"fmt"
"os"
"path/filepath"
"strconv"
"strings"
"time"
"github.com/lightstep/lightstep-tracer-go"
"github.com/opentracing/opentracing-go"
appdashot "github.com/sourcegraph/appdash/opentracing"
"golang.org/x/net/context"
"sourcegraph.com/sourcegraph/appdash"
"github.com/go-kit... |
// (c) 2021, Dijets, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package process
import (
"fmt"
"path/filepath"
"github.com/lasthyphen/paaro/database/leveldb"
"github.com/lasthyphen/paaro/database/manager"
"github.com/lasthyphen/paaro/database/memdb"
"github.com/lasthyphen/paaro/data... |
// Copyright 2016 The Hugo Authors. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable ... |
// Copyright 2018 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 agreed to i... |
package exchange
import (
"encoding/json"
"errors"
"fmt"
"github.com/sirupsen/logrus"
"io"
"math"
"net/http"
"strconv"
"strings"
"time"
)
// https://developer.big.one/
const bigOneBaseApi = "https://api.big.one/"
type bigOneClient struct {
exchangeBaseClient
AccessKey string
SecretKey string
}
type big... |
/*
*Copyright (c) 2019-2021, Alibaba Group Holding Limited;
*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 a... |
package cli
import (
"context"
"fmt"
"io/ioutil"
"net/http"
"net/http/httptest"
"os"
"os/signal"
"path/filepath"
"strings"
"syscall"
"time"
"github.com/danielgtaylor/huma"
"github.com/danielgtaylor/huma/middleware"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
// CLI provides a command line inte... |
/*
原题没权限,可参考博客吧:
https://www.cnblogs.com/grandyang/p/6746528.html
*/
package main
import "fmt"
var n, m int
var queue [][]int
var head, tail int
var dist [][][]int
var vis [][][]bool
var path [][][]string
// const value
const (
MaxDist = 1000000 // MaxDist 定义不可达
FourWays = 4 // FourWays 定义方向的数量
)
var wa... |
//
// Author:: <NAME> (<<EMAIL>>)
// Copyright:: Copyright 2021, Lacework Inc.
// License:: Apache License, Version 2.0
//
// 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://ww... |
package vsphere // import "github.com/docker/infrakit/pkg/provider/vsphere"
import (
"context"
"errors"
"fmt"
"net/url"
"github.com/vmware/govmomi"
"github.com/vmware/govmomi/find"
"github.com/vmware/govmomi/object"
)
// Options capture the config parameters required to create the plugin
type Options struct {... |
package polls
import (
"context"
"errors"
"log"
"strconv"
"strings"
"sync"
"time"
"github.com/Nv7-Github/Nv7Haven/eod/logs"
"github.com/Nv7-Github/Nv7Haven/eod/trees"
"github.com/Nv7-Github/Nv7Haven/eod/types"
"github.com/Nv7-Github/Nv7Haven/eod/util"
)
var createLock = &sync.Mutex{}
func (b *Polls) elem... |
package root
import (
"fmt"
"github.com/iotaledger/goshimmer/dapps/valuetransfers/packages/balance"
"github.com/iotaledger/wasp/packages/coretypes"
"github.com/iotaledger/wasp/packages/kv"
"github.com/iotaledger/wasp/packages/kv/codec"
"github.com/iotaledger/wasp/packages/kv/collections"
"github.com/iotaledger/... |
package skate
import "strings"
type runestring []rune
// A safe way to index a runestring. It will return a null rune if you try
// to index outside of the bounds of the runestring.
func (r *runestring) SafeAt(pos int) rune {
if pos < 0 || pos >= len(*r) {
return 0
} else {
return (*r)[pos]
}
}
// A safe way... |
package knockrd
import (
"context"
"encoding/json"
"log"
"net"
"net/http"
"os"
"strings"
"time"
"github.com/aws/aws-lambda-go/events"
"github.com/fujiwara/go-amzn-oidc/validator"
"github.com/kayac/go-config"
"github.com/natureglobal/realip"
)
const (
DefaultPort = 9876
DefaultTable = "knockrd"
... |
package config
import (
"os"
"os/signal"
"syscall"
"github.com/fsnotify/fsnotify"
log "github.com/sirupsen/logrus"
"github.com/spf13/viper"
)
type BgpConfigSet struct {
Global Global `mapstructure:"global"`
Neighbors []Neighbor `mapstructure:"neighbors"`
PeerGroups ... |
//
// Modified BSD 3-Clause Clear License
//
// Copyright (c) 2019 Insolar Technologies GmbH
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted (subject to the limitations in the disclaimer below) provided that
// the following conditions a... |
package server
import (
"fmt"
"io/ioutil"
"log"
"os"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/smancke/guble/client"
"github.com/smancke/guble/protocol"
"github.com/smancke/guble/testutil"
)
type testgroup struct {
t *testing.T
groupID int
addr ... |
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net"
"net/http"
"strings"
"time"
"github.com/go-redis/redis"
"github.com/kataras/iris"
"github.com/robfig/cron"
)
const (
adapterExtension = "http://adapter-extension.default.svc.cluster.local"
schedulerList = "trigger_scheduler"
timeG... |
package yiigo
import (
"encoding/xml"
"errors"
"net"
"reflect"
"strings"
"time"
"github.com/go-playground/locales/zh"
ut "github.com/go-playground/universal-translator"
"github.com/go-playground/validator/v10"
zhcn "github.com/go-playground/validator/v10/translations/zh"
"github.com/hashicorp/go-version"
... |
package odoo
import (
"fmt"
)
// IrUiView represents ir.ui.view model.
type IrUiView struct {
LastUpdate *Time `xmlrpc:"__last_update,omptempty"`
Active *Bool `xmlrpc:"active,omptempty"`
Arch *String `xmlrpc:"arch,omptempty"`
ArchBase *String `xmlrpc:"a... |
package sfu
//go:generate go run github.com/matryer/moq -out router_mock_test.generated.go . Router
import (
"math/rand"
"sync"
"time"
"github.com/pion/ion-sfu/pkg/log"
"github.com/pion/rtcp"
)
const (
SimpleRouter = iota + 1
SimulcastRouter
SVCRouter
)
// Router defines a track rtp/rtcp router
type Router... |
package gr_test
import (
"encoding/json"
"encoding/xml"
"fmt"
"io"
"net/http"
ht "net/http/httptest"
"net/url"
"os"
r "reflect"
"runtime"
"strings"
"testing"
u "unsafe"
)
type (
U = url.URL
V = url.Values
H = http.Header
Q = http.Request
S = http.Response
W = http.ResponseWriter
... |
package basetool
import (
"crypto/tls"
"github.com/lvyun66/awesome-go/netease/music/models"
"github.com/lvyun66/awesome-go/proxy"
"io/ioutil"
"math/rand"
"net/http"
"net/url"
"strconv"
"strings"
"time"
)
var userAgentList = [19]string{
"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_5) AppleWebKit/537.36 (KH... |
// Copyright (c) 2019,CAOHONGJU All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package buffered
import (
"bufio"
"bytes"
"net"
"time"
"github.com/kelindar/rate"
)
const (
defaultRate = 50
defaultBufferSize = 64 * 1024
minBuf... |
package ingest
import (
"encoding/binary"
"errors"
"fmt"
"io"
"math/rand"
"net"
"sync"
"time"
"github.com/prometheus/client_golang/prometheus"
"github.com/denji/oklog/pkg/record"
"github.com/oklog/ulid"
)
// HandleConnections passes each connection from the listener to the connection handler.
// Terminat... |
/*
* Copyright (c) 2018 WSO2 Inc. (http:www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you 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/license... |
// Package aes256cbc is a helper to generate OpenSSL compatible encryption
// with autmatic IV derivation and storage. As long as the key is known all
// data can also get decrypted using OpenSSL CLI.
// Code from http://dequeue.blogspot.de/2014/11/decrypting-something-encrypted-with.html
package aes256cbc
import (
"... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: error_details.proto
package errdetails // import "github.com/kirinse/atlas-app-toolkit/rpc/errdetails"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used... |
package omsmodel
import (
"database/sql"
"fmt"
"strings"
"github.com/tal-tech/go-zero/core/stores/sqlc"
"github.com/tal-tech/go-zero/core/stores/sqlx"
"github.com/tal-tech/go-zero/core/stringx"
"github.com/tal-tech/go-zero/tools/goctl/model/sql/builderx"
)
var (
omsOrderItemFieldNames = builderx.Fie... |
// <NAME>
// 11.05.2017
package main
import (
"math"
"math/rand"
// "fmt"
)
func (b *Bacteria) CanReplicate(p *Petri) bool {
// This function tests whether a bacterium has enough energy to replicate.
// If it has energyCap greater than repEnergy, the function returns true.
if b.currentEnergy > b.repEnergy && b... |
// logger.go: extends the log package so that each log message is
// prefixed with a string
//
// Copyright (c) 2011-2012 CloudFlare, Inc.
package logger
import (
"bytes"
"sync/atomic"
)
type Level int
var (
// offLogger is a dummy no-op logger.
OffLogger = New(Levels.Off)
// Levels is a singleton that repres... |
package powerdns
import (
"io/ioutil"
"net/http"
"strings"
)
// Zone structure with JSON API metadata
type Zone struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"`
URL string `json:"url"`
Kind string `json:"kind"`
R... |
// BSD 2-Clause License
//
// Copyright (c) 2020, <NAME>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, this
// ... |
// 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 2016-present Datadog, Inc.
//go:build linux
// +build linux
package main
import (
"archive/tar"
... |
// Copyright 2022 API7.ai, 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... |
/*
* Copyright 2020 New Relic Corporation. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
package exporter
import (
"context"
"encoding/json"
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
"strings"
"unsafe"
"github.com/newrelic/infra-integrations-sdk/v4/log"
"golang.org/x/sys/windows"
)
const... |
package modelselection
import (
"fmt"
"math"
"sort"
"testing"
"github.com/pa-m/sklearn/base"
"github.com/pa-m/sklearn/datasets"
"github.com/pa-m/sklearn/metrics"
neuralnetwork "github.com/pa-m/sklearn/neural_network"
"github.com/pa-m/sklearn/preprocessing"
"golang.org/x/exp/rand"
"gonum.org/v1/gonum/mat"
)... |
package main
import (
"bufio"
"container/list"
"encoding/binary"
"fmt"
"log"
)
// Reader is an unmarshaler for CPython bytecode.
type Reader struct {
bufio.Reader
module *Module
}
// ReadObject reads the next available object from the unterlying
// reader.
func (r *Reader) ReadObject() Object {
c, err := r.R... |
package litrpc
import (
"fmt"
"github.com/mit-dci/lit/portxo"
"github.com/mit-dci/lit/qln"
)
type ChannelInfo struct {
OutPoint string
Closed bool
Capacity int64
MyBalance int64
Height int32 // block height of channel fund confirmation
StateNum uint64 // Most recent commit ... |
// Package nodes with domain node management
package nodes
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"reflect"
"github.com/iotdomain/iotdomain-go/lib"
"github.com/iotdomain/iotdomain-go/messaging"
"github.com/iotdomain/iotdomain-go/types"
"github.com/sirupsen/logrus"
)
// DomainNodes manages nodes... |
package github
import (
"context"
"fmt"
"reflect"
"strconv"
"strings"
"testing"
"github.com/google/go-github/github"
"github.com/hashicorp/terraform/helper/acctest"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
)
func TestAccGithubRepositoryWebhook_basic(t *tes... |
package tdesktop
import (
"io"
"math/bits"
"github.com/go-faster/errors"
"github.com/gotd/td/bin"
)
//nolint:deadcode,unused,varcheck
const (
dbiKey = 0x00
dbiUser = 0x01
dbiDcOptionOldOld = 0x02
dbiChatSizeMax = 0x03
dbiMutePeer = 0x04
dbiSendKey = 0... |
package main
import (
"fmt"
"os"
"path/filepath"
"text/template"
"github.com/urfave/cli"
"github.com/skycoin/skycoin/src/skycoin"
"github.com/skycoin/skycoin/src/util/logging"
)
const (
// Version is the cli version
Version = "0.1"
)
// CoinTemplateParameters represents parameters used to generate the ne... |
package dao
import (
"context"
"encoding/json"
"fmt"
"go-common/app/job/bbq/video/conf"
notice "go-common/app/service/bbq/notice-service/api/v1"
searchv1 "go-common/app/service/bbq/search/api/grpc/v1"
videov1 "go-common/app/service/bbq/video/api/grpc/v1"
account "go-common/app/service/main/account/api"
"go-co... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.