text stringlengths 3.08k 10.4k |
|---|
package shop
import (
"context"
"time"
"github.com/GGP1/adak/internal/params"
"github.com/GGP1/adak/pkg/postgres"
"github.com/GGP1/adak/pkg/product"
"github.com/GGP1/adak/pkg/review"
"gopkg.in/guregu/null.v4/zero"
"github.com/bradfitz/gomemcache/memcache"
"github.com/jmoiron/sqlx"
"github.com/pkg/errors"
)... |
package bow
import (
"fmt"
"math"
"strings"
"github.com/ndaniels/esfragbag"
)
// Bow represents a bag-of-words vector of size N for a particular fragment
// library, where N corresponds to the number of fragments in the fragment
// library.
//
// Note that a Bow may be weighted. It is up to the fragment library ... |
package caching
import (
"context"
"testing"
"time"
"github.com/shopspring/decimal"
"github.com/stretchr/testify/mock"
"github.com/stretchr/testify/require"
"github.com/authzed/spicedb/internal/dispatch"
v1 "github.com/authzed/spicedb/pkg/proto/dispatch/v1"
"github.com/authzed/spicedb/pkg/tuple"
)
type che... |
package ignition
import (
"fmt"
"time"
"github.com/coreos/mantle/kola"
"github.com/coreos/mantle/kola/cluster"
"github.com/coreos/mantle/kola/register"
ut "github.com/coreos/mantle/kola/tests/util"
"github.com/coreos/mantle/platform"
"github.com/coreos/mantle/platform/conf"
"github.com/coreos/mantle/platform... |
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.
package quantile
import (
"fmt"
"math"
)
const (
defaultBinLimit = 4... |
// Copyright (C) 2020 Storj Labs, Inc.
// See LICENSE for copying information.
package uplink
import (
"context"
"github.com/zeebo/errs"
"golang.org/x/sync/errgroup"
"storj.io/common/memory"
"storj.io/common/rpc"
"storj.io/common/storj"
"storj.io/uplink/internal/telemetryclient"
"storj.io/uplink/private/ecc... |
package canary
import (
"context"
"fmt"
"time"
"github.com/fluxcd/flagger/pkg/apis/flagger/v1beta1"
flaggerv1beta1 "github.com/fluxcd/flagger/pkg/client/clientset/versioned/typed/flagger/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"k8s.io/apimachinery/pkg/runtime"
... |
package trace
import (
"bufio"
"context"
"io"
"net"
"time"
"github.com/golang/protobuf/proto"
"github.com/stripe/veneur/protocol"
"github.com/stripe/veneur/ssf"
)
// DefaultBackoff defaults to 10 milliseconds of initial wait
// time. Subsequent wait times will add this backoff to the time they
// wait.
const... |
package main
import (
"bufio"
"fmt"
"io"
"io/ioutil"
"net"
"net/http"
"net/url"
"os"
"os/exec"
"path/filepath"
"strconv"
"strings"
"github.com/facebookgo/freeport"
"github.com/gorilla/mux"
accesslog "github.com/mash/go-accesslog"
flag "github.com/ogier/pflag"
"github.com/stephaieDL/wdaproxy/web"
"gi... |
/*
Build with: go build -tags=bindatafs
*/
package main
import (
"fmt"
"html/template"
"log"
"net"
"net/http"
"os"
"path/filepath"
"strconv"
"strings"
"github.com/flowdev/dogs/config/bindatafs"
"github.com/flowdev/dogs/mygorm"
"github.com/flowdev/dogs/myqor"
"github.com/jinzhu/gorm"
"github.com/mattn/g... |
package main
import (
"fmt"
"log"
"net/http"
"strconv"
"strings"
"time"
"github.com/alexflint/go-arg"
"github.com/go-openapi/runtime"
"github.com/go-openapi/strfmt"
"github.com/janeczku/go-spinner"
"github.com/netlify/open-api/go/models"
"github.com/netlify/open-api/go/plumbing/operations"
"github.com/ne... |
package updater
import (
"context"
"fmt"
"path/filepath"
"github.com/bazelbuild/buildtools/build"
"github.com/bazelbuild/rules_typescript/ts_auto_deps/platform"
)
// isAllTestLibrary identifies testonly ts_libraries named "all_tests". Taze
// will register tests with these rules instead of
// ts_config/ts_deve... |
package storage
import (
"fmt"
"os"
"github.com/syndtr/goleveldb/leveldb/opt"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/stats"
"github.com/chrislusf/seaweedfs/weed/storage/backend"
"github.com/chrislusf/seaweedfs/weed/storage/needle"
"github.com/chrislusf/seaweedfs/weed/... |
package cli
import (
"encoding/hex"
"errors"
"fmt"
"os"
"path/filepath"
"strings"
"github.com/spo-next/spo/src/cipher"
"github.com/spo-next/spo/src/cipher/go-bip39"
secp256k1 "github.com/spo-next/spo/src/cipher/secp256k1-go"
"github.com/spo-next/spo/src/wallet"
gcli "github.com/urfave/cli"
)
const (
// ... |
package cert
import (
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"encoding/pem"
"regexp"
"github.com/pkg/errors"
"github.com/google/uuid"
)
const (
// ConsumerTypeExtraField is the consumer type json field in the auth session body extra.
ConsumerTypeExtraField = "consumer_type"
// AccessLevelsExtraField is t... |
package trace_test
import (
"fmt"
"os"
"strings"
"testing"
"github.com/sirupsen/logrus"
traceV1 "go.opentelemetry.io/proto/otlp/trace/v1"
"github.com/cilium/hubble-otel/common"
"github.com/cilium/hubble-otel/testutil"
"github.com/cilium/hubble-otel/trace"
)
func TestAllTraceConvModes(t *testing.T) {
log ... |
package storage
import (
"bytes"
"crypto/sha256"
"fmt"
"log"
)
// FileHash:
type FileHash []byte
// String: Return string representation from FileHash
func (h FileHash) String() string {
return string(h)
//return fmt.Sprintf("%x", h)
}
// Eq: Compare two FileHash
func (h FileHash) Eq(lhs FileHash) bool {
ret... |
// Copyright 2019 The gVisor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: user.proto
package pb
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time a... |
package models
import (
"database/sql"
"fmt"
"log"
"net/url"
"strconv"
"strings"
"github.com/jmoiron/sqlx"
_ "github.com/mattn/go-sqlite3" // sqlite driver
)
var db *sqlx.DB
// InitDB init database connection.
func InitDB(dataSourceName string) {
db = sqlx.MustConnect("sqlite3", dataSourceName)
initTables... |
// 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... |
// Licensed to LinDB under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. LinDB licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compli... |
package testingutil
import (
"fmt"
"io/ioutil"
"os"
"os/user"
"path/filepath"
"testing"
"github.com/ghodss/yaml"
"github.com/pkg/errors"
"github.com/redhat-developer/odo/pkg/preference"
clientcmdapi "k8s.io/client-go/tools/clientcmd/api"
)
// This value can be provided to set a seperate directory for user... |
package kube
import (
"bytes"
"context"
"errors"
"sync"
"text/template"
"time"
log "github.com/sirupsen/logrus"
"github.com/warpcomdev/keyproxy/internal/auth"
"github.com/warpcomdev/keyproxy/internal/clock"
)
const (
BUFFER_POOL_SIZE = 32 * 1024 // Same as default pool size for httputil.ReverseProxy
)
var... |
// Copyright 2017-2021 <NAME>. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
package requests
import (
"net"
"sync"
"github.com/caffix/stringset"
"github.com/yl2chen/cidranger"
)
var reservedCIDRs = []string{
"192.168.0.0/16",
"172.16.0.... |
package main
import (
"errors"
"flag"
"fmt"
"os"
"github.com/azohra/lyra/pkg/lcrypt"
"github.com/azohra/lyra/pkg/lfile"
"github.com/brsmsn/gware/pkg/diceware"
)
const (
helpstrenc = `
The following exmaples are all the possible options for the "encrypt" command:
lyra encrypt file
Encrypts and overides... |
/*
* 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 grpc
import (
"context"
"errors"
"strings"
"sync"
"sync/atomic"
"time"
"google.golang.org/grpc"
"google.golang.org/grpc/connectivity"
"google.golang.org/grpc/keepalive"
"google.golang.org/grpc/metadata"
)
var (
ErrStringSplit = errors.New("err string split")
ErrNotFoundClient = errors.New("not... |
package janitor
import (
"fmt"
"time"
st "github.com/dinowernli/almanac/pkg/storage"
"github.com/dinowernli/almanac/pkg/util"
pb_almanac "github.com/dinowernli/almanac/proto"
"github.com/sirupsen/logrus"
"golang.org/x/net/context"
)
// Janitor periodically takes a look at the contents in storage and may rewr... |
package config
import (
"encoding/json"
"fmt"
"io/ioutil"
"reflect"
"strings"
"github.com/infrawatch/apputils/logging"
)
//JSONConfig holds complete configuration data and metadata for configuration saved as JSON file.
type JSONConfig struct {
WithConfigBase
flat interface{}
structured map[string][]re... |
package migrate_data
import (
"fmt"
"time"
"uims/command"
"uims/command/commands/version"
"uims/internal/model"
"uims/internal/service/uuid"
"uims/pkg/color"
"uims/pkg/db"
"uims/pkg/tool"
)
var CMDMigrateCassRegisterUser = &command.Command{
UsageLine: "migrate:cass_register_user [command]", //eg:./uims migr... |
package postgres
import (
"database/sql"
"fmt"
"strconv"
"strings"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/util/errutil"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/tsdb"
"github.com/grafana/grafana/pkg/... |
package dump
import (
"context"
"fmt"
"sync"
"github.com/kong/deck/konnect"
"github.com/kong/deck/utils"
"github.com/kong/go-kong/kong"
"golang.org/x/sync/errgroup"
"golang.org/x/sync/semaphore"
)
type KonnectConfig struct {
// ID of the Kong Control Plane being managed.
ControlPlaneID string
}
func GetFr... |
package handler
import (
"context"
"encoding/json"
"github.com/astaxie/beego"
"github.com/astaxie/beego/cache"
_ "github.com/astaxie/beego/cache/redis"
"github.com/astaxie/beego/orm"
_ "github.com/gomodule/redigo/redis"
"github.com/micro/go-log"
"gowork1_ihome/IhomeWeb/models"
"gowork1_ihome/IhomeWeb/utils"... |
// Copyright 2015 Google 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.
// Command custommetric creates a custom metric and writes TimeSeries value
// to it. It writes a GAUGE measurement, which is a measure of value at a
// specific... |
package packet
import (
"github.com/go-gl/mathgl/mgl32"
"github.com/sandertv/gophertunnel/minecraft/protocol"
)
const (
InputFlagAscend = 1 << iota
InputFlagDescend
InputFlagNorthJump
InputFlagJumpDown
InputFlagSprintDown
InputFlagChangeHeight
InputFlagJumping
InputFlagAutoJumpingInWater
InputFlagSneaking
... |
package repositories
import (
"context"
"errors"
"fmt"
workloadsv1alpha1 "code.cloudfoundry.org/cf-k8s-controllers/apis/workloads/v1alpha1"
"github.com/google/uuid"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pk... |
package grpc
import (
"admin/models"
pb "admin/protos"
"context"
"errors"
"fmt"
"github.com/stripe/stripe-go/v71"
"github.com/stripe/stripe-go/v71/paymentintent"
"github.com/stripe/stripe-go/v71/paymentmethod"
)
func (s *Server) CreateOrder(ctx context.Context, in *pb.CreateOrderRequest) (*pb.CreateOrderRespo... |
package catalog
import (
"log"
"net/http"
"strconv"
"strings"
"time"
)
// CatalogMessage describes one message. The message may be part of a series or not. A message
// is one media event (audio + video recording). A message may contain information linking it to
// a series, but the message just has that metadat... |
// Copyright 2022 <NAME>
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, so... |
package net
import (
"encoding/json"
"fmt"
"net"
"os/exec"
"strings"
cmdcore "github.com/k14s/kwt/pkg/kwt/cmd/core"
ctldns "github.com/k14s/kwt/pkg/kwt/dns"
ctlkubedns "github.com/k14s/kwt/pkg/kwt/kubedns"
ctlmdns "github.com/k14s/kwt/pkg/kwt/mdns"
ctlnet "github.com/k14s/kwt/pkg/kwt/net"
"github.com/k14s/... |
package main
import (
"flag"
"fmt"
"net"
"os"
"os/signal"
"syscall"
"time"
"github.com/sbezverk/nsm2nsm/pkg/apis/serverendpoints"
customresourceclient "github.com/sbezverk/nsm2nsm/pkg/client/clientset/versioned"
"github.com/golang/glog"
"golang.org/x/net/context"
"google.golang.org/grpc"
metav1 "k8s.io/... |
package main
import (
"bufio"
"bytes"
"fmt"
"math"
"os"
)
func main() {
reader := bufio.NewReader(os.Stdin)
tc := readNum(reader)
var buf bytes.Buffer
for tc > 0 {
tc--
n := readNum(reader)
A := readNNums(reader, n)
res := solve(n, A)
buf.WriteString(fmt.Sprintf("%d\n", res))
}
fmt.Print(buf.Stri... |
package audioio
import(
"fmt"
"errors"
"os"
"github.com/go-audio/wav"
"github.com/go-audio/audio"
)
type WaveReader struct {
AudioFile
ReadBuffer *audio.IntBuffer
NumSampleFrames int
Duration float64
decoder *wav.Decoder
fileIo *os.File
}
type WaveWriter struct {
AudioFile
WriteBuffer *audi... |
package ydb
import (
"math/rand"
"sync"
"time"
)
type P2CConfig struct {
// PreferLocal reports whether p2c balancer should prefer local endpoint
// when all other runtime indicators are the same (such as error rate or
// average response time).
PreferLocal bool
// OpTimeThreshold specifies such difference b... |
package core
import (
"github.com/manishmeganathan/weave/merkle"
"github.com/manishmeganathan/weave/persistence"
"github.com/manishmeganathan/weave/utils"
"github.com/manishmeganathan/weave/wallet"
"github.com/sirupsen/logrus"
)
// A structure that represents the blockchain
type BlockChain struct {
// Represent... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package securityhub
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 GetEnabledStandardsInput struct {
_ struct{} `type:"structure"`
... |
package game
import (
"fmt"
"github.com/fatih/color"
)
type Point struct {
x int
y int
}
/*
* To create an empty reversiboard
*/
func NewReversiBoard(size int) [][]int {
board := make([][]int, size, size)
for i := 0; i < size; i++ {
board[i] = make([]int, size, size)
}
for i := 0; i < size; i++ {
for... |
package log
import (
"fmt"
"io"
"log"
stdLog "log"
"os"
"runtime"
"strings"
"github.com/emirpasic/gods/maps/hashbidimap"
)
// Level enum
const (
// LevelNone indicates that logs should not be sent to output.
LevelNone Level = iota
// LevelError indicates that error logs should be sent to output.
LevelEr... |
package udwCryptoEncryptV3
import (
"bytes"
"crypto/cipher"
"crypto/rand"
"errors"
"github.com/tachyon-protocol/udw/AesCtr"
"github.com/tachyon-protocol/udw/udwBytes"
"github.com/tachyon-protocol/udw/udwNet"
"io"
"sync"
)
const ErrMsgDecryptKey = "decrypt key error magic buf not match"
var gMagicBuf = []byt... |
package main
import (
"bytes"
"fmt"
"strconv"
"strings"
"time"
)
var bColors = map[string][]byte{
"green": {27, 91, 52, 50, 109},
"white": {27, 91, 52, 55, 109},
"yellow": {27, 91, 52, 51, 109},
"red": {27, 91, 52, 49, 109},
"blue": {27, 91, 52, 52, 109},
"magenta": {27, 91, 52, 53, 109},
"cya... |
package iavl
// NodeData groups together a key, value and depth.
type NodeData struct {
Key []byte
Value []byte
Depth uint8
}
// SerializeFunc is any implementation that can serialize
// an iavl Node and its descendants.
type SerializeFunc func(*Tree, *Node) []NodeData
// RestoreFunc is an implementation that c... |
package handlers
import (
"encoding/json"
"fmt"
"github.com/gin-gonic/gin"
"github.com/jitsucom/jitsu/server/appstatus"
"github.com/jitsucom/jitsu/server/caching"
"github.com/jitsucom/jitsu/server/events"
"github.com/jitsucom/jitsu/server/logging"
"github.com/jitsucom/jitsu/server/middleware"
"github.com/jits... |
// MIT License
//
// (C) Copyright [2022] 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 limitation
// ... |
package app
import (
"fmt"
"io/ioutil"
"os"
"sort"
"strings"
"github.com/roboll/helmfile/pkg/argparser"
"github.com/roboll/helmfile/pkg/helmexec"
"github.com/roboll/helmfile/pkg/state"
)
type Run struct {
state *state.HelmState
helm helmexec.Interface
ctx Context
ReleaseToChart map[state.PrepareChart... |
package trials
import "time"
// NineClient will be the type that will execute all rquests to the Trials Report API
type NineClient struct {
BaseURL string
}
// CurrentMap has stats for the current week of Trials of the Nine.
// This data includes the map name and the mode as well as the number
// of players, number... |
/*
Copyright 2020 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
// Copyright 2018 The gVisor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
// Copyright 2017 The go-hep 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 fwk
import (
"fmt"
"reflect"
"go-hep.org/x/hep/fwk/fsm"
)
type statuscode int
func (sc statuscode) Error() string {
return fmt.Sprintf("fwk:... |
package main
import (
"bytes"
"compress/gzip"
"context"
"encoding/json"
"io/ioutil"
"strconv"
"strings"
"time"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
const (
dataMessage = "DATA_MESSAGE"
)
type logStatus string
... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package iam
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"
)
// Please a... |
// Package writer creates a pdf file and takes care of the formatting of the
// tokens.
package writer
import (
"log"
"math"
"os"
"io"
"strings"
"github.com/mclark4386/md2pdf/parser"
"github.com/jung-kurt/gofpdf"
"github.com/jung-kurt/gofpdf/contrib/httpimg"
)
type color struct {
r, g, b int
}
// rgb funct... |
package test_services
import (
"reflect"
"testing"
cconf "github.com/pip-services3-go/pip-services3-commons-go/config"
cdata "github.com/pip-services3-go/pip-services3-commons-go/data"
cref "github.com/pip-services3-go/pip-services3-commons-go/refer"
tstclnt "github.com/pip-services3-go/pip-services3-rpc-go/tes... |
package main
import (
"bytes"
"encoding/json"
"flag"
"io/ioutil"
"log"
"net/http"
"net/url"
"regexp"
"strings"
"time"
"github.com/gocolly/colly"
"github.com/gocolly/colly/queue"
"github.com/opesun/goquery"
)
var URL = flag.String("url", "https://www.hao123.com/", "初始化网址")
var API = flag.String("api", "h... |
package disttrace
import (
"database/sql"
"errors"
)
// getSchemaVersion returns the current schema version of the database
func (db *DB) getSchemaVersion() (int, error) {
log.Debug("getSchemaVersion: Reading current schema version of database...")
// check if schema info table exists
var foundTable string
q... |
/*
* Copyright (c) 2019 <NAME> <<EMAIL>>
* Author: <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
* ... |
package ssocreds
import (
"crypto/sha1"
"encoding/hex"
"encoding/json"
"fmt"
"io/ioutil"
"path/filepath"
"strings"
"time"
"github.com/mateuszwojcikcc/aws-sdk-go/aws"
"github.com/mateuszwojcikcc/aws-sdk-go/aws/awserr"
"github.com/mateuszwojcikcc/aws-sdk-go/aws/client"
"github.com/mateuszwojcikcc/aws-sdk-go... |
package main
import (
"crypto"
"crypto/ecdsa"
"flag"
"fmt"
"io/ioutil"
"math/rand"
"os"
"strconv"
"strings"
"time"
//"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/p2p/nat"
"github.com/qjpcpu/et... |
package akNet
import (
"common/Define"
"net"
"reflect"
"sync"
"time"
"github.com/golang/protobuf/proto"
)
// add by stefan
type IMessagePack interface {
PackAction(Output []byte) (err error)
PackAction4Client(Output []byte) (err error)
PackData(msg proto.Message) (data []byte, err error)
UnPackMsg4Client(... |
package burst
import (
"context"
"fmt"
"strings"
sync "sync"
"time"
"github.com/bmclab-git/v2ray-core/v5/common/dice"
)
// HealthPingSettings holds settings for health Checker
type HealthPingSettings struct {
Destination string `json:"destination"`
Connectivity string `json:"connectivity"`
... |
package ssl
import (
"fmt"
"github.com/TeaWeb/code/teaconfigs"
"github.com/TeaWeb/code/teaweb/actions/default/proxy/proxyutils"
"github.com/iwind/TeaGo/Tea"
"github.com/iwind/TeaGo/actions"
"github.com/iwind/TeaGo/files"
"github.com/iwind/TeaGo/lists"
"github.com/iwind/TeaGo/maps"
"github.com/iwind/TeaGo/util... |
// Copyright 2016 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... |
// Copyright 2016 The LUCI 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... |
package mylogger
import (
"fmt"
"os"
"path"
"time"
)
// 往文件里面写日志
// FileLogger 文件日志结构体
type FileLogger struct {
Level LogLevel
filePath string // 日志文件保存的路径
fileName string // 日志文件保存的文件名
fileObj *os.File
errFileObj *os.File
maxFileSize int64
}
// NewFileLogger 构造函数
func NewFileLogger(level... |
// +build linux darwin
package renter
import (
"fmt"
"sync"
"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse"
"gitlab.com/NebulousLabs/errors"
"go.sia.tech/siad/modules"
)
var errNothingMounted = errors.New("nothing mounted at that path")
// A fuseManager manages mounted fuse filesystems.... |
package serv
import (
"database/sql"
"fmt"
"os"
"runtime"
"github.com/spf13/cobra"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
//go:generate rice embed-go
const (
serverName = "GraphJin"
)
var buildInfo BuildInfo
type ServConfig struct {
log *zap.SugaredLogger // logger
zlog *zap.Logger ... |
package main
import (
"bytes"
"fmt"
"net/http"
"os"
"os/exec"
"strconv"
"sync"
"github.com/gofrs/uuid"
log "github.com/sirupsen/logrus"
rconfig "github.com/Luzifer/rconfig/v2"
)
var (
cfg = struct {
Device string `flag:"input,i" default:"/dev/video0" description:"Video device to read from"`
F... |
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package storeprovider
import (
"time"
"github.com/hyperledger/fabric/common/flogging"
"github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwsetutil"
storeapi "github.com/hyperledger/fabric/extensions/coll... |
package addresstable
import (
"fmt"
"strings"
"sync"
"time"
"code.cloudfoundry.org/clock"
"code.cloudfoundry.org/lager"
)
type AddressTable struct {
addresses map[string][]entry
clock clock.Clock
stalenessThreshold time.Duration
mutex sync.RWMutex
ticker cloc... |
package stat
import (
"context"
"strconv"
"time"
"github.com/asecurityteam/runsqs"
"github.com/aws/aws-sdk-go/service/sqs"
"github.com/rs/xstats"
)
const (
consumedCounter = "sqs.consumed"
consumerSuccessCounter = "sqs.consumer_success"
consumerErrorCounter = "sqs.consumer_error"
consumed... |
package main
import (
"fmt"
"io/ioutil"
"strings"
oas3 "github.com/getkin/kin-openapi/openapi3"
"github.com/grokify/simplego/fmt/fmtutil"
"github.com/grokify/spectrum/openapi3"
"github.com/grokify/spectrum/openapi3/springopenapi3"
"github.com/rs/zerolog/log"
)
type SchemaInfo struct {
Name st... |
package manager // import "github.com/docker/infrakit/pkg/run/v0/manager"
import (
"fmt"
"os"
"strings"
"github.com/docker/infrakit/pkg/launch/inproc"
logutil "github.com/docker/infrakit/pkg/log"
"github.com/docker/infrakit/pkg/manager"
"github.com/docker/infrakit/pkg/plugin"
"github.com/docker/infrakit/pkg/r... |
// Copyright 2019 VMware, Inc.
// SPDX-License-Identifier: Apache-2.0
package upgrade
import (
"fmt"
"io/ioutil"
"time"
"github.com/blang/semver"
"github.com/go-logr/logr"
"github.com/pkg/errors"
kubernetes2 "github.com/vmware/cluster-api-upgrade-tool/pkg/internal/kubernetes"
v1 "k8s.io/api/core/v1"
metav1 ... |
// Package strutil provide some string,char,byte util functions
package strutil
import (
"bytes"
"encoding/json"
"fmt"
"strings"
"text/template"
)
// Position for padding string
const (
PosLeft uint8 = iota
PosRight
)
var (
Ltrim = TrimLeft
Rtrim = TrimRight
)
/*********************************************... |
/*
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... |
package main
import (
"fmt"
"net"
"time"
"github.com/macrat/landns/lib-landns"
"github.com/macrat/landns/lib-landns/logger"
"github.com/miekg/dns"
"gopkg.in/yaml.v2"
)
type QType uint16
func (q *QType) UnmarshalText(text []byte) error {
switch string(text) {
case "A":
*q = QType(dns.TypeA)
case "AAAA":
... |
package app
import (
"encoding/base64"
"errors"
"fmt"
"github.com/cesanta/docker_auth/auth_server/utils"
"github.com/cesanta/glog"
"math/rand"
"sort"
"strings"
"time"
)
const (
// TokenSeparator is the value which separates the header, claims, and
// signature in the compact serialization of a JSON Web Tok... |
// Copyright 2021 PingCAP, Inc. Licensed under Apache-2.0.
package virtualview
import (
"fmt"
"reflect"
"sort"
"strings"
"github.com/antonmedv/expr/ast"
"github.com/antonmedv/expr/parser"
"github.com/fatih/structtag"
"gorm.io/gorm/schema"
)
type viewFieldProps struct {
jsonNameL string // JSON... |
package types
import (
"fmt"
"math/rand"
"testing"
sdk "github.com/kingblockio/kingblock/types"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/crypto/ed25519"
)
var (
pk1 = ed25519.GenPrivKey().PubKey()
pk2 = ed25519.GenPrivKey().PubKey(... |
// memento
package main
type Memento struct {
meetName string
meetType string
meetdate string
meetLeader string
meetParticipants string
decide string
meetContent string
}
func (memento *Memento) initialize(meetName string, meetType string, meetdate stri... |
package args
import (
"path/filepath"
"testing"
test "github.com/Blesmol/pfscf/pfscf/testutils"
"github.com/Blesmol/pfscf/pfscf/utils"
)
var (
argStoreTestDir string
)
func init() {
utils.SetIsTestEnvironment(true)
argStoreTestDir = filepath.Join(utils.GetExecutableDir(), "testdata")
}
fu... |
//-----------------------------------------------------------------------------
// FILE: logger.go
// CONTRIBUTOR: <NAME>
// COPYRIGHT: Copyright (c) 2016-2019 by neonFORGE, LLC. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in complianc... |
package edit
import (
"bytes"
"fmt"
"os"
"os/exec"
"path/filepath"
"strings"
"time"
"github.com/GGP1/kure/auth"
cmdutil "github.com/GGP1/kure/commands"
"github.com/GGP1/kure/db/file"
"github.com/GGP1/kure/pb"
"github.com/GGP1/kure/sig"
"github.com/pkg/errors"
"github.com/spf13/cobra"
bolt "go.etcd.io/... |
// Copyright 2015 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.
package client
import (
"fmt"
"strings"
"golang.org/x/net/context"
"github.com/keybase/cli"
"github.com/keybase/client/go/libcmdline"
"github.com/keybase/client/go/libkb"
keybase1 "github.... |
package bring
import (
"fmt"
"image"
"image/draw"
"time"
"github.com/google/uuid"
)
var compositeOperations = map[byte]draw.Op{
0xC: draw.Src,
0xE: draw.Over,
}
type display struct {
logger Logger
cursor *layer
cursorHotspotX int
cursorHotspotY int
cursorX int
cursorY int
... |
// Copyright 2019 eBay Inc.
// Primary authors: <NAME>, <NAME>,
// <NAME>, and <NAME>.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// https://www.apache.org/licenses/... |
package main
import (
"fmt"
"github.com/anoshenko/rui"
)
const audioPlayerDemoText = `
GridLayout {
cell-height = "auto, auto, 1fr, auto", width = 100%, height = 100%,
content = [
ListLayout {
row = 0, orientation = start-to-end, padding = 4px,
content = [
Checkbox {
id = showAudioPlayerControl... |
package gisp
import (
"reflect"
p "github.com/Dwarfartisan/goparsec"
)
//Type 对象定义了一个可空的反射类型,用于 Lisp 对象定义
type Type struct {
reflect.Type
option bool
}
func (typ Type) String() string {
str := typ.Type.String()
if typ.option {
return str + "?"
}
return str
}
// Option 指示类型是否是可空的
func (typ Type) Option() ... |
package models
import (
"DeepWorkload/utils"
"encoding/json"
"fmt"
"github.com/astaxie/beego/orm"
"time"
)
type TaskPublic struct {
Code string `orm:"column(code);pk"`
StartDate int64 `orm:"column(start_date)"`
EndDate int64 `orm:"column(end_date)... |
// TheGamesDB - GetGames response
//
// Rémy 'remeh' MATHIEU © 2014
package thegamesdb
import (
"encoding/xml"
"log"
"path/filepath"
"strconv"
"strings"
"sync"
"github.com/remeh/mehtadata/model"
"github.com/remeh/mehtadata/scraper"
)
type GetGame struct {
XMLName xml.Name `xml:"Data"`
BaseImageURL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.