text stringlengths 3.08k 10.4k |
|---|
// Copyright (C) 2018 <NAME>. All rights reserved.
// Use of this source code is governed by a MIT-style license
// that can be found in the LICENSE file.
// main can be called like so:
//
// go run fetch.go http://danielsmith.com/category/wc15ml/ > ds_watercolors.json
// go run fetch.go http://danielsmith.com/cat... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.19.1
// source: pubsub.proto
package pb
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
con... |
// Copyright 2021 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
//go:build linux
// +build linux
package osutils
import (
"os"
"os/user"
"path/filepath"
"strings"
"testing"
"infra/cros/internal/assert"
)
fu... |
// Code generated by protoc-gen-go.
// source: examples/add/addservice/addservice.proto
// DO NOT EDIT!
/*
Package addservice is a generated protocol buffer package.
It is generated from these files:
examples/add/addservice/addservice.proto
It has these top-level messages:
AddMessage
SumMessage
*/
package addserv... |
package awslogs
import (
"fmt"
"os"
"os/signal"
"sync"
"syscall"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
"github.com/bangnh1/cloudlogs/pkg/common"
)
type Destination struct {
_ struct{} `type:"structure"`
Group string
NextToken string
Limit ... |
// Ensures we can import/export old-style repos
package cryptoservice
import (
"archive/zip"
"io/ioutil"
"os"
"testing"
"github.com/docker/notary/passphrase"
"github.com/docker/notary/trustmanager"
"github.com/docker/notary/tuf/data"
"github.com/stretchr/testify/require"
)
// Zips up the keys in the old rep... |
package requests
import (
"fmt"
"io"
"net/http"
"net/url"
"strings"
"time"
)
type Request struct {
Req *http.Request
Client *http.Client
*Args
}
// Args contains all request arg
type Args struct {
Headers HEADERS
Params PARAMS
Datas DATAS
BasicAuth BasicAuth
Proxy string
Hooks []Ho... |
package main
//dump a bolty db to trackpoints
import (
"encoding/json"
"flag"
"fmt"
"log"
"path"
"strings"
bolt "github.com/etcd-io/bbolt"
"os"
"github.com/kpawlik/geojson"
"compress/gzip"
"runtime/pprof"
"github.com/rotblauer/catTracks/catTracks"
"github.com/rotblauer/trackpoints/trackPoint"
)
var ... |
package main
import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"net/http"
"testing"
corev1 "k8s.io/api/core/v1"
ctiv1 "github.com/IBM/trusted-service-identity/pkg/apis/cti/v1"
"github.com/nsf/jsondiff"
"k8s.io/api/admission/v1beta1"
)
/*
In order to generate a new content of the Fake and Expect files,
u... |
// Copyright 2017 The Goma 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 frontend
import (
"bytes"
"context"
"fmt"
"net/http"
"os"
"regexp"
"go.opencensus.io/plugin/ochttp"
"go.opencensus.io/plugin/ochttp/propagat... |
package tss
import (
"encoding/base64"
"errors"
"fmt"
"strings"
"sync/atomic"
"github.com/libp2p/go-libp2p-core/peer"
"gitlab.com/thorchain/tss/go-tss/blame"
"gitlab.com/thorchain/tss/go-tss/common"
"gitlab.com/thorchain/tss/go-tss/conversion"
"gitlab.com/thorchain/tss/go-tss/keysign"
"gitlab.com/thorchai... |
package broadcast
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/http/httptest"
"net/url"
"testing"
cleanhttp "github.com/hashicorp/go-cleanhttp"
"github.com/stretchr/testify/assert"
)
type testServer struct {
t *testing.T
name string
prefix string
e... |
package acn
import (
"go/ast"
"go/parser"
"go/token"
"io"
"io/ioutil"
"log"
"os"
"regexp"
"golang.org/x/tools/go/packages"
)
var (
defaultBlacklist = []*regexp.Regexp{
// ignore tests
regexp.MustCompile(`.*_test\.go`),
// ignore anything inside testdata
regexp.MustCompile(".*" + string(os.PathSepar... |
package network
import (
"context"
"errors"
"sync"
"sync/atomic"
rawGrpc "google.golang.org/grpc"
"github.com/0xPolygon/polygon-edge/network/grpc"
"github.com/0xPolygon/polygon-edge/network/proto"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/peer"
empty "google.golang.org/pr... |
package service
import (
"fmt"
"github.com/mailgun/vulcand/Godeps/_workspace/src/github.com/gorilla/mux"
"github.com/mailgun/vulcand/Godeps/_workspace/src/github.com/mailgun/go-etcd/etcd"
log "github.com/mailgun/vulcand/Godeps/_workspace/src/github.com/mailgun/gotools-log"
runtime "github.com/mailgun/vulcand/Gode... |
package cmd
import (
"fmt"
"github.com/spf13/cobra"
"github.com/floriankammermann/artifactory-cli/artapi"
"github.com/floriankammermann/artifactory-cli/types"
"text/tabwriter"
"os"
"github.com/spf13/viper"
"bytes"
"encoding/json"
)
var repoType string
var repoPackageType string
// repositoryCmd represents t... |
package main
import (
"encoding/json"
"io"
"log"
"regexp"
"strings"
"github.com/kiteco/kiteco/kite-go/curation"
"github.com/kiteco/kiteco/kite-go/lang/python/pythoncuration"
"github.com/kiteco/kiteco/kite-go/lang/python/pythonimports"
"github.com/kiteco/kiteco/kite-go/ranking"
"github.com/kiteco/kiteco/kite... |
package cmd
import (
"fmt"
"log"
"strings"
"github.com/FalcoSuessgott/vkv/pkg/printer"
"github.com/FalcoSuessgott/vkv/pkg/utils"
"github.com/FalcoSuessgott/vkv/pkg/vault"
"github.com/caarlos0/env/v6"
"github.com/spf13/cobra"
)
const (
envVarPrefix = "VKV_"
)
var errInvalidFlagCombination = fmt.Errorf("inva... |
package storage
import (
"encoding/binary"
"github.com/google/btree"
"io"
"math"
"os"
"sync"
)
const (
ObjectHeaderSize = 20 //objectid:8, offset:4, size:4, flag:2
IndexBatchRead = 1024
TombstoneFileSize = math.MaxUint32
)
type Object struct {
Oid uint64
Offset uint32
Size uint32
Crc uint32
... |
package gortex
import (
"bufio"
"encoding/json"
"fmt"
"os"
"sort"
"strings"
)
const UNK = "UnK"
const BOS = "BoS"
const EOS = "EoS"
type Token struct {
Token string
Frequency uint
}
type Dictionary struct {
Token2ID map[string]uint
Token2Frequency map[string]uint
id2Token []string `json... |
package bertlv
import (
"fmt"
"strings"
)
/*
Some tags explained from https://www.eftlab.co.uk/index.php/site-map/knowledge-base/145-emv-nfc-tags
0x4f:['Application Identifier (AID)',BINARY,ITEM],
0x50:['Application Label',TEXT,ITEM],
0x57:['Track 2 Equivalent Data',BINARY,ITEM],
0x5a:['Application Primary Ac... |
package email
import (
"bytes"
"encoding/base64"
"fmt"
"io/ioutil"
"log"
"net/smtp"
"os"
"path/filepath"
"strings"
"time"
)
const (
defaultName = "deb"
server = "localhost:25"
nlgidsPrefix = "[NLgids] "
)
var from = "<EMAIL>"
func init() {
if name, err := os.Hostname(); err != nil {
from = fm... |
package vuze
import (
"fmt"
"github.com/blaize9/vuze-tools/config"
"github.com/blaize9/vuze-tools/utils"
"github.com/blaize9/vuze-tools/utils/log"
"github.com/djherbis/times"
torrentParser "github.com/j-muller/go-torrent-parser"
"io/ioutil"
"path/filepath"
"sort"
"sync"
"time"
)
type HashStorage struct {
... |
// Package mockenv contains facilities for unit testing commands
package mockenv
import (
"bytes"
"fmt"
"os"
"path/filepath"
"regexp"
"strings"
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing"
"github.com/tkw1536/ggman"
"github.com/tkw1536/ggman/env"
gggit "github.com/tkw1536/ggman/git"... |
//go:generate bitfanDoc
package elasticsearch2
import (
"fmt"
"time"
"github.com/jehiah/go-strftime"
"github.com/vjeantet/bitfan/processors"
"gopkg.in/olivere/elastic.v3"
)
var lines = map[string][]string{}
func New() processors.Processor {
return &processor{opt: &options{}}
}
type processor struct {
proces... |
package go_lru
import (
"container/list"
"errors"
"time"
)
const (
// For use with functions that take an expiration time.
NoExpiration time.Duration = -1
// For use with functions that take an expiration time. Equivalent to
// passing in the same expiration duration as was given to New() ... |
package crawler
import (
"github.com/gorilla/mux"
"net/http"
"net/http/httptest"
"net/url"
"os"
"path/filepath"
"testing"
)
var (
testAgent = "CrawlerUnderTest/abuse:github.com/aybabtme/crawler"
testPath = "testdata/antoine.im/"
e = struct{}{}
filesNotToFind = map[string]struct{}{
"/robots... |
package types
import (
"errors"
"fmt"
"reflect"
)
// FieldType is a struct that contains the FieldType for a given FieldDefinition
// Only one of the fields might be specified. For example, a FieldType
// cannot have both FieldType.Text and FieldType.Reference defined. Only one is allowed.
type FieldType struct {
... |
package controllers
import (
"assets-api/models"
"assets-api/utils"
"errors"
"fmt"
"log"
"os"
"path"
"strings"
"github.com/beego/beego/v2/client/orm"
beego "github.com/beego/beego/v2/server/web"
)
//基类控制器
type BaseController struct {
beego.Controller
}
//空结构
type Empty struct{}
var EMPTY = Empty{}
cons... |
package cmd
import (
"bytes"
"context"
"encoding/json"
"fmt"
"os"
"os/signal"
"strings"
"syscall"
"time"
"github.com/dmorgan81/go-btt/btt"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
const bttVarName = "GoBTT-expl-uuid"
const triggerJson = `
{
"BTTTouchBarButto... |
// SPDX-License-Identifier: Apache-2.0
// Copyright 2021 <NAME>
// Copyright 2018 Authors of Cilium
//go:build linux
// +build linux
package bpf
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"regexp"
"strings"
"github.com/cilium/ebpf/ringbuf"
"github.com/linux-lock/bpflock/api/v1/models"
"github.com/lin... |
package reporter
import (
"fmt"
"log"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/cloudwatch"
metrics "github.com/rcrowley/go-metrics"
"github.com/sclasen/go-metrics-cloudwatch/config"
)
var Silence = false
//blocks, run as go reporter.Cloudwatch(cfg)
func Cloudwatch(registry me... |
package main
import (
"cloud.google.com/go/storage"
"context"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"path/filepath"
"strings"
"gopkg.in/yaml.v2"
speech "cloud.google.com/go/speech/apiv1"
_ "cloud.google.com/go/storage"
speechpb "google.golang.org/genproto/googleapis/cloud/speech/v1"
)
var conf = ma... |
// Code generated by go-swagger; DO NOT EDIT.
package project
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/... |
// Copyright 2014 mqttgo author
//
// 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 manifest
import (
"bytes"
"fmt"
"io"
"os"
"path/filepath"
"github.com/pkg/errors"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
utilerrors "k8s.io/apimachinery/pkg/util/errors"
"k8s.io/apimachinery/pkg/util/yaml"
"k8s.io/client-go/kubernetes/scheme"
)
... |
/*
Copyright 2020 The MayaData Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, so... |
/**
___ ___ ___
/ /\ /__/\ /__/\
/ /:/_ \ \:\ \ \:\
/ /:/ /\ \ \:\ \ \:\
/ /:/ /::\ ___ \ \:\ _____\__\:\
/__/:/ /:/\:\ /__/\ \__\:\ /__/::::::::\
\ \:\/:/~/:/ \ \:\ / /:/ \ \:\~~\~~\/
\ \::/ /:/ \ \:\ /:/ ... |
// Package fans establishes the abilities the fans have to look for the NFT
package fans
import (
"context"
"crypto/ecdsa"
"fmt"
"math/big"
"math/rand"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/google/uuid"
"github.com/kalverra/crazed-nft-fans/clien... |
package records
import (
"testing"
)
func TestValidateDomain(t *testing.T) {
testDomain := func(domain string, shouldSucceed bool) {
err := validateDomainName(domain)
if shouldSucceed && err != nil {
t.Errorf("validation should have succeeded for %s", domain)
}
if !shouldSucceed && err == nil {
t.Erro... |
// Copyright 2017 Google 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 applicabl... |
// Copyright 2013 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"go/ast"
"go/build"
"go/token"
"os"
"path/filepath"
"sort"
"strings"
"golang.org/x/tools/cmd/guru/serial"
"golang.org/x/... |
// Copyright 2017 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, ... |
package main
import (
"fmt"
"os"
"strings"
"cf-tool/client"
"cf-tool/cmd"
"cf-tool/config"
"github.com/fatih/color"
ansi "github.com/k0kubun/go-ansi"
"github.com/mitchellh/go-homedir"
docopt "github.com/docopt/docopt-go"
)
const version = "v1.0.0"
const configPath = "~/.cf/config"
const sessionPath = "~/... |
package elasticsearch
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strings"
"sync"
"time"
"transporter/adaptor"
"transporter/adaptor/elasticsearch/clients"
// used to call init function for each client to register itself
_ "transporter/adaptor/elasticsearch/clients/all"
"transporter/c... |
// Copyright 2009-2018 the u-root Authors. All rights reserved
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// ldd returns all the library dependencies
// of a list of file names.
// The way this is done on GNU-based systems
// is interesting. For each ELF, on... |
// Package helpers contains some helper functions which the HULK CL program needs
package helpers
import (
"crypto/md5"
"encoding/binary"
"fmt"
"log"
"os"
"path/filepath"
"strings"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
// Pow is a function to raise a to the power of b
func Pow(a, b uint) uint ... |
package widget
import (
"math"
"fyne.io/fyne"
"fyne.io/fyne/canvas"
"fyne.io/fyne/internal/widget"
"fyne.io/fyne/theme"
)
// Orientation controls the horizontal/vertical layout of a widget
type Orientation int
// Orientation constants to control widget layout
const (
Horizontal Orientation = 0
Vertical Ori... |
// Package playground provides a handler.MatchFn and a Client struct with a
// Handler method that can be used as handler.ActionFn.
package playground
import (
"bytes"
"context"
"fmt"
"io"
"io/ioutil"
"net/http"
"strings"
"time"
"github.com/gobridge/gopherbot/handler"
"github.com/gobridge/gopherbot/mparser"... |
package store
import (
"fmt"
"io"
"os"
"path"
"sync"
"github.com/cry-inc/bdm/pkg/bdm"
"github.com/cry-inc/bdm/pkg/bdm/util"
)
// DuplicatePackageError is returned when trying to publish a package
// with content already existing in an earlier version of the same package.
type DuplicatePackageError struct{ err... |
// Copyright 2021 Dolthub, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
/*
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 under the License ... |
// Copyright 2020 Google 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 agreed to in ... |
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... |
package notifier
import (
"bytes"
"fmt"
"time"
"github.com/beevee/go-chart"
"github.com/moira-alert/moira"
"github.com/moira-alert/moira/metric_source"
"github.com/moira-alert/moira/metric_source/local"
"github.com/moira-alert/moira/plotting"
)
const (
// defaultTimeShift is default time shift to fetch time... |
/*
Copyright 2019 The Kubernetes 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 law or ag... |
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... |
package factory
import (
"errors"
"fmt"
"reflect"
)
// Populate receives the pointer to a struct and populates all fields, including the nested fields, with random values.
// If skipUnsupported set to false, an error will be returned in case a type is not supported.
func Populate(s interface{}, skipUnsupported boo... |
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package printer
import (
"bytes"
"flag"
"io/ioutil"
"path/filepath"
"testing"
"time"
"github.com/rogpeppe/godef/go/ast"
"github.com/rogpeppe/godef/go/... |
package github
import (
"context"
"encoding/json"
"fmt"
"time"
)
// HookDelivery represents the data that is received from GitHub's Webhook Delivery API
//
// GitHub API docs:
// - https://docs.github.com/en/rest/reference/repos#list-deliveries-for-a-repository-webhook
// - https://docs.github.com/en/rest/referen... |
// Copyright 2016 Google 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 applicabl... |
// Copyright 2016 <NAME>, Inc. All rights reserved.
// Licensed under the Apache License, version 2.0:
// http://www.apache.org/licenses/LICENSE-2.0
package types
import (
"fmt"
"github.com/attic-labs/noms/go/d"
"github.com/attic-labs/noms/go/hash"
)
type valueDecoder struct {
nomsReader
vr ValueReader
tc *Ty... |
package units
import (
"context"
"fmt"
"github.com/evergreen-ci/evergreen"
"github.com/evergreen-ci/evergreen/cloud"
"github.com/evergreen-ci/evergreen/model/distro"
"github.com/evergreen-ci/evergreen/model/event"
"github.com/evergreen-ci/evergreen/model/host"
"github.com/mongodb/amboy"
"github.com/mongodb/a... |
// Package protoc provides high level access to protoc command.
package protoc
import (
"context"
"fmt"
"os"
"path/filepath"
"strings"
"github.com/interchained/genesis/genesis/pkg/cmdrunner/exec"
"github.com/interchained/genesis/genesis/pkg/cmdrunner/step"
"github.com/interchained/genesis/genesis/pkg/localfs"... |
//
// Copyright (c) 2014 10X Genomics, Inc. All rights reserved.
//
// Martian lexical scanner.
//
//go:generate goyacc -p "mm" -o grammar.go grammar.y
//go:generate rm -f y.output
//go:generate gofmt -s -w grammar.go
package syntax
import (
"bytes"
"strings"
)
type mmLexInfo struct {
src []byte // All the d... |
package main
import (
"context"
"flag"
"fmt"
"io/fs"
"io/ioutil"
"os"
"path/filepath"
"github.com/sirupsen/logrus"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kerrors "k8s.io/apimachinery/pkg/util/errors"
"k8s.io/test-infra/prow/flagutil"
"k8s.io/test-infra/prow/logrusutil"
ct... |
/*
Copyright 2015 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, ... |
// Created by cgo -godefs - DO NOT EDIT
// cgo -godefs defs_linux.go
// +build linux,mips64
package ipv6
const (
sysIPV6_ADDRFORM = 0x1
sysIPV6_2292PKTINFO = 0x2
sysIPV6_2292HOPOPTS = 0x3
sysIPV6_2292DSTOPTS = 0x4
sysIPV6_2292RTHDR = 0x5
sysIPV6_2292PKTOPTIONS = 0x6
sysIPV6_CHECKSUM = 0x7... |
/*
* Copyright 2020-2021, Offchain Labs, 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... |
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/cludden/slack-chat-resource/utils"
"github.com/slack-go/slack"
)
func main() {
if len(os.Args) < 2 {
println("usage: " + os.Args[0] + " <source>")
os.Exit(1)
}
sourceDir := os.Args[1]
var request util... |
package utils
import (
"fmt"
"math"
"math/rand"
"strings"
"time"
"net"
)
var Misc = NewMisc()
type misc struct{}
func NewMisc() *misc {
return &misc{}
}
// get map default
func (m *misc) GetMapDefault(mapValue map[string]interface{}, key string, def interface{}) interface{} {
value, ok := mapValue[key]
if... |
package builder
import (
"fmt"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/rand"
kubevirtv1 "kubevirt.io/client-go/api/v1"
cdiv1alpha1 "kubevirt.io/containerized-data-importer/pkg/apis/core/v1alpha1"
)
const (
... |
package abuseipdb
import (
"bytes"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"strconv"
"strings"
"time"
)
const (
version = "1.0.2"
baseURL = "https://api.abuseipdb.com/api/v2"
)
var (
userAgent = fmt.Sprintf("AbuseIPDB-Go-Client/%s (+https://gitlab.com/honour/abuseipdb)", version)
)
... |
// Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
// or more contributor license agreements. Licensed under the Elastic License;
// you may not use this file except in compliance with the Elastic License.
package mage
import (
"errors"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
... |
// Copyright (c) 2018 Tigera, 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 appli... |
// Copyright 2019 GRAIL, Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
package exec
import (
"encoding/json"
"io"
"net/http"
"github.com/grailbio/base/log"
)
func (s *Session) handleDebug(w http.ResponseWriter, r *http.Reques... |
/*
Copyright 2020 The KubeSphere 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, ... |
//
// Author:: <NAME> (<<EMAIL>>)
// Copyright:: Copyright 2020, 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 meta provides the meta service for InfluxDB.
package meta // import "github.com/influxdata/influxdb/services/meta"
import (
"crypto/tls"
"fmt"
"net"
"net/http"
"strings"
"sync"
"time"
"go.uber.org/zap"
)
const (
MuxHeader = 8
)
type Service struct {
RaftListener net.Listener
Version string
... |
package storage_test
import (
"context"
"errors"
"testing"
"github.com/filecoin-project/go-filecoin/internal/pkg/block"
"github.com/filecoin-project/go-sectorbuilder"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/filecoin-project/go-filecoin/internal/pkg/actor/builtin... |
// Copyright (c) 2015 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 Software without restriction, including without limitation the rights
// to use, copy, modify, merge... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package marketplacecatalog
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
)
type CancelChangeSetInput struct {
_ struct{} `type:"structure"... |
package identity
import (
"github.com/SbstnErhrdt/env"
"github.com/SbstnErhrdt/identity/communication/email"
"github.com/SbstnErhrdt/identity/identity_interface_graphql"
"github.com/SbstnErhrdt/identity/services"
"github.com/google/uuid"
"github.com/graphql-go/graphql"
log "github.com/sirupsen/logrus"
"gorm.io... |
// Copyright 2020-2022 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 lz4stream provides the types that support reading and writing LZ4 data streams.
package lz4stream
import (
"encoding/binary"
"fmt"
"io"
"io/ioutil"
"github.com/pierrec/lz4/v4/internal/lz4block"
"github.com/pierrec/lz4/v4/internal/lz4errors"
"github.com/pierrec/lz4/v4/internal/xxh32"
)
//go:generate... |
// Package gopaxos implements a simple paxos algorithm for learning purpose.
package gopaxos
import (
"fmt"
"log"
"math/rand"
"net"
"net/http"
"net/rpc"
"strings"
"sync"
"time"
)
// proposer(v):
// while not decided:
// choose n, unique and higher than any n seen so far
// send prepare(n) to all se... |
/*
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 under the License i... |
package gocialite
import (
"crypto/rand"
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"os"
"strings"
"github.com/gadelkareem/cachita"
"github.com/gadelkareem/gocialite/v2/drivers"
"github.com/gadelkareem/gocialite/v2/structs"
"golang.org/... |
package graphql
import (
"context"
"fmt"
"github.com/fvaleriy89/graphql/gqlerrors"
"github.com/fvaleriy89/graphql/language/parser"
"github.com/fvaleriy89/graphql/language/source"
)
// SubscribeParams parameters for subscribing
type SubscribeParams struct {
Schema Schema
RequestString string
RootValue ... |
package subrecord
import (
"bytes"
"encoding/binary"
"fmt"
"strconv"
"strings"
)
// SRAdSensorsData EGTS_SR_AD_SENSORS_DATA
/*
Применяется абонентским терминалом для передачи
на аппаратно-программный комплекс информации о состоянии
дополнительных дискретных и аналоговых входов
*/
type SRAdSensorsData struct {... |
package spiderhn
import (
"crypto/sha256"
"encoding/json"
"errors"
"fmt"
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
"io/ioutil"
"math/rand"
"net/http"
"net/url"
"strconv"
"strings"
"time"
)
type HackNewQ struct {
PaginationQ
HackNew
}
func (cq *HackNewQ) SearchAll() (data *PaginationQ, err ... |
package halts
import (
"encoding/binary"
"fmt"
"sort"
"sync"
"sync/atomic"
"github.com/MinterTeam/minter-go-node/coreV2/state/bus"
"github.com/MinterTeam/minter-go-node/coreV2/types"
"github.com/MinterTeam/minter-go-node/rlp"
"github.com/cosmos/iavl"
)
const mainPrefix = byte('h')
type RHalts interface {
... |
// Copyright 2021 Google 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 agreed to in ... |
package mid
import (
"context"
"encoding/json"
"fmt"
"mime"
"net/http"
"reflect"
"strings"
"github.com/pkg/errors"
)
var (
contextType = reflect.TypeOf((*context.Context)(nil)).Elem()
errorType = reflect.TypeOf((*error)(nil)).Elem()
)
type (
reqKey struct{}
respKey struct{}
)
// JSON produces an htt... |
package main
import (
"context"
"fmt"
"log"
"math/rand"
"os"
"os/signal"
"sync"
"syscall"
"time"
"github.com/lovoo/goka"
"github.com/lovoo/goka-tools/scheduler"
"github.com/lovoo/goka/codec"
"github.com/lovoo/goka/multierr"
"github.com/spf13/pflag"
)
var (
brokers = pflag.StringSlice("brokers", []stri... |
package feeds
import (
"context"
"crypto/ed25519"
"sync"
"github.com/pkg/errors"
"github.com/smartcontractkit/chainlink/core/logger"
pb "github.com/smartcontractkit/chainlink/core/services/feeds/proto"
"github.com/smartcontractkit/wsrpc"
"github.com/smartcontractkit/wsrpc/connectivity"
)
//go:generate mocker... |
package template
import (
"io"
"strings"
"text/template"
"github.com/matryer/moq/internal/registry"
)
// Template is the Moq template. It is capable of generating the Moq
// implementation for the given template.Data.
type Template struct {
tmpl *template.Template
}
// New returns a new instance of Template.
f... |
package probe
import (
"../model"
"context"
"fmt"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/swarm"
"github.com/docker/docker/client"
"strconv"
"strings"
)
// DiscoverStacks attempts to discover Docker Stacks via a docker host,
// li... |
package dnsclient
import (
"errors"
"math/rand"
"strings"
"time"
)
const (
UNIX_CONFIG_FILE = "/etc/resolv.conf"
DEFAULT_DNS1 = "8.8.8.8"
DEFAULT_DNS2 = "1.1.1.1"
DEFAULT_PORT = "53"
DEFAULT_TIMEOUT = 5 * time.Second
DEFAULT_RETRYTIMES = 3
DEFAULT_PROTOCOLv4 = "udp4"
QR = 1 << 15 /... |
package rollrus
import (
"context"
"fmt"
"runtime"
"strings"
"time"
"github.com/rollbar/rollbar-go"
"github.com/sirupsen/logrus"
"github.com/heroku/rollrus/internal/transport"
)
var _ logrus.Hook = &Hook{} //assert that *Hook is a logrus.Hook
// Hook is a wrapper for the Rollbar Client and is usable as a l... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.