text stringlengths 3.08k 10.4k |
|---|
package http
import (
"fmt"
"github.com/viant/endly/testing/validator"
"github.com/viant/toolbox"
"github.com/viant/toolbox/data"
"github.com/viant/toolbox/url"
)
//SendRequest represents a send http request.
type SendRequest struct {
Options map[string]interface{} `description:"http client httpOptions: key... |
// Copyright 2009 to 2016 The Go Authors. Copyright 2018 The Gopher Burrow 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 cookie
import (
"net"
"net/http"
"path"
"strings"
)
//Copied from golang_org/x/net/httplex
var i... |
package main
import (
"ImageServer/gcnotifier"
"ImageServer/native"
"fmt"
"github.com/BurntSushi/toml"
"github.com/gin-gonic/gin"
"io"
"io/ioutil"
"log"
"runtime"
"time"
)
var config Config
func init() {
config.SetDefault()
if c, err := ioutil.ReadFile("./config.toml"); err == nil {
if err = toml.Unma... |
package main
import (
"errors"
"fmt"
"io/ioutil"
"log"
"net/url"
"os"
"reflect"
"strings"
"time"
"github.com/gdamore/tcell"
"github.com/rivo/tview"
yaml "gopkg.in/yaml.v2"
k8s "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-g... |
package sweetiebot
import (
"crypto/tls"
"fmt"
"html/template"
"io"
"net/http"
"os"
"path/filepath"
"regexp"
"strings"
"time"
"golang.org/x/crypto/acme/autocert"
)
func fwdhttps(w http.ResponseWriter, r *http.Request) {
switch r.Method {
case "POST", "PUT", "PATCH":
http.Error(w, "HTTPS access require... |
// Copyright (c) 2021 The goaudiovideo developers. All rights reserved.
// Project site: https://github.com/goaudiovideo/osc
// Use of this source code is governed by a MIT-style license that
// can be found in the LICENSE file for the project.
/*
Package x32 provides remote control support for the Behringer X32 Digit... |
package dialect
import (
"context"
"strings"
"github.com/posener/orm"
)
// CreateParams holds parameters for an SQL CREATE statement
type CreateParams struct {
Table string
// MarshaledTable is a json string representing a table
// The representation is of type Table, and created by the function Marshal
// of... |
package eth
import (
"context"
metrics "github.com/IRT-SystemX/bcm-poller/internal/metrics"
poller "github.com/IRT-SystemX/bcm-poller/poller"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/ethclient"
"log"
"math/big"
)
type Miner struct {
metrics.Stats
Id string `json:"id... |
// Package mockfs implements in-memory filesystem for testing.
package mockfs
import (
"bytes"
"context"
"fmt"
"io"
"sort"
"strings"
"github.com/kopia/kopia/fs"
)
// ReaderSeekerCloser implements io.Reader, io.Seeker and io.Closer
type ReaderSeekerCloser interface {
io.Reader
io.Seeker
io.Closer
}
type re... |
// Copyright © 2021 <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 to in ... |
package jsutil
import (
"syscall/js"
)
var (
global = js.Global()
array = global.Get("Array")
object = global.Get("Object")
)
// JS2Bytes convert from TypedArray for JS to byte slice for Go.
func JS2Bytes(dv js.Value) []byte {
b := make([]byte, dv.Get("byteLength").Int())
js.CopyBytesToGo(b, global.Get("Uint8... |
/*
Copyright 2021 - 2022 Crunchy Data Solutions, 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... |
package cmd
import (
"archive/zip"
"encoding/json"
"errors"
"fmt"
"io"
"log"
"net/http"
"os"
"github.com/spf13/cobra"
)
var (
emailsApiToken string
)
var fetchEmailsCmd = &cobra.Command{
Use: "fetch-emails",
Short: "Fetch all file attachments and add them to the output archive",
RunE: fetchEmails,
}... |
// Copyright 2012 <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package flags
import (
"bufio"
"bytes"
"fmt"
"io"
"reflect"
"strings"
"unicode/utf8"
)
type alignmentInfo struct {
maxLongLen int
hasShort bool
... |
package main
import (
"flag"
"fmt"
"io"
"log"
"net/http"
"regexp"
)
const (
maxUploadMb = 64
keySize = 8
)
// Handlers
type server struct {
allPipes PipeCollection
baseUrl string
}
var keyRegex = regexp.MustCompile("^/([a-zA-Z0-9]+)$")
// the root http handler
func (s *server) handler(w http.Respon... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: southbound.proto
package protos
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import protos "magma/orc8r/cloud/go/protos"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference impor... |
package round
import (
"fmt"
"runtime/debug"
"time"
"github.com/spf13/viper"
"github.com/JohnnyS318/RoyalAfgInGo/pkg/log"
"github.com/JohnnyS318/RoyalAfgInGo/services/poker/events"
"github.com/JohnnyS318/RoyalAfgInGo/services/poker/models"
"github.com/JohnnyS318/RoyalAfgInGo/services/poker/money"
"github.co... |
package main
import (
"errors"
"fmt"
"net"
"net/http"
"os"
"os/signal"
"strings"
"syscall"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/mattermost/go-circleci"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.... |
// Copyright (c) 2019,CAOHONGJU All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package media
import (
"io"
"testing"
"time"
"github.com/cnotch/ipchub/av/format/rtp"
"github.com/stretchr/testify/assert"
)
type emptyMulticastable struc... |
package base
import (
"bytes"
"context"
"fmt"
"io/ioutil"
"net/url"
"os"
"path"
"path/filepath"
"strings"
"testing"
"github.com/docker/docker/client"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/format"
"github.com/replicatedhq/ship/integration"
"github.com/replicatedh... |
package logger
import (
"encoding/json"
"fmt"
"io"
"path"
"runtime"
"strings"
"sync"
"time"
)
type Logger struct {
config *LogConfig
info *LogInfo
Mu sync.Mutex
Cache *BackEndCache
stop bool
wait chan interface{}
}
type SafeChannel struct {
C chan string
closed bool
mutex sync.Mutex... |
package main
import (
"fmt"
"regexp"
"strings"
log "github.com/sirupsen/logrus"
extv1beta1 "k8s.io/api/extensions/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
)
var ingressHostRegExp = regexp.MustCompile(`^([a-zA-Z0-9_][a-zA-Z0-9_-]{0,62})(\.[a-zA-Z0-9_][a-zA-Z0-9_-]{0,... |
package xmlnode
import (
"encoding/xml"
)
// DESIGN NOTE:
// The idea behind the somewhat clumsy interface (rather than something like
// the empty Token interface) is to eliminate some of the need for type checks.
//
// For example, if you need to traverse the node tree, you don't need to check
// if a node is a Ta... |
package main
import (
"net/http"
"os"
"regexp"
"strconv"
"time"
"github.com/drone/drone-go/drone"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/sirupsen/logrus"
"golang.org/x/oauth2"
)
type status string
const (
success status = "su... |
package store
import (
"context"
"encoding/json"
"fmt"
"github.com/filedag-project/filedag-storage/dag/pool"
"github.com/filedag-project/filedag-storage/http/objectstore/uleveldb"
logging "github.com/ipfs/go-log/v2"
"io"
"io/ioutil"
"os"
"strconv"
"strings"
"time"
)
var log = logging.Logger("store")
//St... |
package streams
import (
"sync"
"time"
"github.com/launchdarkly/ld-relay/v6/config"
"gopkg.in/launchdarkly/go-sdk-common.v2/ldlog"
"gopkg.in/launchdarkly/go-server-sdk.v5/interfaces/ldstoretypes"
)
// EnvStreamUpdates is an interface representing the kinds of updates we can publish to streams. Other
// compone... |
package produce
import (
"encoding/json"
"fmt"
"regexp"
"strings"
"time"
"github.com/golang/protobuf/protoc-gen-go/descriptor"
"github.com/jhump/protoreflect/desc"
"gopkg.in/alecthomas/kingpin.v2"
"github.com/xitonix/trubka/commands"
"github.com/xitonix/trubka/protobuf"
)
type schema struct {
globalParam... |
package liberty
import (
"fmt"
"net"
"net/http"
"net/http/httputil"
"net/url"
"strings"
"golang.scot/liberty/middleware"
"github.com/gnanderson/trie"
)
// ReverseProxy defines the configuration of a reverse proxy entry in the router.
type ReverseProxy struct {
HostPath string `yaml:"hostPath"`
Remote... |
// Code generated by MockGen. DO NOT EDIT.
// Source: scheduler.go
// Package server is a generated GoMock package.
package server
import (
gomock "github.com/golang/mock/gomock"
stats "github.com/twitter/scoot/common/stats"
saga "github.com/twitter/scoot/saga"
domain "github.com/twitter/scoot/scheduler/domain"
... |
// Copyright 2022 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build go1.18
// +build go1.18
package vulncheck
import (
"fmt"
"go/token"
"sort"
"strings"
"golang.org/x/mod/semver"
"golang.org/x/tools/internal/... |
package importer
import (
"errors"
"fmt"
"os"
"strings"
"sync"
"text/scanner"
"github.com/emicklei/proto"
"golang.org/x/sync/singleflight"
"github.com/wdvxdr1123/yaproto/internal/types"
)
var (
packages = sync.Map{}
single = singleflight.Group{}
)
var ProtoPath = ""
type File struct {
Path string
... |
/*
SPDX-License-Identifier: BSD-3-Clause-Open-MPI
*/
package request
import (
"encoding/json"
"fmt"
"github.com/pkg/errors"
"github.com/project-flogo/core/activity"
"github.com/project-flogo/core/support/log"
)
const (
opInvoke = "invoke"
opQuery = "query"
)
// NetworkConfig is the content of fabric networ... |
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"bytes"
"crypto/sha256"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
"os"
"path/filepath"
"regexp"
"strings"
... |
package synology
import (
"fmt"
"io"
"time"
)
const (
SYNOFileStationList = "SYNO.FileStation.List"
SYNOFileStationInfo = "SYNO.FileStation.Info"
SYNOFileStationSearch = "SYNO.FileStation.Search"
SYNOFileStationVirtualFolder = "SYNO.FileStation.VirtualFolder"
SYNOFileStationFa... |
// pubsubplus-go-client
//
// Copyright 2021-2022 Solace Corporation. 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... |
package model
import (
"database/sql/driver"
"encoding/json"
"errors"
"strconv"
"time"
)
var (
// ErrFavResourceExist error this has been favoured.
ErrFavResourceExist = errors.New("error this has been favoured")
// ErrFavResourceAlreadyDel error this has been unfavoured.
ErrFavResourceAlreadyDel = errors.Ne... |
package main
import (
"fmt"
"strconv"
"strings"
"time"
)
type pots struct {
data []bool
zeroPosition int
}
func newPots(s string) pots {
p := pots{
zeroPosition: 0,
data: make([]bool, len([]rune(s))),
}
for i, r := range []rune(s) {
if r == '#' {
p.data[i] = true
} else {
p.dat... |
package amp
import (
"crypto/rand"
"fmt"
)
// zeroShare is the all-zero 32-byte share.
var zeroShare = Share{}
// Sharer facilitates dynamic splitting of a root share value and derivation of
// child preimage and hashes for individual HTLCs in an AMP payment. A sharer
// represents a specific node in an abstract b... |
package main
import (
"fmt"
"os"
)
// MovementState ...
type MovementState int64
// ...
const (
MovementStateNorth MovementState = iota
MovementStateSouth = iota
MovementStateEast = iota
MovementStateWest = iota
MovementStateCnt = iota
)
// Status .... |
// Package etcpwdparse provides straightforward functionality for loading an /etc/passwd file
// and doing lookups on its content.
//
// Remember this only looks at an /etc/passwd type file, so will work best on Linux operating systems
// and wont pick up users from LDAP and other sources.
package etcpwdparse
import (... |
package repository
import (
"context"
"github.com/jackc/pgx/v4"
"github.com/jackc/pgx/v4/pgxpool"
"github.com/nickeskov/db_forum/internal/pkg/models"
"github.com/nickeskov/db_forum/internal/pkg/post"
"github.com/nickeskov/db_forum/internal/pkg/utils/database/driver/pgx/codes"
sqlHelpers "github.com/nickeskov/db... |
// Package md5apr implements the MD5 APR hash algorithm
// This is a pretty ugly implementation of the hash.Hash api as I am not a crypto expert
// The algorithm implementation for MD5 APR1 is based on the one found here https://github.com/jimstudt/http-authentication/blob/master/basic/md5.go
package md5apr1
import (... |
package http
import (
"context"
"crypto/tls"
"fmt"
"net/http"
"net/url"
"time"
"github.com/hashicorp/go-cleanhttp"
"github.com/hashicorp/go-retryablehttp"
"github.com/hashicorp/terraform/backend"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/state"
"github.com/hashicorp/te... |
// Copyright © 2017 Circonus, Inc. <<EMAIL>>
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
//go:build linux
// +build linux
package procfs
import (
"context"
"fmt"
"os"
"path/filepath"
"strconv"
"strings"
"time"
"github.com/circonus-labs/circonus-... |
package template
import (
"fmt"
"strings"
"github.com/SafetyCulture/protoc-gen-workato/config"
workato "github.com/SafetyCulture/protoc-gen-workato/s12/protobuf/workato"
"github.com/SafetyCulture/protoc-gen-workato/template/schema"
"github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
gendoc... |
//用于处理tldr-pages/tldr中的原始markdown数据
package main
import (
"bufio"
"encoding/json"
"flag"
"fmt"
"os"
"path/filepath"
"sort"
"strconv"
"strings"
"io/ioutil"
)
type CommandDescribe struct {
Platform string
Class string
Brief string
MdText string
}
var gPlatform *string
var gFile *os.File
var gCmdDescT... |
/*
Copyright 2018-2022 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 agreed to in writing,... |
/*
* Copyright 2019 <NAME> <<EMAIL>>, <NAME> <<EMAIL>>,
* and Wikimedia Foundation
*
* 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
*
... |
package monitor
// Monitor holds a connection to mesos, and a cache for every iteration
// With MesosCache we reduce the number of calls to mesos, also we map it for quicker access
import (
"regexp"
"strings"
"github.com/alanbover/deathnode/context"
"github.com/alanbover/deathnode/mesos"
log "github.com/sirupse... |
package comment
import (
"bytes"
"encoding/json"
"html/template"
"strings"
)
type ApiConfig struct {
Method string
Path string
Name string
Module string
Function string
Type string
}
/*
* Row From information_schema.COLUMNS
* TABLE_CATALOG TABLE_SCHEMA TABLE_NAME COLUMN_NAME ORDINAL_POSIT... |
package stringutils
import (
"crypto/md5"
"crypto/rand"
"encoding/base64"
"fmt"
"io"
"math"
r "math/rand"
"reflect"
"regexp"
"strconv"
"strings"
"time"
"unicode/utf16"
)
func GetAfter(src string, find string) (string, bool) {
index := strings.Index(src, find)
if index > -1 && index+len(find) < len(src)... |
// SPDX-FileCopyrightText: 2020 SAP SE or an SAP affiliate company and Gardener contributors.
//
// SPDX-License-Identifier: Apache-2.0
package main
import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"strings"
lsv1alpha1 "github.com/gardener/landscaper/apis/core/v1alpha1"
depv1alp... |
package discord
import (
"github.com/denverquane/amongusdiscord/game"
"log"
"github.com/bwmarrin/discordgo"
)
//const voiceChannel = "758127642661748766"; // Cloaking's Server VoiceChannel
const voiceChannel = "758099224838668299";
func (guild *GuildState) handleGameEndMessage(s *discordgo.Session) {
guild.Amon... |
package mach
import (
"errors"
"fmt"
"github.com/forsyth/jsonpath/paths"
)
var (
ErrTooManyVals = errors.New("program has too many values")
)
// builder is the state when building a program
type builder struct {
vals map[paths.Val]uint32 // map value to its index in prog.vals
prog *Program
}
// Compile compi... |
package session
import (
"encoding/hex"
"errors"
"log"
"os"
"time"
"github.com/comail/colog"
"github.com/gozwave/gozw/frame"
"github.com/gozwave/gozw/protocol"
)
const (
minSequenceNumber = 1
maxSequenceNumber = 127
)
type ILayer interface {
MakeRequest(request *Request)
SendFrameDirect(req *frame.Frame... |
package gochat
import (
"strings"
"fmt"
"time"
"regexp"
"encoding/json"
"gochat/utils"
"errors"
)
type syncMessageRequest struct {
SyncKey syncKey
RR int64 `json:"rr"`
BaseRequest baseRequest
}
type syncMessageResponse struct {
Response
SyncKey syncKey
SyncCheckKey syncKey
SKey ... |
/*
* Copyright 2020 InfAI (CC SES)
*
* 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 cmd
import (
"fmt"
"strings"
"github.com/exoscale/egoscale"
apiv2 "github.com/exoscale/egoscale/api/v2"
"github.com/spf13/cobra"
)
var sksCreateCmd = &cobra.Command{
Use: "create <name>",
Short: "Create a SKS cluster",
Long: fmt.Sprintf(`This command creates a SKS cluster.
Note: SKS cluster Nodes'... |
package fields
import (
"compress/zlib"
"encoding/binary"
"errors"
"io"
)
type switchReader struct {
io.Reader
}
func (r *switchReader) Switch(reader io.Reader) {
r.Reader = reader
}
type Decoder struct {
bo binary.ByteOrder
b byte // Contains left over of a previous not-byte-aligned reading.
... |
package main
import (
"fmt"
b3 "github.com/liguoqinjim/behavior3go"
"github.com/liguoqinjim/behavior3go/config"
"github.com/liguoqinjim/behavior3go/core"
"github.com/liguoqinjim/behavior3go/loader"
"lab051/lab008/fight"
"lab051/lab008/mynode"
"lab051/lab008/util"
"log"
)
func main() {
//加载自定义节点
extMap := b... |
/*
* MIT License
*
* Copyright (c) 2021 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, m... |
package parser
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"path"
"strings"
"text/template"
"github.com/Masterminds/sprig"
"gopkg.in/yaml.v2"
"helm.sh/helm/v3/pkg/chart/loader"
"helm.sh/helm/v3/pkg/chartutil"
"helm.sh/helm/v3/pkg/engine"
"github.com/tinyzimmer/k3p/pkg/log"
"github.com/tinyzimmer/k3p/pkg/ty... |
package internal
import (
"fmt"
)
var (
ClockSpeed int = 4194304
)
type Registers struct {
A uint8
B uint8
C uint8
D uint8
E uint8
H uint8
L uint8
Flags uint8
Pc uint16
Sp uint16
Ime bool
}
func (r *Registers) FlagZ() bool {
return r.Flags&0x80 != 0
}
func (r *Registers)... |
package web
import (
"encoding/json"
"fmt"
"html/template"
"io/ioutil"
"net/http"
"sync"
"time"
"github.com/fynaris/scache"
"github.com/fynaris/sweb/log"
"github.com/fynaris/sweb/render"
"github.com/fynaris/sweb/server"
"golang.org/x/net/context"
)
type Server struct {
*server.Server
render *render.R... |
package main
import (
"bufio"
"bytes"
"fmt"
"os"
"sort"
)
func readInt(bytes []byte, from int, val *int) int {
i := from
sign := 1
if bytes[i] == '-' {
sign = -1
i++
}
tmp := 0
for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
tmp = tmp*10 + int(bytes[i]-'0')
i++
}
*val = tmp * sign
ret... |
package proxy
import (
"bytes"
"compress/gzip"
"encoding/json"
"fmt"
"io"
"net/http"
"path/filepath"
"strings"
"sync"
"time"
"github.com/Sirupsen/logrus"
"github.com/cyberj/go-proxywalkie/walkie"
"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
)
type ClientPingItemJson struct {
Hostname str... |
package favii
import (
"fmt"
"io"
"net/http"
"net/url"
"strings"
"golang.org/x/net/html"
)
// Favii is basically a client to use the struct. It has an http.Client for
// doing all HTTP Requests for fetching the HTML Pages
type Favii struct {
client *http.Client
cache map[string]*MetaInfo
useCache bool
... |
package main
import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
"encoding/json"
"fmt"
"log"
"net/http"
//"strconv"
"strings"
//"sync"
"time"
"github.com/gorilla/mux"
"github.com/gorilla/websocket"
)
const (
HOME = "home"
AWAY = "away"
PERIODS = "periods"
MINUTES = "minutes"
FOULS =... |
package main
import (
"fmt"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/cors"
"github.com/gofiber/websocket/v2"
"log"
"math/rand"
"mime/multipart"
"net/http"
"path/filepa... |
package main
import (
"crypto/sha512"
"encoding/base64"
"log"
"os"
"strconv"
"time"
)
type doHashOp struct {
password string
delayS int
resp chan int
}
type getHashOp struct {
index int
resp chan string
}
type getStatsOp struct {
pattern string
resp chan *statsObj
}
type shutdownOp struct {
... |
package main
import (
"fmt"
"os"
"path/filepath"
"github.com/alessio/shellescape"
)
// RotateBackups is the main entry point to perform backup rotating/grouping on the target folder
func RotateBackups(options *Options) {
// Move excess from main to daily according to MAIN_MAX
HandleExcessBackups(options, optio... |
// 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 t... |
package main
import (
"fmt"
"os"
"os/exec"
"os/signal"
"syscall"
)
// runJobs is a routine to run jobs from a channel until it closes
func runJobs(jobsIn, jobsFinished, jobsErrored chan *job) {
for j := range jobsIn {
out, err := j.Cmd.CombinedOutput()
j.Out, j.Err = string(out), err
if err != nil {
jo... |
package main
import (
"fmt"
"log"
"strings"
"time"
"github.com/miekg/dns"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
var (
queriesHistogram = promauto.NewHistogramVec(
prometheus.HistogramOpts{
Namespace: namespace,
Subsystem: "dns",
... |
package main
import (
"bytes"
"flag"
"fmt"
"io/ioutil"
"log"
"runtime"
"time"
//"strconv"
"encoding/gob"
"math/rand"
"github.com/ndaniels/esfragbag/bow"
"github.com/ndaniels/esfragbag/bowdb"
"github.com/ndaniels/tools/util"
)
type distType int
const (
cosineDist distType = iota
euclideanDist ... |
/*
Copyright 2021 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... |
package twocaptcha
import (
"encoding/json"
"errors"
"fmt"
"time"
"github.com/valyala/fasthttp"
)
// SettingInfo contains settings info like time between successive checking requests. These
// settings are passed into the captcha constructor by the user.
type SettingInfo struct {
TimeBetweenRequests int
}
// ... |
package types
import (
"fmt"
"strings"
"github.com/koki/json"
util "github.com/koki/structurederrors"
)
type EnvFromType string
const (
EnvFromTypeSecret EnvFromType = "secret"
EnvFromTypeConfig EnvFromType = "config"
EnvFromTypeCPULimits EnvFromType = "limits.cpu"
EnvFromTypeMemLimits ... |
package cfmysql
import (
"code.cloudfoundry.org/cli/plugin"
"io"
"fmt"
"os"
"code.cloudfoundry.org/cli/plugin/models"
)
type MysqlPlugin struct {
In io.Reader
Out io.Writer
Err io.Writer
CfService CfService
MysqlRunner MysqlRunner
PortFinder PortFinder
exitCode int
}
func (... |
package main
import (
"encoding/json"
"log"
"net/http"
"strings"
"time"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
)
const cookieName = "session"
type GoogleClaims struct {
ID string `json:"id"`
Email string `json:"email"`
VerifiedEmail bool `json:"verified_email"`
Name ... |
// Code generated by protoc-gen-micro. DO NOT EDIT.
// source: examples/proto/examplepb/echo_service.proto
/*
Package examplepb is a generated protocol buffer package.
Echo Service
Echo Service API consists of a single service which returns
a message.
It is generated from these files:
examples/proto/examplepb/echo... |
package client
import (
"google.golang.org/grpc"
"model/pkg/mspb"
"util/assert"
"testing"
"context"
"time"
"util/log"
"sync"
"sync/atomic"
)
//func TestNewClient(t *testing.T) {
// client,err := NewClient([]string{"192.168.61.136:8887"})
// if err != nil {
// fmt.Errorf("%v",err)
// }
//
// resp,err := clie... |
package models
import (
"time"
"github.com/juju/errors"
"github.com/sryanyuan/ForeverMS/core/consts"
)
/*
-- ----------------------------
-- Table structure for `accounts`
-- ----------------------------
DROP TABLE IF EXISTS `accounts`;
CREATE TABLE `accounts` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` va... |
package sgl
import (
"fmt"
"io"
"os"
"runtime"
"strings"
"sync"
"time"
)
type Level uint8
const (
// FatalLevel level. Logs and then calls `os.Exit(1)`. It will exit even if the
// logging level is set to Panic.
FatalLevel = iota
// ErrorLevel level. Logs. Used for errors that should definitely be noted.
... |
package main
import (
"encoding/json"
"os"
"os/user"
)
const (
BlogUrl = "https://blog.naver.com/the3countrys/222106929101"
appData string = "\\AppData\\Local\\JcopWebtoonDownloader"
)
var (
homeDir string
)
func setNaverComicCookieData() {
requireCookies := make([]string, 2)
requireCookies[0] = "NID_AUT"
... |
package peer
import (
"fmt"
"sync"
"github.com/gogo/protobuf/proto"
"github.com/ibalajiarun/go-consensus/peer/peerpb"
"github.com/ibalajiarun/go-consensus/pkg/command"
"github.com/ibalajiarun/go-consensus/pkg/command/commandpb"
"github.com/ibalajiarun/go-consensus/pkg/logger"
"github.com/ibalajiarun/go-consen... |
// Package logger handles logging for JURA.
//
// This is a thing wrapper around inconshreveable's log15. It
// additionally brings a configuration format (from YAML) with the
// ability to log to several destinations.
//
// It also brings some conventions like the presence of "module" in
// each context to be able to ... |
package datastore
import (
"fmt"
"log"
"os"
"path/filepath"
"strings"
"time"
Config "github.com/robrotheram/gogallery/config"
"github.com/robrotheram/gogallery/worker"
)
var validExtension = []string{"jpg", "png", "gif"}
var gConfig *Config.GalleryConfiguration
var IsScanning bool
// FileInfo is a struct cr... |
package main
import (
"bouncer"
"bouncer/keystone"
"flag"
"fmt"
"github.com/platform9-incubator/mw-proxy/forwarder"
"github.com/platform9-incubator/mw-proxy/qbert"
"github.com/platform9/proxylib/pkg/proxylib"
"log"
"net"
"os"
"strconv"
"strings"
"time"
)
const (
defaultKeystoneTimeout = time.Duration(30... |
package main
import (
"encoding/base64"
"encoding/hex"
"errors"
"fmt"
"os"
"bufio"
//"unicode"
)
// EXERCISE 1
var hexTo64In = "49276d206b696c6c696e6720796f757220627261696e206c696b65206120706f69736f6e6f7573206d757368726f6f6d"
func hexTo64(hexStr string) (string, error) {
hexbytes, err := hex.DecodeString(hex... |
package upnp
import (
"encoding/xml"
"errors"
"fmt"
"net"
"net/url"
"strings"
"time"
log "github.com/Sirupsen/logrus"
)
type IGDService struct {
ID string
URL string
URN string
}
type IGD struct {
UUID string
FriendlyName string
DescriptionURL string
internalIP net.IP
Services ... |
package db
import (
"bufio"
"bytes"
"database/sql"
"fmt"
"os"
"strconv"
"strings"
"kellnhofer.com/work-log/db/tx"
_ "github.com/go-sql-driver/mysql"
"kellnhofer.com/work-log/config"
"kellnhofer.com/work-log/db/repo"
"kellnhofer.com/work-log/log"
)
const curDbVers = 1
// Db abstracts the database acces... |
/*
Copyright 2021 TriggerMesh 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, softwar... |
package main
import (
"flag"
"fmt"
"io"
"net/http"
"os"
"time"
"github.com/StackExchange/wmi"
"github.com/iyacontrol/HyperV-exporter/collector"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/log"
"github.com/promethe... |
// Copyright 2020 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package firmware
import (
"reflect"
"testing"
pb "chromiumos/tast/services/cros/firmware"
)
// flags converts a list of ints to a slice of pb.GBB... |
// Copyright (c) 2021 <NAME>
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package whatsmeow
import (
"fmt"
"sync/atomic"
"time"
waBinary "go.mau.fi/whats... |
package constant
var AnnotationKeys map[int]string
const (
API int32 = 12
API_METADATA = 13
RETURN_DATA = 14
API_TAG = 10015
ERROR_API_METADATA_ERROR ... |
package main
import (
"fmt"
"os"
"path/filepath"
"strings"
)
// Pointer represents a pointer type definition
// pointer HBLUETOOTH_AUTHENTICATION_REGISTRATION* HBLUETOOTH_AUTHENTICATION_REGISTRATION
type Pointer struct {
Name string
Type string
}
// Alias represents a type alias definition
// ... |
package services
import (
"encoding/json"
"fmt"
"net/http"
"github.com/ckmu32/GoBankingCore/models"
"github.com/ckmu32/GoBankingCore/repositories"
"github.com/go-playground/validator/v10"
)
var validate *validator.Validate
// AddAccount Let's us add a new account.
func AddAccount(account *models.Account) mode... |
package main
//
//Copyright 2019 Telenor Digital AS
//
//Licensed under the Apache License, Version 2.0 (the "License");
//you may not use this file except in compliance with the License.
//You may obtain a copy of the License at
//
//http://www.apache.org/licenses/LICENSE-2.0
//
//Unless required by applicable law or... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.