text stringlengths 3.08k 10.4k |
|---|
package main
import (
"fmt"
"server/rpc"
"time"
)
// Gamestate is an enumeration over all the different gamestates.
type Gamestate int
const (
// StateInitial represents the gamestate where the dealer is dealing the cards.
StateInitial Gamestate = 0
// StatePlayersPlaying represents the gamestate where players... |
package graphql
import (
"errors"
"fmt"
"go/build"
"go/types"
"io/ioutil"
"os"
"path"
"path/filepath"
"regexp"
"strings"
"golang.org/x/tools/go/packages"
)
var (
ErrNoQuery = fmt.Errorf("no graphql root Query is found. type Query struct {...} is required")
ErrSyntax = fmt.Errorf("cannot parse package")... |
package main
import (
"bufio"
"fmt"
"log"
"os"
"regexp"
"strings"
)
// Words holds a mapping of words to there respective counts.
type Words map[string]int
// sum sums the values of the Words map.
func (c Words) sum() int {
var sum int
for _, v := range c {
sum += v
}
return sum
}
// readWords reads a f... |
/*
Copyright 2021.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed un... |
package mosquitto
import (
"reflect"
"unsafe"
)
////////////////////////////////////////////////////////////////////////////////
// CGO
/*
#cgo pkg-config: libmosquitto
#include <stdlib.h>
#include <mosquitto.h>
extern void onConnect(struct mosquitto*, void*, int);
extern void onDisconnect(struct mosquitto*, void... |
package projectory
import (
"fmt"
"github.com/jung-kurt/gofpdf"
)
var cardWidth float64 = 45
var cardHeight float64 = 67
var pageOffsetX float64 = 15
var pageOffsetY float64 = 14
func PrintProjects(projects []Project, pdf *gofpdf.Fpdf) {
LOG.Println("printing project cards...")
for _, proj := range projects {
... |
package avatarme
import (
"crypto/md5"
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
"fmt"
"image"
"image/color"
"image/draw"
"image/png"
"os"
)
type IconGenerator interface {
GeneratePixel(s string) image.Image
GenerateShapes(s string) image.Image
}
type identicon struct {
size int
pixSize int
... |
// Copyright The 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 agre... |
/*
Copyright 2014 Outbrain 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 w... |
package main
import (
"fmt"
"io/ioutil"
"net/http"
"reflect"
"strings"
"time"
"github.com/gin-gonic/gin"
"github.com/gorilla/websocket"
)
type service struct {
gin *gin.Engine
wsUpgrder *websocket.Upgrader
currentSubscriptions subscriptions
timeout time.Duration
... |
package internal
import (
"bytes"
"context"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"sort"
"strings"
"testing"
"github.com/luno/jettison/errors"
"github.com/luno/jettison/jtest"
"github.com/luno/jettison/log"
"github.com/sebdah/goldie/v2"
"github.com/stretchr/testify/require"
"gopkg.in/... |
package wal
import (
logger "code.google.com/p/log4go"
"fmt"
"io/ioutil"
"os"
"sort"
"strconv"
"strings"
)
type indexEntry struct {
FirstRequestNumber uint32 // first request number in the block
LastRequestNumber uint32 // number of requests in the block
FirstOffset int64 // the offset of the first... |
package clicore
import (
"fmt"
"os"
"path/filepath"
"github.com/solo-io/go-utils/clicore/constants"
"github.com/mitchellh/go-homedir"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
// BuildCliLogger creates a set of loggers for use in CLI applications.
// - A json-formatted file logger that writes all log mes... |
// MIT License
// Copyright (c) 2020 <NAME>
// 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, p... |
package main
import (
"fmt"
"log"
"os"
"runtime"
"sort"
"strings"
"time"
"github.com/alexflint/go-arg"
"github.com/kiteco/kiteco/kite-go/lang"
"github.com/kiteco/kiteco/kite-golib/fileutil"
"github.com/kiteco/kiteco/kite-golib/pipeline"
"github.com/kiteco/kiteco/kite-golib/pipeline/aggregator"
"github.co... |
package chicken
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 (
gooseBirthday = nook.Birthday{
Day: 4,
Mont... |
package param
import (
"encoding/json"
"encoding/xml"
"errors"
"io/ioutil"
"net/http"
"strconv"
"time"
"github.com/KlyuchnikovV/webapi/types"
)
type paramPlacing string
const (
inPath paramPlacing = "in-path"
query paramPlacing = "query"
)
func boolParam(place paramPlacing, key string, options ...Parame... |
package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"strings"
"text/template"
"gopkg.in/yaml.v2"
)
var (
debugMode = flag.Bool("debug", false, "run in debugMode")
errLog log.Logger
)
const (
argPrefix = "render://"
)
type Values map[interface{}]interface{}
type FilesList struc... |
package sgload
import (
"crypto/md5"
"encoding/json"
"fmt"
"crypto/sha1"
"encoding/base64"
sgreplicate "github.com/couchbaselabs/sg-replicate"
"crypto/rand"
)
type DataStore interface {
// Creates a new user in the data store (admin port)
CreateUser(u UserCred, channelNames []string) error
// Create a sin... |
package component
import (
"os"
"path/filepath"
"strings"
"github.com/pkg/errors"
"github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2"
devfilefs "github.com/devfile/library/pkg/testingutil/filesystem"
dfutil "github.com/devfile/library/pkg/util"
"github.com/redhat-developer/odo/pkg/component"
component... |
package goldengine
import sf "github.com/manyminds/gosfml"
//Transformer : Wrapper arround sfml Transformer
type Transformer interface {
sf.Drawer
sf.Transformer
}
//TransformerPrefab : Info to create a Transformer from JSON Prefab
type TransformerPrefab struct {
Kind string
Arguments map[string]interface{}... |
// Copyright 2021 The Bazel 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 appl... |
/*
Copyright 2022 The KCP Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softwar... |
// This deals with calls coming from Second Life or OpenSimulator.
// it's essentially a RESTful thingy
package main
import (
"crypto/md5"
"database/sql"
"encoding/hex"
"fmt"
// "github.com/cznic/ql"
"net/http"
// "strconv"
"strings"
)
// GetMD5Hash takes a string which is to be encoded using MD5 and returns a ... |
// Code generated by protoc-gen-go.
// source: hello.proto
// DO NOT EDIT!
/*
Package hello is a generated protocol buffer package.
It is generated from these files:
hello.proto
It has these top-level messages:
InfoRequest
InfoReply
*/
package hello
import proto "github.com/golang/protobuf/proto"
import fmt "fmt... |
package main
import (
"fmt"
"image"
"image/color"
"image/png"
"os"
)
func main() {
if len(os.Args) < 2 {
fmt.Println("Usage: still filename")
return
}
file, _ := os.Open(os.Args[1])
image, _ := png.Decode(file)
tilemap := load(image)
// optimized := tilemap.optimize()
tilemap.print()
}
func load(ima... |
package tar
import (
"archive/tar"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"path/filepath"
"regexp"
"time"
)
// defaultTimeout is the amount of time that the untar will wait for a tar
// stream to extract a single file. A timeout is needed to guard against broken
// connections in which it would wait for a long ti... |
package main
import (
"bytes"
"encoding/json"
"fmt"
)
// Node has a key and at most two children node.
type Node struct {
Key int
Left *Node
Right *Node
}
// Tree has a root node.
type Tree struct {
Root *Node
}
// Insert insert a node to targetNode.
func (t *Tree) Insert(key int) {
if t.Root == nil {
... |
package zwift
import (
"time"
)
// dateTimeFormat used by cyclinganalytics
const datetimeFormat = `"2006-01-02T15:04:05+0000"`
// Fault represents a Zwift error
type Fault struct {
Code int `json:"code"`
Message string `json:"message"`
}
func (f *Fault) Error() string {
return f.Message
}
type Datetime s... |
package main
import (
"bufio"
"bytes"
"fmt"
"git.curoverse.com/arvados.git/sdk/go/arvadosclient"
"io"
"log"
"sync"
"time"
)
// Timestamper is the signature for a function that takes a timestamp and
// return a formated string value.
type Timestamper func(t time.Time) string
// Logging plumbing:
//
// Throttl... |
package rancher
import (
"context"
"strconv"
"strings"
"github.com/mitchellh/mapstructure"
rancherv3 "github.com/rancher/rancher/pkg/generated/controllers/management.cattle.io/v3"
ctlcorev1 "github.com/rancher/wrangler/pkg/generated/controllers/core/v1"
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachine... |
// Copyright 2016-2020 Authors of Cilium
//
// 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 go3270
import (
"errors"
"fmt"
"log"
"os/exec"
"strconv"
"strings"
"time"
)
// These constants represent the keyboard keys
const (
Enter = "Enter"
Tab = "Tab"
F1 = "PF(1)"
F2 = "PF(2)"
F3 = "PF(3)"
F4 = "PF(4)"
F5 = "PF(5)"
F6 = "PF(6)"
F7 = "PF(7)"
F8 = "PF(8)"
F9 ... |
package networks
import (
"fmt"
"github.com/rackspace/rack/internal/github.com/rackspace/gophercloud"
"github.com/rackspace/rack/internal/github.com/rackspace/gophercloud/pagination"
)
// AdminState gives users a solid type to work with for create and update
// operations. It is recommended that users use the `Up... |
// 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 urlesc implements query escaping as per RFC 3986.
// It contains some parts of the net/url package, modified so as to allow
// some reserved characte... |
package http
import (
"net"
"net/http"
"github.com/chihaya/chihaya/bittorrent"
)
// ParseOptions is the configuration used to parse an Announce Request.
//
// If AllowIPSpoofing is true, IPs provided via BitTorrent params will be used.
// If RealIPHeader is not empty string, the value of the first HTTP Header wit... |
// Copyright 2018 The Cockroach Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
// SPDX-License-Identifier: Apache-2.0
// Copyright 2018 Authors of Cilium
package clustermesh
import (
"github.com/prometheus/client_golang/prometheus"
"github.com/sirupsen/logrus"
"github.com/cilium/cilium/pkg/kvstore/store"
"github.com/cilium/cilium/pkg/lock"
"github.com/cilium/cilium/pkg/logging/logfields"
... |
package endpoints
import (
"context"
"errors"
"net/http"
"net/url"
"strconv"
"strings"
"time"
"github.com/julienschmidt/httprouter"
"github.com/prebid/prebid-server/analytics"
"github.com/prebid/prebid-server/config"
"github.com/prebid/prebid-server/gdpr"
"github.com/prebid/prebid-server/metrics"
"github... |
// Copyright 2019 The Operator-SDK 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 ... |
package kubernetes
import (
"encoding/json"
"fmt"
"strconv"
"strings"
)
// GetPodsLabels returns labels for k8s pods obtained from the given apiServer
func GetPodsLabels(cfg *APIConfig) ([]map[string]string, error) {
pods, err := getPods(cfg)
if err != nil {
return nil, err
}
var ms []map[string]string
for... |
package main
import (
"context"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"testing"
"time"
"github.com/machinebox/graphql"
"github.com/sourcegraph/sourcegraph/internal/testutil"
"golang.org/x/oauth2"
)
var (
testUpdate = flag.Bool("update", false, "update testdata golden")
te... |
// Copyright © 2019 The Things Network Foundation, The Things Industries B.V.
//
// 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
//
// Un... |
/*
Copyright 2020 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, soft... |
/*
Package main : entry point of mqtt-kube-operator.
license: Apache license 2.0
copyright: <NAME> <<EMAIL>>
*/
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"os"
"os/signal"
"strconv"
"strings"
"syscall"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
mqtt "github.com/eclipse/paho.mqt... |
// Copyright 2016 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License... |
// Copyright 2014 The Cayley 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 ap... |
/*
Copyright 2014 Outbrain 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 w... |
package chain
import (
"strconv"
"sync"
"time"
"github.com/gizo-network/gizo/helpers"
"github.com/gizo-network/gizo/cache"
"github.com/kpango/glg"
"github.com/gizo-network/gizo/core"
"github.com/gizo-network/gizo/job"
"github.com/gizo-network/gizo/job/queue"
"github.com/gizo-network/gizo/job/queue/qItem"... |
// Copyright 2014 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License... |
package models
import (
"encoding/json"
"errors"
"fmt"
"strconv"
"strings"
"time"
"github.com/astaxie/beego/logs"
kapi "k8s.io/api/core/v1"
"github.com/aaawoyucheng/wayne/src/backend/util/hack"
)
const (
TableNameDaemonSet = "daemon_set"
)
type daemonSetModel struct{}
type DaemonSetMetaData struct {
Re... |
package db
import (
"crypto/sha256"
"database/sql"
"encoding/json"
"errors"
"fmt"
sq "github.com/Masterminds/squirrel"
"github.com/concourse/concourse/atc"
"github.com/concourse/concourse/atc/db/lock"
)
var ErrResourceCacheAlreadyExists = errors.New("resource-cache-already-exists")
var ErrResourceCacheDisapp... |
/*
Copyright 2021 The Kruise 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... |
// 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 symlink_test
import (
"context"
"errors"
"io/fs"
"os"
"path/filepath"
"runtime"
"strings"
"testing"
"github.com/stretchr/testify/require"
"... |
package testutil
import (
"bytes"
"errors"
"fmt"
"io"
"sync"
"testing"
ci "gx/ipfs/QmNefBbWHR9JEiP3KDVqZsBLQVRmH3GBG2D2Ke24SsFqfW/go-libp2p/p2p/crypto"
peer "gx/ipfs/QmNefBbWHR9JEiP3KDVqZsBLQVRmH3GBG2D2Ke24SsFqfW/go-libp2p/p2p/peer"
u "gx/ipfs/QmZNVWh8LLjAavuQ2JXuFmuYH3C11xo988vSgp7UQrTRj1/go-ipfs-util"
ma... |
package logs
import (
"context"
"fmt"
"k8s.io/kubectl/pkg/cmd/logs"
"github.com/spf13/cobra"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/cli-runtime/pkg/genericclioptions"
kcmdutil "k8s.io/kubectl/pkg/cmd/util"
"k8s.io/kubectl/pkg/util/templates"
appsv1 "github.com/o... |
package cmd
import (
"bufio"
"bytes"
"errors"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"strings"
"unicode"
"cf/config"
"cf/util"
"github.com/fatih/color"
ansi "github.com/k0kubun/go-ansi"
"github.com/sergi/go-diff/diffmatchpatch"
"github.com/shirou/gopsutil/process"
)
func splitCmd(s s... |
package v1alpha1
import (
"errors"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// EDIT THIS FILE! THIS IS SCAFFOLDING FOR YOU TO OWN!
// NOTE: json tags are required. Any new fields you add must have json tags for the fields to be serialized.
// AccountClaimSpec defines the desi... |
package libpodruntime
import (
"context"
"github.com/containers/libpod/cmd/podman/cliconfig"
"github.com/containers/libpod/libpod"
"github.com/containers/libpod/pkg/cgroups"
"github.com/containers/libpod/pkg/namespaces"
"github.com/containers/libpod/pkg/rootless"
"github.com/containers/libpod/pkg/util"
"githu... |
/*
If this program is on the path of your machine you can invoke it in the following way:
protoc --plugin protoc-gen-gofake --goexample_out=package=cosi,packagePath=sigs.k8s.io/container-object-storage-interface-spec:fake cosi.proto
Requires package, and packagePath to be specified
*/
package main
import (
"fmt"
"... |
// cmd_onion.go - various onion service commands: ADD_ONION, DEL_ONION...
//
// To the extent possible under law, <NAME> and <NAME> waived
// all copyright and related or neighboring rights to this module of bulb,
// using the creative commons "cc0" public domain dedication. See LICENSE or
// <http://creativecommons.or... |
/*
Copyright 2021 Cortex 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 to in writing, softwa... |
package controllers
import (
"context"
"fmt"
"reflect"
configv1 "github.com/openshift/api/config/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/tools/record"
"k8s.io/klog/v2"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/control... |
// Copyright 2018 The Chromium 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 (
"encoding/json"
"flag"
"io"
"io/ioutil"
"log"
"os"
"os/exec"
"path/filepath"
tricium "infra/tricium/api/v1"
)
// Paths t... |
// Package cmd ...
/*
Copyright © 2020 <NAME> <<EMAIL>>
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, pu... |
package models
import (
"log"
"sync"
"time"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/internal/buffer"
"github.com/influxdata/telegraf/metric"
"github.com/influxdata/telegraf/selfstat"
)
const (
// Default size of metrics batch size.
DEFAULT_METRIC_BATCH_SIZE = 1000
// Default numbe... |
//
// Copyright 2021 <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
package jsonrpc
import (
"bufio"
"bytes"
"context"
"fmt"
"io"
"strings"
"sync"
"testing"
"time"
"github.com/stretchr/testify/require"
"go.bug.st/json... |
// Copyright 2020 ETH Zurich, Anapaya Systems
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or... |
package artifacts
import (
"context"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"testing"
artifact "github.com/argoproj/argo/v2/workflow/artifacts"
"github.com/argoproj/argo/v2/workflow/artifacts/resource"
"github.com/stretchr/testify/assert"
testhttp "github.com/stretchr/testify/http"
"github.com/stretchr/te... |
/*
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, ... |
package exec
import (
"context"
"errors"
"io"
"code.cloudfoundry.org/lager"
"code.cloudfoundry.org/lager/lagerctx"
"github.com/concourse/concourse/atc"
"github.com/concourse/concourse/atc/creds"
"github.com/concourse/concourse/atc/db"
"github.com/concourse/concourse/atc/resource"
"github.com/concourse/conco... |
package slack
import (
"encoding/json"
"errors"
)
// Block Objects are also known as Composition Objects
//
// For more information: https://api.slack.com/reference/messaging/composition-objects
// BlockObject defines an interface that all block object types should
// implement.
// @TODO: Is this interface needed?... |
package processor
import (
"fmt"
"time"
"github.com/Jeffail/benthos/v3/lib/log"
"github.com/Jeffail/benthos/v3/lib/message"
"github.com/Jeffail/benthos/v3/lib/metrics"
"github.com/Jeffail/benthos/v3/lib/response"
"github.com/Jeffail/benthos/v3/lib/types"
)
//---------------------------------------------------... |
package request
import (
"errors"
"io"
"io/ioutil"
"log"
"net/http"
"strings"
"sync"
"time"
"github.com/thrasher-/gocryptotrader/common"
)
const (
maxJobQueue = 100
maxHandles = 27
)
var request service
type service struct {
exchangeHandlers []*Handler
}
// checkHandles checks to see if there is a ha... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package sqs
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"
"github.com/aws/aws-sdk-go-v2/private/protocol/query"
)
type AddPermissionInput ... |
/*
Copyright 2020 Sorbonne Université
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 leveldb
import (
"fmt"
"github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/util"
"github.com/xuperchain/xupercore/lib/metrics"
"github.com/xuperchain/xupercore/lib/storage/kvdb"
)
var (
//ldbp = pprof.NewProfile("ldb")
//pcounter int64
)
// LDBDatabase define data structure of sto... |
package extendedjob
import (
"crypto/rand"
"encoding/hex"
"fmt"
"hash/fnv"
"strings"
ejv1 "code.cloudfoundry.org/cf-operator/pkg/kube/apis/extendedjob/v1alpha1"
"code.cloudfoundry.org/cf-operator/pkg/kube/util/context"
"go.uber.org/zap"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
apierrors "k... |
package linkscraper
import (
"fmt"
"golang.org/x/net/html"
"log"
"net"
"net/http"
"net/url"
"strings"
"sync"
"time"
)
const (
httpTimeout = time.Second * 3
goroutines = 20
chanCapacity = 10 * 1000
)
var (
NonExistingPage = &Page{
Title: "404 NOT FOUND",
}
)
type Page struct {
URL *url.URL `jso... |
// Copyright 2020 Dolthub, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
// Copyright (c) 2016 Couchbase, 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... |
/*
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, ... |
package bench
import (
"bytes"
"fmt"
"go/build"
"log"
"os"
"os/exec"
"path/filepath"
"strconv"
"strings"
"testing"
"time"
gops "github.com/mitchellh/go-ps"
"github.com/shirou/gopsutil/v3/process"
"github.com/golangci/golangci-lint/test/testshared"
)
func chdir(b *testing.B, dir string) {
if err := os... |
/*
* Copyright 2021 ByteDance 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 middleware
import (
"bytes"
"fmt"
"net/http"
"net/http/httptest"
"testing"
"time"
"github.com/google/go-cmp/cmp"
"github.com/stretchr/testify/assert"
"github.com/blacklane/go-libs/logger"
"github.com/blacklane/go-libs/logger/internal"
)
type chain []func(http.Handler) http.Handler
func (m chain) ... |
package util
import (
"fmt"
"strings"
"time"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/tools/cache"
"k8s.io... |
package main
import (
"fmt"
"math"
)
type Shaper interface {
Area() float64
}
// Square
type Square struct {
side float64
}
func (s *Square) Area() float64 { // pointer
return s.side * s.side
}
// Recangle
type Recangle struct {
Width, Height float64
}
func (r Recangle) Area() float64 { // non-pointer
retu... |
package token
import (
"bufio"
"bytes"
"fmt"
"io"
"os"
"path"
"time"
"github.com/aliyun/aliyun-oss-go-sdk/oss"
sdk "github.com/cosmos/cosmos-sdk/types"
authexported "github.com/cosmos/cosmos-sdk/x/auth/exported"
ethcrypto "github.com/ethereum/go-ethereum/crypto"
ethermint "github.com/okex/exchain/app/type... |
package main
import (
"context"
"log"
"runtime"
"sort"
"sync"
"time"
"github.com/hashicorp/go-multierror"
"github.com/gogo/protobuf/proto"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
pb "github.com/hpidcock/pub2sub/pkg/pub2subpb"
"github.com/hpidcock/pub2sub/pkg/struuid"
"github.com/... |
package pandorachain
import (
"context"
"sync"
"time"
"github.com/ethereum/go-ethereum/event"
"github.com/ethereum/go-ethereum/rpc"
"github.com/lukso-network/lukso-orchestrator/orchestrator/cache"
"github.com/lukso-network/lukso-orchestrator/orchestrator/db"
"github.com/lukso-network/lukso-orchestrator/share... |
package core
import (
"bytes"
"github.com/gorilla/websocket"
"github.com/sirupsen/logrus"
"golang.org/x/crypto/ssh"
"io"
"sync"
"time"
)
// copy data from WebSocket to ssh server
// and copy data from ssh server to WebSocket
// write data to WebSocket
// the data comes from ssh server.
type wsBufferWriter str... |
package config
import (
"errors"
"regexp"
"strconv"
"strings"
"github.com/zyedidia/tcell/v2"
)
// DefStyle is Micro's default style
var DefStyle tcell.Style = tcell.StyleDefault
// Colorscheme is the current colorscheme
var Colorscheme map[string]tcell.Style
// GetColor takes in a syntax group and returns the... |
package matchers
import "bytes"
// Png matches a Portable Network Graphics file.
func Png(in []byte) bool {
return bytes.HasPrefix(in, []byte{0x89, 0x50, 0x4E, 0x47, 0x0D, 0x0A, 0x1A, 0x0A})
}
// Jpg matches a Joint Photographic Experts Group file.
func Jpg(in []byte) bool {
return bytes.HasPrefix(in, []byte{0xFF,... |
package promtsdb
import (
"context"
"fmt"
"github.com/nuclio/logger"
"github.com/prometheus/prometheus/pkg/labels"
"github.com/prometheus/prometheus/storage"
"github.com/v3io/v3io-go-http"
"github.com/v3io/v3io-tsdb/config"
"github.com/v3io/v3io-tsdb/pkg/appender"
"github.com/v3io/v3io-tsdb/pkg/querier"
"git... |
/*
Copyright 2020 The Tekton 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, softw... |
package libvirt
import (
"fmt"
"log"
"net"
"strings"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/libvirt/libvirt-go"
"github.com/libvirt/libvirt-go-xml"
)
func waitForNetworkActive(network libvirt.Network) resource.StateRef... |
// Copyright 2019 Northern.tech AS
//
// 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 ... |
package certificate
import (
"fmt"
"testing"
time "time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
tassert "github.com/stretchr/testify/assert"
"github.com/openservicemesh/osm/pkg/announcements"
"github.com/openservicemesh/osm/pkg/messaging"
)
var _ = Describe("Test Tresor Debugger", func() {
C... |
//
// (C) Copyright 2018-2021 Intel Corporation.
//
// SPDX-License-Identifier: BSD-2-Clause-Patent
//
package server
import (
"github.com/golang/protobuf/proto"
"github.com/google/uuid"
"github.com/pkg/errors"
sharedpb "github.com/daos-stack/daos/src/control/common/proto/shared"
srvpb "github.com/daos-stack/da... |
// Copyright (c) 2021 PaddlePaddle 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.