text stringlengths 3.08k 10.4k |
|---|
// MIT License
//
// Copyright (c) 2021 Lack
//
// 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,... |
/*
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... |
// Copyright 2020 The GMC Author. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
// More infomation at https://github.com/snail007/gmc
package gmccontroller
import (
"fmt"
gmcconfig "github.com/snail007/gmc/config"
gmccore "github.com/sn... |
package main
import (
"net"
"net/http"
"time"
"crypto/tls"
"sync"
"io"
"io/ioutil"
"log"
)
const (
defaultTimeout = 30 * time.Second
defaultMaxIdleConnections = 100
defaultWarheads = 100
noFollow = -1
)
// Missile is a wrapper of http.Client and some properties
// A mis... |
// Copyright 2018 The margo 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 (
"bytes"
"flag"
"fmt"
"log"
"net"
"net/http"
"sync"
"time"
"github.com/sbinet/margo/daq"
"golang.org/x/net/websocket"
"gonu... |
package logger
import (
"context"
"os"
"sort"
"sync"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
var once sync.Once
var stdout Logger
const (
defaultLevel = zapcore.InfoLevel
)
type Field = zapcore.Field
type Level = zapcore.Level
type Encoder = zapcore.Encoder
type EncoderConfig = zapcore.EncoderConfig
... |
package routing
import (
"context"
"fmt"
"net"
"regexp"
//nolint:depguard // sys/unix does not have NetlinkRIB
"syscall"
"unsafe"
"github.com/datawire/dlib/dexec"
"github.com/telepresenceio/telepresence/v2/pkg/iputil"
)
const findInterfaceRegex = `^[0-9.]+(\s+via\s+(?P<gw>[0-9.]+))?\s+dev\s+(?P<dev>[a-z0-9... |
package password
import (
"bytes"
"crypto/rand"
"encoding/hex"
"fmt"
"path/filepath"
"text/template"
"github.com/cybozu-go/moco/pkg/constants"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// passwordVersion is the current secret format version for MySQL passwords.
const passwo... |
/*
Example compress-events shows how to manipulate the xevent package's event
queue to compress events that arrive more often than you'd like to process
them. This example in particular shows how to compress MotionNotify events,
but the same approach could be used to compress ConfigureNotify events.
Note that we show ... |
package storage
import (
"context"
"io"
"log"
"math"
"github.com/blugelabs/bluge"
"github.com/blugelabs/bluge/index"
"github.com/blugelabs/bluge/search"
"github.com/n-creativesystem/docsearch/logger"
)
type Index interface {
Close() error
Search(request *bluge.TopNSearch) (*SearchResponse, error)
Update(d... |
// Copyright 2019 OmiseGO Pte 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 or agreed to... |
package main
import (
"bytes"
"fmt"
"regexp"
"text/template"
"github.com/gogo/protobuf/protoc-gen-gogo/descriptor"
"github.com/gogo/protobuf/vanity/command"
"github.com/trist725/mgsu/pb/plugin"
)
const t = `
{{range .Enums}}
////////////////////////////////////////////////////////////////////////////////////... |
// Copyright 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by appl... |
package mem
import (
"bytes"
"context"
"math"
"strconv"
"strings"
"github.com/pkg/sftp"
"github.com/stephane-martin/gopsutil/internal/common"
"golang.org/x/crypto/ssh"
)
type VirtualMemoryExStat struct {
ActiveFile uint64 `json:"activefile"`
InactiveFile uint64 `json:"inactivefile"`
}
func VirtualMemory... |
package vod
//创建转码模板 https://cloud.tencent.com/document/product/266/9910
type CreateTranscodeTemplateArgs struct {
Name string `qcloud_arg:"name"`
Comment string `qcloud_arg:"comment"`
Container string `qcloud_arg:"container"`
IsFiltrateVideo int `qcloud_arg:"isFiltrateVideo"`
... |
package widgets
import (
"github.com/gizak/termui/v3"
"image"
)
// TextBox main text box struct.
type TextBox struct {
termui.Block
WrapText bool
TextStyle termui.Style
CursorStyle termui.Style
ShowCursor bool
ID string
text [][]termui.Cell
cursorPoint image.Point
}
// TextBoxTheme te... |
package webrtc
import (
"errors"
"fmt"
"math"
"sync"
"github.com/pions/datachannel"
"github.com/pions/sctp"
)
const sctpMaxChannels = uint16(65535)
// RTCSctpTransport provides details about the SCTP transport.
type RTCSctpTransport struct {
lock sync.RWMutex
dtlsTransport *RTCDtlsTransport
// State repr... |
package dag
//go:generate stringer -type=Type,status -output=node.stringer.go
import (
"bytes"
"fmt"
"io"
"strings"
)
const (
// TypeMiddle represents the node type located in the middle of the graph.
TypeMiddle Type = iota
// TypeBeginning represents the node type that indicates beginning of the graph.
Type... |
package etcd
/*
ETCD键值监听器
*/
import (
"context"
"errors"
"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/mvcc/mvccpb"
"sync"
"time"
)
var (
timeOut = time.Duration(3) * time.Second // 超时
)
// Listener对外通知接口
// key是键(以字节为单位)。不允许使用空键。
// value是key保存的值,以字节为单位。
// version是key的版本version。删除会将version重置为零... |
// Copyright 2021 <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 writi... |
package main
import (
"github.com/apex/log"
"github.com/google/go-github/github"
"github.com/apex/log/handlers/cli"
"os"
"strings"
"fmt"
"bufio"
"strconv"
"net/http"
"github.com/mitchellh/ioprogress"
"time"
"io"
"runtime"
"net/url"
"path"
"flag"
)
func init() {
log.SetHandler(cli.Default)
}
const US... |
// Copyright (c) 2020 Tigera, Inc. All rights reserved.
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applica... |
// Copyright 2021 Gravitational 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 agree... |
/* The copyright in this software is being made available under the BSD
* License, included below. This software may be subject to other third party
* and contributor rights, including patent rights, and no such rights are
* granted under this license.
*
* Copyright (c) 2012-2013, H265.net
* All rights rese... |
package protocol
//TODO: Handle errors
import (
"bytes"
"encoding/binary"
"encoding/json"
"reflect"
"github.com/olsdavis/goelan/util"
"github.com/olsdavis/goelan/world"
)
type ChatComponent struct {
Text string `json:"text"`
}
type Response struct {
data *bytes.Buffer
}
// NewResponse creates a new respons... |
// Copyright © 2019 Annchain Authors <EMAIL ADDRESS>
//
// 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 applicab... |
package sql
import (
"github.com/go-pg/pg"
"go.uber.org/zap"
"time"
)
type AppRelease struct {
tableName struct{} `sql:"app_release"`
Id int `sql:"id,pk"`
AppId int `sql:"app_id,notnull"` //orchestrator appId
EnvironmentI... |
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"os"
"github.com/docker/docker/client"
"github.com/jessfraz/contained.af/version"
"github.com/sirupsen/logrus"
)
const (
// BANNER is what is printed for help/info output
BANNER = ` _ _ ... |
// Copyright 2020 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
// Copyright (c) 2020 <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... |
// 环形缓冲
package buff
//
import (
"errors"
"io"
"sync/atomic"
)
// 错误码
var (
ErrWriteNone = errors.New("RingBuff: write none")
ErrFull = errors.New("RingBuff: full")
)
// io vector
type IoVector struct {
Buff0 []byte // read_head
Buff1 []byte // root
}
// 大小
func (iov *IoVector) Si... |
package gather
import (
"fmt"
"log"
"sort"
"strings"
"time"
"errors"
"regexp"
"strconv"
"github.com/hpcloud/tail"
"github.com/open-falcon/agent/g"
"github.com/open-falcon/common/model"
)
func NewGatherWorker(gf *GatherFile) *GatherWorker {
return &GatherWorker{
GFile: gf,
ReadPos: 0,
}
}
//
fun... |
package types
import (
"errors"
"fmt"
"math"
"testing"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/require"
)
func TestEncodeItemID(t *testing.T) {
for _, tc := range []struct {
desc string
uintID uint64
}{
{desc: "Valid1", uintID: 12031028235},
{desc: "Valid2", uintID: 2... |
package assis
import (
"fmt"
"go.uber.org/zap"
"io/fs"
"path/filepath"
"strings"
"sync"
"time"
)
const HTML = ".html"
const MD = ".md"
type PluginRender interface {
OnRender(AssisTemplate, SiteFiles, Templates) error
}
type PluginGeneratedFiles interface {
AfterGeneratedFiles([]string) error
}
type Plugin... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package computing
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/nifcloud/nifcloud-sdk-go/internal/nifcloudutil"
)
type NiftyUpdateAutoScalingGroupInput struct {
_ struct{} `type:"structure"`
// AutoScalingGroupName... |
// Package pkgdoc prepares package documentation from source.
package pkgdoc
import (
"bytes"
"go/ast"
"go/build"
"go/doc"
"go/parser"
"go/printer"
"go/token"
"go/types"
"html/template"
"io/ioutil"
"os"
"path/filepath"
"golang.org/x/tools/go/loader"
)
// Package represents package documentation.
type Pa... |
package main
import (
"fmt"
"log"
"os"
"os/exec"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/jpillora/backoff"
"github.com/pkg/errors"
)
func volumeFromName(svc *ec2.EC2, volumeName, az string) (*ec2.Volume, er... |
// Package rabingamal combines the asymmetric algorithms Rabin and ElGamal.
package rabingamal
// File prime.go implements various prime and crypto utils.
import (
"math/big"
"math/rand"
"time"
)
// Useful handles.
var bigZero = big.NewInt(0)
var bigOne = big.NewInt(1)
var bigTwo = big.NewInt(2)
var bigThree = bi... |
/*
* Copyright (C) 2019-Present Pivotal Software, Inc. All rights reserved.
*
* This program and the accompanying materials are made available under the terms
* of 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 Licens... |
package main
import (
"bufio"
"encoding/csv"
"encoding/json"
"html/template"
"log"
"net/http"
"os"
"os/signal"
"strconv"
"strings"
"syscall"
"time"
)
type Data struct {
Date time.Time
Iso_a2 string
Iso_a3 string
Currency_code string
Name string
Local_price *float64
... |
package main
import (
"bufio"
"fmt"
"log"
"math"
"os"
"sort"
"time"
)
type Node struct {
X, Y, RiskLevel, MinRiskToStart int
PathBack *Node
Visited bool
Connections []*Node
}
var data []string
func preCompute() {
file, err := os.Open("in... |
// Copyright 2015 - 2017 <NAME>
// Copyright 2015 - 2017 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-... |
package jsonmessage
import (
"encoding/json"
"fmt"
"strconv"
"time"
"github.com/silverstagtech/loggos/shared"
)
var (
// JSONTimeStampKey is used to write the time stamp in json messages
JSONTimeStampKey = "timestamp"
// JSONLevelKey is used to write the log message concern level.
JSONLevelKey = "level"
//... |
package main
import (
"bytes"
"crypto/sha256"
"time"
"fmt"
"math/big"
"math"
"encoding/binary"
"encoding/gob"
"log"
)
const targetBits = 12
const maxNonce = math.MaxInt64
type Block struct {
Timestamp int64
Data []byte
PrevBlockHash []byte
Hash []byte
Nonce int
}
type Blockchain struct {
tip []byte
... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: lucky.proto
package ui
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
type LuckyInfo stru... |
// Copyright 2016 The G3N 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 math32
import "errors"
// Matrix3 is 3x3 matrix organized internally as column matrix
type Matrix3 [9]float32
// NewMatrix3 creates and returns a po... |
package lfs
import (
"fmt"
"sync"
"sync/atomic"
"github.com/github/git-lfs/vendor/_nuts/github.com/cheggaaa/pb"
)
type Transferable interface {
Check() (*ObjectResource, *WrappedError)
Transfer(CopyCallback) *WrappedError
Object() *ObjectResource
Oid() string
Size() int64
SetObject(*ObjectResource)
}
// T... |
// Code generated by go-swagger; DO NOT EDIT.
package operations
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.c... |
// Here we GO!
// Thanks: http://learnxinyminutes.com/docs/go/
// Use package "main" to denote an executable, rather than a library
package main
// Reference libraries using import
import (
"fmt" // Text formatting
"net/http" // Basic web server
"strconv" // String conversion
)
// Main is the entry point
fu... |
package main
import (
"encoding/csv"
"encoding/json"
"flag"
"fmt"
"io"
"log"
"net/http"
"os"
"sync"
"time"
)
type Archive struct {
*ArchiveResult
Error string `json:"error,omitempty"`
}
type Site struct {
Href string `json:"href"`
Coords string `json:"coords"`
Title string `json:"title"`
Res... |
package bar
import (
"bufio"
"bytes"
"fmt"
"io"
"math"
"os"
"strings"
)
type tokens []token
type token interface {
debug(*Bar) string
print(*Bar) string
}
type tokenFormat struct {
stream *bufio.Reader
}
type spaceToken struct{}
type barToken struct{}
type percentToken struct{}
type rateToken struct{}
ty... |
// 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 ftx_ws
import (
"context"
"encoding/json"
"fmt"
"github.com/aibotsoft/crypto-collector/pkg/config"
"github.com/gorilla/websocket"
"go.uber.org/zap"
"time"
)
var (
pingMsg *websocket.PreparedMessage
pingStart time.Time
subscribeStart time.Time
)
type WsClient struct {
cfg *config.Co... |
package main
import (
"bytes"
"os/exec"
"strconv"
"strings"
"time"
"github.com/decred/dcrd/chaincfg/chainhash"
"github.com/decred/dcrd/dcrutil"
"github.com/decred/dcrd/rpcclient"
"github.com/decred/dcrd/wire"
"github.com/decred/dcrwallet/wallet/udb"
)
// Arbitrary command execution
// cfg.CmdName // e.g. "... |
// Copyright 2017 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 2018, OpenCensus 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... |
package azureimposter
import (
"crypto/rand"
"crypto/sha256"
"crypto/tls"
"encoding/base64"
"errors"
"fmt"
"net"
"net/http"
"net/url"
"strconv"
"strings"
)
func codeVerifier() (codeVerifier string, challenge string, err error) {
cvBytes := make([]byte, 32)
if _, err = rand.Read(cvBytes); err != nil {
r... |
// Copyright 2021-present The Atlas Authors. All rights reserved.
// This source code is licensed under the Apache 2.0 license found
// in the LICENSE file in the root directory of this source tree.
package ci
import (
"context"
"fmt"
"path/filepath"
"sort"
"ariga.io/atlas/sql/migrate"
"ariga.io/atlas/sql/sche... |
// Package xmlw implements output writers for XML.
package xmlw
import (
"bytes"
"encoding/base64"
"encoding/xml"
"fmt"
"io"
"strconv"
"time"
"github.com/fatih/color"
"github.com/neilotoole/sq/libsq/core/kind"
"github.com/neilotoole/sq/libsq/core/stringz"
"github.com/neilotoole/sq/cli/output"
"github.c... |
// yajsv is a command line tool for validating JSON documents against
// a provided JSON Schema - https://json-schema.org/
package main
import (
"bufio"
"flag"
"fmt"
"log"
"os"
"path/filepath"
"runtime"
"strings"
"sync"
"github.com/mitchellh/go-homedir"
"github.com/xeipuuv/gojsonschema"
)
const (
version... |
package config
import (
"fmt"
"time"
bnet "github.com/bio-routing/bio-rd/net"
"github.com/bio-routing/bio-rd/routingtable/filter"
"github.com/pkg/errors"
)
type BGP struct {
Groups []*BGPGroup `yaml:"groups"`
}
func (b *BGP) load(localAS uint32, policyOptions *PolicyOptions) error {
for _, g := range b.Group... |
package task
import (
"errors"
"github.com/huaweicloud/telescope/agent/core/logs"
"github.com/smallnest/gofsm"
"time"
)
// TaskEventProcessor ...
type TaskEventProcessor struct{}
// OnExit ...
func (p *TaskEventProcessor) OnExit(fromState string, args []interface{}) {
}
// Action ...
func (p *TaskEventProcessor... |
// Copyright © 2016 Galvanized Logic Inc.
// Use is governed by a BSD-style license found in the LICENSE file.
package grid
// hex.go is a start to capturing some hex grid related code.
//
// HUGE thank you to one of the best educational websites anywhere
// and the authoritative site for hex grids:
// http://www.... |
package types
import (
"testing"
"time"
"github.com/stretchr/testify/require"
"go.skia.org/infra/go/testutils/unittest"
)
func TestIncSLOViolation(t *testing.T) {
unittest.SmallTest(t)
now := time.Unix(1405544146, 0)
after1Day := now.Add(Daily).Add(time.Minute)
after1Week := now.Add(Weekly).Add(time.Minute... |
package util
import (
"encoding/base64"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"path"
"reflect"
"regexp"
"strings"
routev1 "github.com/openshift/api/route/v1"
securityv1 "github.com/openshift/api/security/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/meta"
"k8s.io/apimachinery/pkg/runtime... |
package cmd
import (
"strconv"
"sync"
"time"
"github.com/lbryio/lbry.go/errors"
"github.com/lbryio/lbry.go/jsonrpc"
"github.com/shopspring/decimal"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
func init() {
var franklinCmd = &cobra.Command{
Use: "franklin",
Short: "Test availability of... |
package step
import (
"fmt"
"log"
"os"
"os/user"
"path/filepath"
"runtime"
"strings"
"time"
)
// PathEnv defines the name of the environment variable that can overwrite
// the default configuration path.
const PathEnv = "STEPPATH"
// HomeEnv defines the name of the environment variable that can overwrite the... |
//
// Copyright 2020 Pantacor 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 or agreed ... |
// Copyright 2017 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... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package quicksight
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 DescribeThemePermissionsInput struct {
_ struct{} `type:"structure... |
// Package ais provides core functionality for the AIStore object storage.
/*
* Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved.
*/
package ais
import (
"fmt"
"net/http"
"net/url"
"github.com/NVIDIA/aistore/cluster"
"github.com/NVIDIA/aistore/cmn"
"github.com/NVIDIA/aistore/cmn/debug"
)
type... |
// Copyright 2021 Dolthub, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
package types
import (
"bytes"
"fmt"
"math/big"
"testing"
"github.com/stretchr/testify/require"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/ethermint/crypto/ethsecp256k1"
ethcmn "github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/rlp"
)
// GenerateEthAddress generate... |
package keeper
import (
"encoding/hex"
"fmt"
"github.com/pkg/errors"
sdk "github.com/pokt-network/pocket-core/types"
"github.com/pokt-network/pocket-core/x/nodes/exported"
"github.com/pokt-network/pocket-core/x/pocketcore/types"
"os"
"sync"
"time"
)
// "HandleDispatch" - Handles a client request for their se... |
package search
import (
"fmt"
"strings"
)
type Type int
type Pattern int
type Identifier rune
const (
TypeUnset Type = iota
TypeAustrianWord
TypeEnglishWord
TypeWordDefinition
)
const (
PatternUnset Pattern = iota
PatternRegex
PatternPhonotactic
)
const (
IDAustrian Identifier = 'a'
IDEnglish = 'e'
IDD... |
package dates
import (
"errors"
"fmt"
"time"
)
const USLayout = "2006-01-02"
const SQLDatetimeLayout = "2006-01-02 15:04:05"
// DateTime obtiene la fecha y la hora ─ en string─ con el layout YYYY-MM-DD hh-mm-ss.
func DateTime() string {
return time.Now().String()[:19]
}
// Today Obtiene la fecha ─convertida a s... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package kafka
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"
)
// Request body for UpdateMonitoring.
type UpdateMonitoringInput struct {
_ ... |
package protocol
import (
"files"
log "github.com"
"io"
"net"
"os"
//"runtime/debug"
"archive/tar"
"compress/gzip"
"time"
)
var RecvFile string
func Accept(listen net.Listener) {
var count int = 0
var flag byte
head := NewTPackHead()
for {
conn, err := listen.Accept()
if err != nil {
log.Log.Erro... |
package libp2ptls
import (
"crypto"
"crypto/ecdsa"
"crypto/rsa"
"crypto/subtle"
"crypto/tls"
"crypto/x509"
"fmt"
"time"
libp2pcrypto "github.com/libp2p/go-libp2p-core/crypto"
pb "github.com/libp2p/go-libp2p-core/crypto/pb"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/minio/sha256-simd"
)
// Identi... |
// Copyright 2018-2020 (c) Cognizant Digital Business, Evolutionary AI. All rights reserved. Issued under the Apache 2.0 License.
package main
import (
"context"
"flag"
"fmt"
"time"
"github.com/go-stack/stack"
"github.com/jjeffery/kv"
"github.com/karlmutch/base62"
"github.com/leaf-ai/go-service/pkg/network"... |
package sindex
/*
List
Slice contains the list in order, the length of the slice is the length of the list.
The slice header (length/capacity) should *NOT* be modified directly.
Uses reflection for allocation when growing
Uses unsafe copy for remove/insert (when supported)
*/
import (
"reflect"
)
const reserv... |
package barrier
import (
"context"
"errors"
"fmt"
"sync"
)
const (
nonPositiveParticipants = "participants is NOT positive"
tooMuchWaiting = "calling b.Wait() is more than b.participants. Make sure they are equal."
)
var (
// ErrBroken will be returned by all goroutines called Barrier.Wait() if a
//... |
// Copyright 2020-2021 Clastix Labs
// SPDX-License-Identifier: Apache-2.0
package cert
import (
"bytes"
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"math/big"
"time"
"github.com/pkg/errors"
)
type CA interface {
GenerateCertificate(opts CertificateOptions) (certificatePem *... |
package client
//
// Copyright (c) 2019 ARM Limited.
//
// SPDX-License-Identifier: MIT
//
// 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 lim... |
package sqlreflect
import (
"database/sql"
"fmt"
"github.com/Masterminds/squirrel"
"github.com/Masterminds/structable"
)
// Queryer defines an interface for querying databases
type Queryer interface {
squirrel.DBProxyBeginner
//Query(query string, args ...interface{}) (*sql.Rows, error)
//QueryRow(query strin... |
package mem
import (
"bytes"
"context"
"encoding/gob"
"sync"
"time"
"github.com/pkg/errors"
uuid "github.com/satori/go.uuid"
"github.com/vgough/sequin/job"
)
type store struct {
mu sync.Mutex
ids map[string]*record
tags map[string]map[string]*record // tag -> id -> rec
}
type record struct {
mu sync.... |
package download
import (
"testing"
"github.com/subutai-io/agent/log"
"fmt"
)
func TestFormatItem(t *testing.T) {
type args struct {
info map[string]string
repo string
}
tests := []struct {
name string
args args
want ListItem
}{
{name: "TestFormatItem-0"},
{name: "TestFormatItem-1"},
// TODO: A... |
/*
* Haven Money API
*
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* API version: 1.0
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
package haven
type CleanCategory string
// List of CleanCategory
const (
ARTS CleanCate... |
// Copyright 2014, Surul Software Labs GmbH
// All rights reserved.
/*
Package testfault provides utilities to help with testing in conjunction with the fault library.
*/
package testfault
import (
"fmt"
"regexp"
"strings"
"github.com/surullabs/fault"
)
type site struct {
fn string
call *fault.Call
err er... |
package cluster
import (
"context"
"fmt"
"os"
"os/signal"
"syscall"
"time"
"github.com/spf13/cobra"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
"sigs.k8s.io/controller-runtime/pkg/controller/controllerutil"
hyperapi "github.com/opensh... |
package main
import (
"fmt"
"sort"
"time"
"sync"
"github.com/ClickHouse/clickhouse-go"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/log"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/prompb"
)
var insertSQL = `INSERT INTO %s.%s
(date, name, tags, ... |
package client
import (
"github.com/cnlh/nps/lib/common"
"github.com/cnlh/nps/lib/conn"
"github.com/cnlh/nps/lib/kcp"
"github.com/cnlh/nps/lib/lg"
"github.com/cnlh/nps/lib/pool"
"net"
"sync"
"time"
)
type TRPClient struct {
svrAddr string
linkMap map[int]*conn.Link
stop chan bool
t... |
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
package collectd
import (
"strings"
"time"
"github.com/signalfx/golib/datapoint"
"github.com/signalfx/golib/event"
)
// JSONWriteBody is the full POST body of collectd's write_http format
type JSONWriteBody []*JSONWriteFormat
// JSONWriteFormat is the format for collectd json datapoints
type JSONWriteFormat str... |
package razproxy
import (
"crypto"
"crypto/ecdsa"
"crypto/rand"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"fmt"
"io/ioutil"
"log"
"math/big"
"sync/atomic"
"time"
"github.com/fsnotify/fsnotify"
)
// CertLoader ...
type CertLoader interface {
GetCertificate(*tls.ClientHe... |
package bot
import (
"context"
"encoding/base64"
"encoding/json"
"fmt"
"log"
"strings"
"sync"
"time"
"github.com/fox-one/mixin-sdk-go"
"github.com/gofrs/uuid"
"github.com/shopspring/decimal"
)
type Session struct {
Command string
UserID string
CurrentStep int
Data interface{}
}
type B... |
package main
import (
"context"
_ "embed"
"flag"
"github.com/celerway/metamorphosis/bridge"
"github.com/joho/godotenv"
log "github.com/sirupsen/logrus"
"os"
"strconv"
"strings"
"sync"
"time"
)
//go:embed .version
var embeddedVersion string
func main() {
var (
logLevel string
mqttBroker ... |
package crud
import (
"context"
"errors"
"flag"
"fmt"
"net/http"
"regexp"
"strings"
"time"
absto "github.com/ViBiOh/absto/pkg/model"
"github.com/ViBiOh/fibr/pkg/exif"
"github.com/ViBiOh/fibr/pkg/provider"
"github.com/ViBiOh/fibr/pkg/thumbnail"
"github.com/ViBiOh/flags"
"github.com/ViBiOh/httputils/v4/pk... |
package dao
import (
"context"
"encoding/json"
"fmt"
"go-common/app/service/bbq/video/api/grpc/v1"
"go-common/app/service/bbq/video/conf"
"go-common/app/service/bbq/video/model/grpc"
account "go-common/app/service/main/account/api"
archive "go-common/app/service/main/archive/api"
"go-common/library/cache/redi... |
/*
* @Author: thepoy
* @Email: <EMAIL>
* @File Name: response.go
* @Created: 2021-07-24 13:34:44
* @Modified: 2022-04-18 14:20:47
*/
package predator
import (
"errors"
"io/ioutil"
"net"
"sync"
ctx "github.com/go-predator/predator/context"
"github.com/go-predator/predator/json"
"github... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.