text stringlengths 3.08k 10.4k |
|---|
// Copyright 2020 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 agreed to i... |
// Code generated by gotdgen, DO NOT EDIT.
package tg
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
// No-op definition for keeping imports.
var (
_ = bin.Buffer{}
_ = context.Background()
_ = fmt... |
package cmd
import (
"bufio"
"fmt"
"net/http"
"os/exec"
"path/filepath"
"strings"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
"github.com/cosmos/cosmos-sdk/std"
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
"github.com/go-kit/kit/transport/http/jsonrpc"... |
package transform
import (
"fmt"
"testing"
"time"
ingestio "github.com/stellar/go/ingest/io"
"github.com/stellar/go/xdr"
"github.com/stretchr/testify/assert"
)
func TestTransformTransaction(t *testing.T) {
type inputStruct struct {
transaction ingestio.LedgerTransaction
historyHeader xdr.LedgerHeaderHis... |
package tsuru
import (
"net/http"
"net/http/httptest"
"os"
"testing"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
echo "github.com/labstack/echo/v4"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/tsuru/go-tsuruclient/pkg/tsuru"
)
func TestAccTsuruPl... |
package swarm
import (
"fmt"
"io"
"sync"
"sync/atomic"
"time"
inet "mbfs/go-mbfs/gx/QmRKbEchaYADxSCyyjhDh4cTrUby8ftXUb8MRLBTHQYupw/go-libp2p-net"
smux "mbfs/go-mbfs/gx/QmY9JXR3FupnYAYJWK9aMr9bCpqWKcToQ1tz8DVGTrHpHw/go-stream-muxer"
protocol "mbfs/go-mbfs/gx/QmZNkThpqfVXs9GNbexPrfBbXSLNYeKrE7jwFM2oqHbyqN/go-li... |
// Copyright 2012-2020 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.
// Package mount implements mounting, moving, and unmounting file systems.
package mount
import (
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
... |
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2021 The MetalLB 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 appl... |
package v1alpha1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
// 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.
// V... |
// Package api implements the random beacon and time keeping APIs.
package api
import (
"context"
"fmt"
"github.com/oasisprotocol/oasis-core/go/common/errors"
"github.com/oasisprotocol/oasis-core/go/common/pubsub"
"github.com/oasisprotocol/oasis-core/go/oasis-node/cmd/common/flags"
)
const (
// ModuleName is a... |
// The MIT License (MIT)
//
// Copyright (c) 2018 Mervin
//
// 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, mo... |
package bfd
import (
"bytes"
"encoding/binary"
"errors"
)
type (
Diagnostic uint8
State uint8
)
const (
StateAdminDown State = 0 // AdminDown
StateDown State = 1 // Down
StateInit State = 2 // Init
StateUp State = 3 // Up
DiagNone ... |
package migration
import (
"context"
addr "github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
"github.com/filecoin-project/go-state-types/big"
verifreg0 "github.com/filecoin-project/specs-actors/actors/builtin/verifreg"
adt0 "github.com/filecoin-project/specs-actors/actors/... |
// Copyright 2013-2017 Aerospike, 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 t... |
package typhoon
import (
"crypto/sha1"
"flag"
"fmt"
"go/ast"
"go/parser"
"go/token"
"io"
"os"
"path/filepath"
"regexp"
"sort"
"strings"
)
// String format placeholder regex
// Adapted from https://stackoverflow.com/a/29403060
var formatPlaceholderRegex, _ = regexp.Compile("%(?:\\x25\\x25)|(\\x25(?:(?:[1-9... |
package main
import (
"flag"
"fmt"
"log"
"os"
"strings"
"time"
. "github.com/bingoohuang/kt/pkg/kt"
"github.com/Shopify/sarama"
)
type consumeCmd struct {
conf ConsumerConfig
}
func (c *consumeCmd) run(args []string) {
c.parseArgs(args)
if _, err := StartConsume(c.conf); err != nil {
failStartup(err.E... |
// Copyright 2022 EMQ Technologies Co., Ltd.
//
// 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 cli
import (
"bufio"
"fmt"
"strconv"
"strings"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/common/hexutil"
ethcrypto "github.com/ethereum/go-ethereum/crypto"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosm... |
// Copyright 2020 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 main
import (
"bytes"
"fmt"
"unicode"
)
func main() {
Sample("Count", Count)
Sample("Fields", Fields)
Sample("FieldsFunc", FieldsFunc)
Sample("Index", Index)
Sample("IndexAny", IndexAny)
Sample("IndexByte", IndexByte)
Sample("IndexFunc", IndexFunc)
Sample("IndexRune", IndexRune)
Sample("LastIndex"... |
package engine
import (
"context"
"fmt"
"time"
"github.com/pkg/errors"
"github.com/src-d/engine/api"
"github.com/src-d/engine/components"
"github.com/src-d/engine/docker"
)
const (
startComponentTimeout = 60 * time.Second
)
// Component to be run.
type Component struct {
Name string
Start d... |
package ead
import (
"context"
"encoding/json"
"fmt"
"net/url"
"strconv"
"strings"
"time"
"github.com/OneOfOne/xxhash"
cfg "github.com/delving/hub3/config"
"github.com/delving/hub3/hub3/fragments"
elastic "github.com/olivere/elastic/v7"
"github.com/rs/zerolog"
)
// SearchRequest holds all information for... |
package archivedb
import (
"bytes"
"encoding/binary"
"io"
"os"
"sync"
"sync/atomic"
"github.com/millken/archivedb/internal/mmap"
"github.com/pkg/errors"
)
/*
+-------------+-------------+-------------+
| Hash(8B) | segment(2B) | Offset(4B) |
+-------------+-------------+-------------+
*/
const (
buck... |
package webhook
import (
"encoding/json"
"log"
"regexp"
"strconv"
"strings"
"github.com/google/go-github/v28/github"
)
var cveRegexp = regexp.MustCompile(`CVE-\d{4}-\d+`)
func (receiver *Receiver) handlePullRequest(body []byte) {
defer func() {
if r := recover(); r != nil {
log.Println(r)
}
if !rec... |
package expr
import (
"bytes"
"encoding/base64"
"errors"
"fmt"
"io"
"reflect"
"regexp"
"strings"
"github.com/spf13/cast"
"github.com/PaesslerAG/gval"
valid "github.com/asaskevich/govalidator"
)
func StringFunctions() []gval.Language {
return []gval.Language{
gval.Function("trim", strings.TrimSpace),
... |
package logtailing
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"os/signal"
"syscall"
"time"
"github.com/logrusorgru/aurora"
log "github.com/sirupsen/logrus"
"github.com/stripe/stripe-cli/pkg/ansi"
"github.com/stripe/stripe-cli/pkg/stripeauth"
"github.com/stripe/stripe-cli/pkg/websocket"
)
const outp... |
package postgresql
import (
"fmt"
"sort"
"strconv"
"strings"
"github.com/golang/groupcache/lru"
"github.com/negbie/telegraf"
"github.com/negbie/telegraf/plugins/outputs/postgresql/columns"
"github.com/negbie/telegraf/plugins/outputs/postgresql/db"
"github.com/negbie/telegraf/plugins/outputs/postgresql/utils"... |
package cron
import (
"context"
"fmt"
"github.com/kfchen81/beego"
"github.com/kfchen81/beego/orm"
"github.com/kfchen81/beego/toolbox"
"github.com/kfchen81/beego/vanilla"
"runtime/debug"
"time"
)
type CronTask struct {
name string
spec string
taskFunc toolbox.TaskFunc
onlyRunThisTask bool
}
func (this *Cr... |
package core
import (
"context"
"fmt"
"io"
"strings"
"time"
"github.com/golang-interfaces/iio"
"github.com/opctl/opctl/sdks/go/model"
"github.com/opctl/opctl/sdks/go/node/core/containerruntime"
"github.com/opctl/opctl/sdks/go/pubsub"
)
//counterfeiter:generate -o internal/fakes/containerCaller.go . containe... |
// Copyright 2016 CodisLabs. All Rights Reserved.
// Licensed under the MIT (MIT-LICENSE.txt) license.
package run
import (
"bufio"
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"strconv"
"strings"
"time"
"pkg/libs/atomic2"
"pkg/libs/log"
"pkg/redis"
"redis-shake/base"
"redis-shake/common"
"redis-shake/configur... |
package godd
import (
"errors"
"log"
"net/http"
"strings"
)
// Map type
type Map map[string]interface{}
// MapString type
type MapString map[string]string
// DeferClose struct
type DeferClose struct {
Name string
I InterfaceClose
}
type FuncEnvironment = func(secret MapString) (*Map, *[]DeferClose)
// Ha... |
package main
import (
"embed"
"io/fs"
"log"
"net"
"net/http"
"os"
"strconv"
"strings"
"sync/atomic"
"time"
_ "time/tzdata"
jsoniter "github.com/json-iterator/go"
badgerenderers "github.com/lemon-mint/badge-renderers.go"
"github.com/lemon-mint/envaddr"
"github.com/beevik/ntp"
)
var json = jsoniter.Con... |
package main
import (
"fmt"
"io"
"os/exec"
"path/filepath"
"strings"
"text/template"
"golang.org/x/tools/go/packages"
)
func goMacBind(gobind string, pkgs []*packages.Package, archs []string) error {
// Run gobind to generate the bindings
fmt.Println("\tHere", 0)
cmd := exec.Command(
gobind,
"-lang=go,... |
// 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 ag... |
package product
import (
"context"
"fmt"
"github.com/gingerxman/eel"
"strings"
)
type EncodePoolProductService struct {
eel.ServiceBase
}
func NewEncodePoolProductService(ctx context.Context) *EncodePoolProductService {
service := new(EncodePoolProductService)
service.Ctx = ctx
return service
}
//Encode 对单个... |
package semver
import (
"fmt"
"regexp"
"strings"
"unicode"
)
type comparator func(Version, Version) bool
var (
compEQ comparator = func(v1 Version, v2 Version) bool {
return v1.Compare(v2) == 0
}
compNE = func(v1 Version, v2 Version) bool {
return v1.Compare(v2) != 0
}
compGT = func(v1 Version, v2 Versi... |
package main
import (
"bufio"
"encoding/json"
"github.com/joho/godotenv"
"gopkg.in/yaml.v2"
"io/ioutil"
"log"
"net"
"net/http"
"os"
"strings"
"sync"
)
var envlist = map[string]string{}
var mutex = &sync.RWMutex{}
var dirname = "./fsdir"
func sanitizePath(v string) string {
ret := strings.Replace(v, "..",... |
package btc
import (
"bytes"
"encoding/hex"
"errors"
"fmt"
"github.com/btcsuite/btcd/btcjson"
"github.com/btcsuite/btcd/chaincfg"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/rpcclient"
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btcuti... |
package controllers
import (
"context"
"fmt"
"time"
"github.com/actions-runner-controller/actions-runner-controller/api/v1alpha1"
"github.com/go-logr/logr"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
kerrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/types"
ctrl "sigs.k8s.io/c... |
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net"
"net/http"
"strings"
"github.com/elazarl/goproxy"
"github.com/pkg/errors"
cipher "github.com/xxzl0130/GF_Kalina/GF_cipher"
"github.com/xxzl0130/GF_Kalina/pkg/util"
)
func main() {
gf := &GF{
ch: make(chan respons... |
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdjson"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
// No-op definition for keeping imports.
var (
_ = bin.Buffer{}
_... |
package diff
import (
"fmt"
"reflect"
)
//ChangeValue is a specialized struct for monitoring patching
type ChangeValue struct {
parent *reflect.Value
target *reflect.Value
flags PatchFlags
change *Change
err error
pos int
index int
key reflect.Value
}
//swap swaps out the target as we move down ... |
package main
import (
"context"
"flag"
"fmt"
"io"
"os"
"os/signal"
"path/filepath"
"syscall"
"time"
"github.com/irekovic/go-sync/metadata"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/fsnotify/fsnotify"
_ "github.com/mattn/go-sqlite3"
"gocloud.dev/blob"
_ "gocloud.dev/blob/azurebl... |
package http
import (
"fmt"
"net/http"
"net/http/httputil"
"net/url"
"path"
"strings"
"sync"
"github.com/pachyderm/pachyderm/src/client"
"github.com/pachyderm/pachyderm/src/client/auth"
"github.com/pachyderm/pachyderm/src/server/pkg/errutil"
"github.com/gogo/protobuf/types"
"github.com/julienschmidt/http... |
package time
import (
"time"
"github.com/docker/infrakit/pkg/launch/inproc"
logutil "github.com/docker/infrakit/pkg/log"
"github.com/docker/infrakit/pkg/plugin"
metadata_plugin "github.com/docker/infrakit/pkg/plugin/metadata"
"github.com/docker/infrakit/pkg/run"
"github.com/docker/infrakit/pkg/run/scope"
"git... |
package domain
import (
"cftools-relay/internal/stringutil"
"strings"
"time"
)
const (
ComparatorEquals = "eq"
ComparatorGreaterThan = "gt"
ComparatorLessThan = "lt"
ComparatorContains = "contains"
ComparatorStartsWith = "startsWith"
ComparatorEndsWith = "endsWith"
ComparatorOneOf = "on... |
package derive
import (
"encoding/binary"
"fmt"
"math/big"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/ethereum/go-ethereum/crypto"
"github.com/holiman/uint256"
)
var (
DepositEventABI = "TransactionDeposited(address,address,uint256,uint256,uint64,boo... |
// +build codegen
// Copyright 2014-2016 Amazon.com, Inc. or its affiliates. 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. A copy of the
// License is located at
//
// http://aws.amazon.com/apache2.0/
//
//... |
package datasource
import (
"bufio"
"bytes"
"compress/gzip"
"database/sql/driver"
"encoding/json"
"io"
"os"
"strings"
u "github.com/araddon/gou"
"github.com/araddon/qlbridge/expr"
"github.com/araddon/qlbridge/schema"
"github.com/araddon/qlbridge/value"
)
var (
_ schema.Source = (*JsonSource)(nil)
... |
package ic
import (
"encoding/json"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"testing"
"time"
)
var debtNil *Debt = nil
var _ Modeler = debtNil
var _ json.Marshaler = debtNil
var _ json.Unmarshaler = debtNil
var itemNil *Item = nil
var _ Modeler = itemNil
var _ json.Marshaler =... |
package service
import (
"fmt"
"math"
"time"
"github.com/keiko233/V2Board-Bot/lib/rand"
"github.com/keiko233/V2Board-Bot/model"
"github.com/keiko233/V2Board-Bot/utils"
)
var fortuneTraffer map[model.FortuneType][]int64
var fortuneList []model.FortuneType
var pool []float64
func GetFortune(tgid int64) (model.F... |
package bigo
import (
"fmt"
"net/http"
"strings"
)
const (
stsHeader = "Strict-Transport-Security"
stsSubdomainString = "; includeSubdomains"
frameOptionsHeader = "X-Frame-Options"
frameOptionsValue = "DENY"
contentTypeHeader = "X-Content-Type-Options"
contentTypeValue = "nos... |
package main
import (
"github.com/bringdesk/bringdesk/ctx"
"github.com/bringdesk/bringdesk/evt"
"github.com/bringdesk/bringdesk/skin"
"github.com/bringdesk/bringdesk/smarthome"
"github.com/bringdesk/bringdesk/util"
"github.com/bringdesk/bringdesk/widgets"
"github.com/veandco/go-sdl2/img"
"github.com/veandco/go... |
package centrify
import (
"fmt"
"reflect"
"strings"
"github.com/biter777/countries"
"github.com/centrify/terraform-provider-centrify/centrify/internal/hashcode"
vault "github.com/centrify/terraform-provider-centrify/cloud-golang-sdk/platform"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)
func co... |
package utils
import (
"bytes"
"crypto/rand"
"encoding/json"
"fmt"
"log"
"math"
"math/big"
"os"
"os/exec"
"path/filepath"
"strings"
"time"
"github.com/parnurzeal/gorequest"
"golang.org/x/xerrors"
pb "gopkg.in/cheggaaa/pb.v1"
)
func CacheDir() string {
cacheDir, err := os.UserCacheDir()
if err != nil... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: errors/business_error.proto
package errors
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
// Thi... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: github.com/infobloxopen/atlas-app-toolkit/rpc/errdetails/error_details.proto
/*
Package errdetails is a generated protocol buffer package.
It is generated from these files:
github.com/infobloxopen/atlas-app-toolkit/rpc/errdetails/error_details.proto
It has... |
package cmd
import (
"bytes"
"context"
"log"
"os"
"os/exec"
"strings"
"time"
"github.com/gobuffalo/buffalo/genny/build"
"github.com/gobuffalo/genny/v2"
"github.com/gobuffalo/logger"
"github.com/gobuffalo/meta"
"github.com/markbates/sigtx"
"github.com/spf13/cobra"
)
var buildOptions = struct {
*build.Op... |
package sphinx
import (
sha256 "github.com/minio/sha256-simd"
"github.com/pkt-cash/pktd/btcutil/er"
)
const (
// HashPrefixSize is the size in bytes of the keys we will be storing
// in the ReplayLog. It represents the first 20 bytes of a truncated
// sha-256 hash of a secret generated by ECDH.
HashPrefixSize ... |
package workmgr
import (
"sync"
"time"
"github.com/fireeye/gocrack/server/storage"
"github.com/fireeye/gocrack/shared"
"github.com/tchap/go-exchange/exchange"
)
// ChannelTopic is a PUB/SUB topic that defines a type of event
type ChannelTopic exchange.Topic
var (
// EngineStatusTopic is the topic for all eng... |
package consensusstatemanager
import (
"github.com/kaspanet/kaspad/domain/consensus/model"
"github.com/kaspanet/kaspad/domain/consensus/model/externalapi"
"github.com/kaspanet/kaspad/infrastructure/logger"
)
// AddBlock submits the given block to be added to the
// current virtual. This process may result in a new... |
package service
import (
"encoding/json"
"github.com/patrickmn/go-cache"
uuid "github.com/satori/go.uuid"
"platform_report/dao"
"platform_report/lib"
"platform_report/pkg/util"
"strings"
"time"
)
type TargetService struct {
prefix string
}
type Cards struct {
CardName string `json:"card_name"`
GraphId st... |
// Copyright 2016 CodisLabs. All Rights Reserved.
// Licensed under the MIT (MIT-LICENSE.txt) license.
package main
import (
"bufio"
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"time"
"github.com/CodisLabs/codis/pkg/utils/log"
"github.com/CodisLabs/codis/pkg/utils/sync2/atomic2"
"github.com/CodisLabs/redis-port/pk... |
package yqlib
import (
"fmt"
"strconv"
"strings"
"time"
yaml "gopkg.in/yaml.v3"
)
func createAddOp(lhs *ExpressionNode, rhs *ExpressionNode) *ExpressionNode {
return &ExpressionNode{Operation: &Operation{OperationType: addOpType},
LHS: lhs,
RHS: rhs}
}
func addAssignOperator(d *dataTreeNavigator, context ... |
// Package main implements a parser for Thrift files (https://thrift.apache.org/)
//
// It parses namespaces, exceptions, services, structs, consts, typedefs and enums, but is easily
// extensible to more.
//
// It also supports annotations and method throws.
package main
import (
"fmt"
"os"
"strings"
"gopkg.in/a... |
package bird
import (
"time"
"github.com/lindsaygelle/nook"
"github.com/lindsaygelle/nook/animal"
"github.com/lindsaygelle/nook/character"
"github.com/lindsaygelle/nook/gender"
"github.com/lindsaygelle/nook/personality"
"golang.org/x/text/language"
)
var (
jacquesBirthday = nook.Birthday{
Day: 22,
Mont... |
package kama
import (
"fmt"
"go/types"
"strings"
"golang.org/x/tools/go/packages"
"golang.org/x/tools/go/types/typeutil"
)
const (
packageNeeds = packages.NeedName |
packages.NeedImports |
packages.NeedTypes
)
// pak represents a Go package
type pak struct {
Name string
Constants []string
Variable... |
package postgres
import (
"context"
"fmt"
"testing"
"time"
"github.com/jackc/pgx/v4"
"github.com/jackc/pgx/v4/pgxpool"
"github.com/stretchr/testify/assert"
"github.com/stone-co/the-amazing-ledger/app"
"github.com/stone-co/the-amazing-ledger/app/domain/instrumentators"
"github.com/stone-co/the-amazing-ledge... |
// Copyright 2016 The appc 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 t... |
package main
import (
"context"
"fmt"
"net"
"os"
"os/signal"
"syscall"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"google.golang.org/grpc"
grpccereal "github.com/chef/automate/api/interservice/cereal"
"github.com/chef/automate/components/cereal... |
// Copyright 2017 gf Author(https://github.com/gogf/gf). All Rights Reserved.
//
// This Source Code Form is subject to the terms of the MIT License.
// If a copy of the MIT was not distributed with this file,
// You can obtain one at https://github.com/gogf/gf.
//
// Package gipv4 provides useful API for IPv4 address... |
package indicators
import (
"errors"
"github.com/jaybutera/gotrade"
)
// An Exponential Moving Average Indicator (Ema), no storage, for use in other indicators
type EmaWithoutStorage struct {
*baseIndicatorWithFloatBounds
// private variables
periodTotal float64
periodCounter int
multiplier float64
prev... |
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use ... |
package main
import (
"fmt"
"log"
"runtime"
"strings"
"time"
"github.com/carbocation/bgen"
"github.com/carbocation/genomisc/applyprsgcp/prsworker"
"github.com/carbocation/genomisc/prsparser"
)
func AccumulateScore(bgenPath string, sites []bgen.VariantIndex) ([]Sample, error) {
// At least one site is valid
... |
// Copyright 2019 The bigfile Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package models
import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strconv"
"strings"
"time"
"github.com/bigfile/bigfile/confi... |
// Copyright (c) 2020 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the Lice... |
// This package aims to wrap Go HTTP Client's request-response with sane defaults:
//
// - You are forced to consider timeouts by having to specify Context
// - Instead of not considering non-2xx status codes as a failure, check that by default
// (unless explicitly asked to)
// - Sending and receiving JSON requires ... |
package models
import (
"time"
"github.com/libsv/go-bc/spv"
"github.com/libsv/go-bt/v2"
)
type P4PayRequest struct {
PayToURL string `json:"payToURL"`
}
// Output message used in BIP270.
// See https://github.com/moneybutton/bips/blob/master/bip-0270.mediawiki#output
type Output struct {
// Amount is the numbe... |
/*
Package timesortedlist is a package of a data structure storing time series data.
It's goal is to store data such as logs, sequence, ... that should be ordered.
Feature
- in memory time series data store
- any data sorted in time series
- query data using from or until in unixtime
Usage
Here is a simple us... |
// Copyright 2020 CUE 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 ... |
// Copyright 2017, The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE.md file.
package main
import (
"context"
"fmt"
"sort"
"strings"
"sync"
"sync/atomic"
"time"
"github.com/dsnet/golib/unitconv"
)
type packetLogger struct {... |
// Copyright 2016 The Gosl 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 rnd
import (
"math"
"gosl/utl"
)
// LatinIHS implements the improved distributed hypercube sampling algorithm.
// Note: code developed by <NAME> ... |
/*
Package logs implements simple hierarchical logging functionality for debugging and
logging. The package can write to any configured logger, but generally writes to stdout
for use with system logging. The log level specifies the verbosity of the output. For
example if the level is set to Info, then Debug and Trace m... |
package manager
import (
"context"
"encoding/json"
"io/ioutil"
"os"
"strconv"
"sync"
"time"
"github.com/LyridInc/go-sdk"
sdkModel "github.com/LyridInc/go-sdk/model"
"github.com/go-kit/kit/log/level"
"lyrid-sd/logger"
"lyrid-sd/model"
"lyrid-sd/route"
"lyrid-sd/utils"
)
type NodeManager struct {
Start... |
package node
import (
"net/http"
"github.com/emicklei/go-restful"
"fmt"
"github.com/liuliuzi/stf/pkg"
"golang.org/x/net/context"
"strings"
//"encoding/json"
//"github.com/bitly/go-simplejson"
//"github.com/emicklei/go-restful/swagger"
)
type NodeService struct {
// normally one would use DAO (data access obj... |
package module
import (
"container/list"
"fmt"
"strings"
"time"
log "github.com/sirupsen/logrus"
"github.com/skeletongo/cube/base"
"github.com/skeletongo/cube/tools"
)
// Module 自定义模块,实现应用层功能
type Module interface {
// Name 模块名称
Name() string
// Init 模块初始化方法
Init()
// Update 模块执行方法
// 注意此方法不能有耗时操作,否则... |
// Copyright 2022 Chainguard, 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 t... |
// MIT License
//
// (C) Copyright [2019, 2021] Hewlett Packard Enterprise Development LP
//
// 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 limitati... |
// The MIT License
//
// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved.
//
// Copyright (c) 2020 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Soft... |
// Code generated by GoVPP's binapi-generator. DO NOT EDIT.
// source: binapis/vpp1908/.vppapi/core/policer.api.json
/*
Package policer is a generated VPP binary API for 'policer' module.
It consists of:
4 messages
2 services
*/
package policer
import (
"bytes"
"context"
"io"
"strconv"
api "git.fd.io/gov... |
// Copyright 2021, Shulhan <<EMAIL>>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
// Program trunks provide an example how to use the Trunks module.
//
package main
import (
"flag"
"os"
"os/signal"
"strings"
"syscall"
"time"
"... |
package facade
import (
"encoding/json"
"fmt"
"math/rand"
"runtime"
"github.com/goark/errs"
"github.com/goark/gimei-cli/all"
"github.com/goark/gocli/exitcode"
"github.com/goark/gocli/rwi"
"github.com/goark/mt/mt19937"
"github.com/goark/mt/secure"
"github.com/spf13/cobra"
)
var (
//Name is applicatin name... |
// Copyright 2018 <NAME> (<EMAIL>)
//
// 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 clients
import (
"encoding/json"
"net/http"
"strconv"
"github.com/gwos/tcg/sdk/clients"
"github.com/rs/zerolog/log"
)
const (
apiPath = "api/"
savedObjectsPath = "saved_objects/"
findPath = "_find"
bulkGetPath = "_bulk_get"
)
type KibanaSavedObjectType string
const (
StoredQ... |
/*
Copyright 2017 Nike 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, software
distrib... |
package sidecar
import (
"context"
"flag"
"fmt"
"hash/crc32"
"io/ioutil"
"log"
"os"
"os/exec"
"path/filepath"
"runtime"
"strconv"
"time"
"golang.org/x/mod/semver"
"github.com/buildbuddy-io/buildbuddy/cli/download"
bblog "github.com/buildbuddy-io/buildbuddy/cli/logging"
)
const (
windowsOSName ... |
// The MIT License
//
// Copyright (c) 2020 Temporal Technologies Inc. All rights reserved.
//
// Copyright (c) 2020 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Soft... |
package core
import (
"sync"
"testing"
"time"
"github.com/google/uuid"
"github.com/jrapoport/gothic/core/context"
"github.com/jrapoport/gothic/core/events"
"github.com/jrapoport/gothic/core/validate"
"github.com/jrapoport/gothic/models/types"
"github.com/jrapoport/gothic/models/types/key"
"github.com/stretc... |
package models
import (
"encoding/json"
"fmt"
"strings"
"github.com/nanobox-io/nanobox/util"
)
type (
// Component ...
Component struct {
// the docker id
ID string `json:"id"`
AppID string `json:"app_id"`
EnvID string `json:"env_id"`
// name is used for boltdb storage
Name string `json:"name"... |
package mailimage
import (
"fmt"
"math/rand"
"os"
"path"
"strconv"
"strings"
"time"
"github.com/gomodule/redigo/redis"
"golang.org/x/xerrors"
)
type pool struct {
redis.Pool
}
// newPool creates a new redis pool
func newPool(addr string) (*pool, error) {
p := pool{redis.Pool{
MaxActive: 100,
Wait: ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.