text stringlengths 3.08k 10.4k |
|---|
/*
Package proto provides byte-level interaction with HTTP request payload.
Example of HTTP payload for future references, new line symbols escaped:
POST /upload HTTP/1.1\r\n
User-Agent: Gor\r\n
Content-Length: 11\r\n
\r\n
Hello world
GET /index.html HTTP/1.1\r\n
User-Agent: Gor\r\n
\r\n
\r\n
*/
package pro... |
package manager
import (
"context"
"encoding/json"
"time"
"github.com/contribsys/faktory/client"
"github.com/contribsys/faktory/storage"
"github.com/contribsys/faktory/util"
)
var (
JobReservationExpired = &FailPayload{
ErrorType: "ReservationExpired",
ErrorMessage: "Faktory job reservation expired",
... |
package models
import (
"database/sql"
"github.com/jmoiron/sqlx"
"github.com/stashapp/stash/pkg/database"
"path/filepath"
)
type GalleryQueryBuilder struct{}
func NewGalleryQueryBuilder() GalleryQueryBuilder {
return GalleryQueryBuilder{}
}
func (qb *GalleryQueryBuilder) Create(newGallery Gallery, tx *sqlx.Tx)... |
package middleware
import (
"bytes"
"compress/gzip"
"crypto/sha1"
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"net"
"net/http"
"strings"
"sync"
"time"
"github.com/eudore/eudore"
)
// NewDumpFunc 函数创建一个截取请求信息的中间件,将匹配请求使用webscoket输出给客户端。
//
// router参数是eudore.Router类型,然后注入拦截路由处理。
func NewDumpFunc(... |
package publisher
import (
"math/big"
"fmt"
"net/http"
"net/url"
"io"
"io/ioutil"
"log"
"os"
"os/exec"
"strings"
"encoding/base64"
"encoding/json"
"errors"
"reflect"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
)
func (p *Publisher) GetNarrator(i int64) (PublisherNarrator, error) {
return p.Na... |
package cmd
import (
"context"
"fmt"
"log"
"os"
"sync"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
watch "k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/kubernetes"
// Load slearch formatters: json and text
_ "github.com/vishen/go-slearch/formatters" // TODO: this is awful,... |
package main
import (
"fmt"
"io"
"io/ioutil"
"sort"
"strings"
"github.com/sago35/go-jisx0208"
"github.com/sago35/tinyufont"
"github.com/zachomedia/go-bdf"
)
type fontgen struct {
pkgname string
fontname string
isofont string
font string
}
func (f *fontgen) generate(w io.Writer, runes []rune) error... |
// Copyright (c) 2021 Terminus, 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... |
package tpm
import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"strconv"
"strings"
tspi "github.com/google/go-tpm/tpm"
)
var (
// TPMOpener is used to allow unit testing
TPMOpener = tspi.OpenTPM
// TPMDevice main device path for
// TSS usage
TPMDevice = "/dev/tpm0"
// TpmCapabilities for selecting tpm spec
... |
/*
picolog is a tiny levelled logging package for go. It supports syslog
log levels, subloggers, and not much else. Written because all the
existing solutions either didn't do what I needed or were too weighty.
*/
package picolog
import (
"bufio"
"fmt"
"log"
"log/syslog"
"os"
"strings"
)
// Logger is a leveled ... |
/**
* Copyright 2021 uk
*
* 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... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: orc8r/cloud/go/mproto/protos/mproto.proto
package protos
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 _ = ma... |
package MqttPool
import (
"crypto/tls"
"fmt"
"log"
"math/rand"
"os"
//"runtime"
"strings"
"sync"
"time"
mqtt "github.com/eclipse/paho.mqtt.golang"
"github.com/gogf/gf/frame/g"
)
type MqttClient struct {
c mqtt.Client
}
var gMqttClientOnce sync.Once
var gMqttClient *MqttClient
var gGetHostNameOnce syn... |
/*
* Copyright (c) 2021 <NAME>. All Rights Reserved.
*
* Licensed under the MIT license (the "License"). You may not use this file except in compliance
* with the License. A copy of the License is located at
*
* https://github.com/mmmorris1975/aws-runas/blob/master/LICENSE
*
* or in the "license" file accompany... |
package warden
import (
"fmt"
"io"
"log"
"math/rand"
"net"
"net/http"
"time"
"github.com/buckhx/safari-zone/proto/pbf"
"github.com/buckhx/safari-zone/registry"
"github.com/buckhx/safari-zone/srv"
"github.com/buckhx/safari-zone/srv/auth"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"golang.org/x/net/c... |
/*
* Copyright (c) 2015, Salesforce.com, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
* following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this list of condi... |
// Copyright 2020 cloudeng llc. All rights reserved.
// Use of this source code is governed by the Apache-2.0
// license that can be found in the LICENSE file.
package filewalk_test
import (
"context"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"reflect"
"sort"
"strings"
"testing"
"cloudeng.io/errors"
"clouden... |
package tools
import (
"context"
"errors"
"fmt"
"strconv"
"github.com/streamingfast/sf-solana/reproc"
"go.uber.org/zap"
"cloud.google.com/go/bigtable"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/streamingfast/dstore"
)
var reprocCmd = &cobra.Command{
Use: "reproc [project_id] [instanc... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: godin/mail/v1/mail.proto
package mailv1
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 i... |
package processor
/**
* Panther is a scalable, powerful, cloud-native SIEM written in Golang/React.
* Copyright (C) 2020 Panther Labs Inc
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foun... |
package release
import (
"context"
"fmt"
"github.com/hashicorp/go-hclog"
"github.com/hashicorp/waypoint-plugin-s3/registry"
"github.com/hashicorp/waypoint-plugin-sdk/component"
"github.com/hashicorp/waypoint-plugin-sdk/framework/resource"
sdk "github.com/hashicorp/waypoint-plugin-sdk/proto/gen"
"github.com/ha... |
/*
Copyright © 2022 SUSE 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 writing, software
dist... |
package axdogma
import (
"context"
"sync"
"time"
"github.com/dogmatiq/dogma"
"github.com/jmalloc/ax"
"github.com/jmalloc/ax/endpoint"
"github.com/jmalloc/ax/persistence"
"github.com/jmalloc/ax/saga"
)
// ProcessAdaptor adapts a dogma.ProcessMessageHandler to Ax's saga.Saga
// interface.
type ProcessAdaptor s... |
package pkg
import (
"encoding/binary"
"io"
"math/rand"
"net"
"sync"
"time"
)
type State uint8
const (
CONNECTION_CLOSED State = iota
CONNECTION_CONNECTED
CONNECTION_AUTHOK
)
type Conn struct {
net.Conn
State State
// for SequenceNum generator goroutine
SequenceID <-chan uint32
done chan<- stru... |
package main
import (
"github.com/Unknwon/goconfig"
"github.com/Wessie/appdirs"
"os"
"path"
)
//配置项
type Config struct {
db string
dbname string
dbpass string
dbtype string
dbuser string
method string
timeout int
port_min int
port_max int
byt... |
// Copyright 2018 The MATRIX Authors as well as Copyright 2014-2017 The go-ethereum Authors
// This file is consisted of the MATRIX library and part of the go-ethereum library.
//
// The MATRIX-ethereum library is free software: you can redistribute it and/or modify it under the terms of the MIT License.
//
// Permissi... |
package generator
import (
"bytes"
"fmt"
"io/ioutil"
"path/filepath"
"github.com/dave/jennifer/jen"
"github.com/graphql-go/graphql/language/ast"
"github.com/graphql-go/graphql/language/location"
)
// GeneratedFileExt describes the default extension used when the resulting Go
// file is written.
const Generate... |
// Copyright 2017-2018 VMware, 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 appli... |
package controllers
import (
"encoding/json"
"fmt"
"log"
"net/http"
"os"
"github.com/18F/cg-dashboard/helpers"
"github.com/18F/cg-dashboard/mailer"
"github.com/gocraft/web"
"github.com/gorilla/csrf"
"golang.org/x/oauth2"
)
// Context represents the context for all requests that do not need authentication.
... |
package gii
import (
"encoding/xml"
"fmt"
"gong/common"
"strconv"
)
func parseString(s string) float32 {
x, errx := strconv.ParseFloat(s, 32)
if errx != nil {
panic(errx)
}
return float32(x)
}
func parseStringsToFloat(arrStrings [3]string) [3]float32 {
x := parseString(arrStrings[0])
y := parseString(arr... |
package bonsai
import (
"errors"
"fmt"
"sort"
"strings"
goversion "github.com/hashicorp/go-version"
corev2 "github.com/sensu/sensu-go/api/core/v2"
)
const (
// NameAnnotation represents a Bonsai asset name
NameAnnotation = "io.sensu.bonsai.name"
// NamespaceAnnotation represents a Bonsai asset namenamespac... |
// symdevwriters reads a BTP file and prints a list of devices in decending order of correlation to system cache usage.
// The goal of this analysis is to help identify devices that contribute to high cache utilization.
package main
import (
"bufio"
"fmt"
"github.com/mcgrew/gostats"
"log"
"os"
"os/exec"
"regex... |
// 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 ... |
// +build integration
package integration
import (
"fmt"
"os"
"strings"
"testing"
"github.com/eggsampler/acme/v3"
"github.com/letsencrypt/boulder/test"
)
// TestTooBigOrderError tests that submitting an order with more than 100 names
// produces the expected problem result.
func TestTooBigOrderError(t *testi... |
package geoannotator
import (
"context"
"errors"
"fmt"
"log"
"net"
"sync"
"github.com/m-lab/go/content"
"github.com/m-lab/go/rtx"
"github.com/oschwald/geoip2-golang"
"github.com/m-lab/tcp-info/inetdiag"
"github.com/m-lab/uuid-annotator/annotator"
"github.com/m-lab/uuid-annotator/tarreader"
)
// GeoAnnot... |
package config
import (
"time"
)
type Config struct {
LogLevel string `mapstructure:"log_level"`
LogFormat string `mapstructure:"log_format"`
HTTP HttpConfig `mapstructure:"http"`
MQ MQConfig `mapstructure:"mq"`
DB DB... |
package parse
import (
"net/http"
"regexp"
"strings"
"github.com/rancher/norman/api/builtin"
"github.com/rancher/norman/types"
"github.com/rancher/norman/urlbuilder"
)
const (
maxFormSize = 2 * 1 << 20
)
var (
multiSlashRegexp = regexp.MustCompile("//+")
allowedFormats = map[string]bool{
"html": true,
... |
package cmd
import (
"github.com/aurumbot/flags"
"github.com/aurumbot/lib/dat"
f "github.com/aurumbot/lib/foundation"
dsg "github.com/bwmarrin/discordgo"
"sort"
"time"
)
func init() {
Cmd["help"] = &f.Command{
Name: "Command Help Page Search",
Help: `# Info:
The built-in helper to get information about al... |
package main
import (
"bufio"
"github.com/gonum/plot"
"github.com/gonum/plot/plotter"
"github.com/gonum/plot/vg"
"math"
"os"
"strconv"
"strings"
"sync"
)
func check(e error) {
if e != nil {
panic(e)
}
}
func mean(vec []float64) float64 {
total := 0.0
for _, ele := range vec {
total += ele
}
total ... |
package io2
import (
"io"
)
// This class adapts an io.Reader into a io.WriteCloser
// It allows anyone to structure a zlib decompression as
// a write operation, rather than a read, making it more
// convenient to fit into a pipeline
type WriterToReaderAdapter struct {
workChan chan *[]byte
doneWorkChan chan ... |
package main
import (
"bufio"
"fmt"
"os"
"os/exec"
"strconv"
"strings"
"github.com/erazemk/sicsim/sim"
"github.com/pborman/getopt/v2"
)
func main() {
// Flags
debugFlag := getopt.BoolLong("debug", 'd', "Enable debug output")
helpFlag := getopt.BoolLong("help", 'h', "Show this text")
interactiveFlag := ge... |
// Copyright 2020 The Monogon Project Authors.
//
// SPDX-License-Identifier: Apache-2.0
//
// 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... |
package postgresqlflexibleservers
// Copyright (c) Microsoft and contributors. 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/LIC... |
// Copyright 2017 <NAME> http://www.sage42.org/
//
// 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 la... |
/*
Copyright 2016 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 ... |
/*
- Copyright 2014 <NAME>. 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 t... |
// Copyright 2018 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 debug
import (
"bytes"
"fmt"
"runtime"
"strings"
)
// exported from runtime
func modinfo() string
// ReadBuildInfo returns the build information ... |
package openapi3
import (
"fmt"
"github.com/go-dummy/dummy/internal/faker"
"io/ioutil"
"net/http"
"strconv"
"strings"
"github.com/go-yaml/yaml"
"github.com/go-dummy/dummy/internal/apischema"
)
func Parse(path string) (apischema.API, error) {
file, err := read(path)
if err != nil {
return apischema.API{}... |
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: github.com/yext/cloudprober/probes/testdata/testdata.proto
package cloudprober_probes_testdata
import proto "github.com/gogo/protobuf/proto"
import fmt "fmt"
import math "math"
import proto1 "github.com/yext/cloudprober/probes/proto"
// Reference imports ... |
package session
import (
"log"
"net"
"net/http"
"strconv"
"strings"
"time"
"golang.org/x/net/http/httpguts"
)
// String returns the serialization of the cookie for use in a Cookie
// header (if only Name and Value are set) or a Set-Cookie response
// header (if other fields are set).
// If c is nil or c.Name ... |
package vector
import (
"fmt"
"math"
"strings"
)
type Algorithm interface {
Compare(v1, v2 *Vector) (float64, error)
}
type simpsonComparator struct {
}
func (sc *simpsonComparator) Compare(v1, v2 *Vector) (float64, error) {
intersect := v1.Intersect(v2)
return intersect.Length() / math.Min(v1.Length(), v2.Le... |
package imgshow
import (
"errors"
"fmt"
"image"
"image/draw"
"io/ioutil"
"log"
"sync"
"github.com/BurntSushi/xgb"
"github.com/BurntSushi/xgb/xproto"
"github.com/BurntSushi/xgbutil"
"github.com/BurntSushi/xgbutil/ewmh"
"github.com/BurntSushi/xgbutil/keybind"
"github.com/BurntSushi/xgbutil/mousebind"
"git... |
// This file mostly contains structs that represent lox objects at runtime.
package lox
import (
"fmt"
"strconv"
"time"
)
func stringify(v interface{}) string {
switch v := v.(type) {
case nil:
return fmt.Sprint("nil")
case float64:
return fmt.Sprint(strconv.FormatFloat(v, 'f', -1, 64))
default:
return f... |
package api
import (
"errors"
bootflag "github.com/al8n/micro-boot/flag"
"github.com/al8n/micro-boot/internal/utils"
"github.com/sony/gobreaker"
"strings"
"time"
)
var (
ErrorNoAPIName = errors.New("API name is required")
ErrorNoAPIMakeFunc = errors.New("no endpoint make function is specified")
defaultAPIFl... |
package cht
import (
"encoding/xml"
"sort"
"github.com/go-faster/errors"
)
// Logger settings.
type Logger struct {
Level string `xml:"level"`
Console int `xml:"console,omitempty"`
}
// UsersXML config for ClickHouse.
type UsersXML struct {
Path string `xml:"path"`
}
// UserDir for ClickHouse.
type User... |
package models
import (
"github.com/astaxie/beego/orm"
"time"
)
// 提币表
/*
withdraw:
amount 提币数量
withdraw_id 请求发起方填的提现id,不能重复
to 提现目标地址
http://192.168.127.120:8080/service/BTC/address GET
http://192.168.127.120:8080/service/BTC/withdraw POST
*/
//提币审核表
type TokenskyUserTibiQueryParam struct {
BaseQueryParam
St... |
// Copyright 2018-2020 CERN
//
// 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 wr... |
/**
* @Time : 2019-07-12 10:31
* @Author : <EMAIL>
* @File : logging
* @Software: GoLand
*/
package logging
import (
"context"
"fmt"
"log"
"os"
"path/filepath"
"strings"
"time"
kitlog "github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/go-kit/kit/log/term"
"github.com/go-kit/kit... |
// databaseUtils.go contains various helpers for dealing with database and tables
package core
import (
"fmt"
"strings"
"zanaduu3/src/database"
"zanaduu3/src/sessions"
)
var (
allPageInfosOptions = &PageInfosOptions{
Unpublished: true,
Deleted: true,
}
)
// What pages to load from pageInfos table.
typ... |
// Copyright (c) 2018 The Biodv Authors.
// All rights reserved.
// Distributed under BSD2 license that can be found in the LICENSE file.
//
// Originally written by <NAME> <<EMAIL>>.
package biodv
import (
"io"
"sort"
"sync"
"github.com/js-arias/biodv/geography"
"github.com/pkg/errors"
)
// A Gazetteer is a ... |
// Copyright (c) 2021 <NAME>. All rights reserved.
// Copyright (c) 2022 <NAME>. All rights reserved.
//
// Use of this source code is governed by the MIT License that can be found
// in the LICENSE file.
//
package main
/*
* Capture internal definitions and rates
*
* Note:
* This plugin ***ASSUMES*** that the v... |
package ssh
import (
"fmt"
"net"
"time"
gossh "golang.org/x/crypto/ssh"
)
// Server defines parameters for running an SSH server. The zero value for
// Server is a valid configuration. When both PasswordHandler and
// PublicKeyHandler are nil, no client authentication is performed.
type Server struct {
Addr ... |
// 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 w... |
package ecql
import (
"reflect"
"strings"
"sync"
)
var (
// TAG_COLUMNS is the tag used in the structs to set the column name for a field.
// If a name is not set, the name would be the lowercase version of the field.
// If you want to skip a field you can use `cql:"-"`
TAG_COLUMN = "cql"
// TAG_TABLE is the... |
package internal
import (
"context"
"fmt"
"os"
"os/signal"
"strings"
"syscall"
"time"
"github.com/spf13/viper"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/leaderelection"
"k8s.io/client-go/tools/leaderelection/resourcelock"
... |
package main
import (
"fmt"
"log"
"net"
"os"
"runtime"
"strings"
"github.com/britannic/mflag"
cloudflare "github.com/cloudflare/cloudflare-go"
)
var (
// updated by go build -ldflags
architecture = "UNKNOWN"
build = "UNKNOWN"
cftoken = "UNKNOWN"
githash = "UNKNOWN"
hostOS = "UNKN... |
package v1
import (
"bytes"
"fmt"
"github.com/jenkins-x/jx/pkg/log"
"github.com/jenkins-x/jx/pkg/util"
"github.com/pkg/errors"
"github.com/stoewer/go-strcase"
"io/ioutil"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"strings"
)
// +genclient
// +genclient:noStatus
// +k8s:deepcopy-gen:interfaces=k8s.io/apim... |
// Copyright (c) 2021 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... |
package core_test
import (
"fmt"
"github.com/kmgreen2/agglo/internal/core"
"github.com/stretchr/testify/assert"
"testing"
)
func TestNewBinaryExpressions(t *testing.T) {
lhsVar := core.Variable("foo")
rhsVar := core.Variable("bar")
lhsNumber := 1
rhsNumber := 2
ops := []string{"+", "-", "*", "/", "**", "%", ... |
package capabilities
import (
"fmt"
"regexp"
"github.com/syndtr/gocapability/capability"
)
const (
// HCLSpecLiteral is an equivalent list to NomadDefaults, expressed as a literal
// HCL string for use in HCL config parsing.
HCLSpecLiteral = `["AUDIT_WRITE","CHOWN","DAC_OVERRIDE","FOWNER","FSETID","KILL","MKNO... |
package main
import (
"context"
"encoding/json"
"log"
"net/url"
)
import (
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/client"
"fmt"
)
// this holds docker clients
var clientMap = make(map[string]*c... |
/*
Copyright (c) 2018 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicen... |
// Copyright (c) 2022 <NAME> <<EMAIL>>. All rights reserved.
package intrinsic
import (
"bytes"
"encoding/gob"
"fmt"
"log"
"math/rand"
"net"
"strings"
"sync"
"sync/atomic"
"github.com/bzEq/bx/core"
)
type ClientContext struct {
GetProtocol func() core.Protocol
Limit int
Next string
Int... |
/*
Copyright 2021 The KubeVela 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, so... |
package util
import (
"context"
"encoding/base64"
"fmt"
"reflect"
"github.com/spf13/pflag"
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller/c... |
// Copyright 2012, Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package schema
import (
"fmt"
"strings"
"github.com/juju/errors"
"github.com/lanfang/go-mysql/mysql"
)
var ErrTableNotExist = errors.New("table is not exist... |
package sqlz
import (
"database/sql"
"fmt"
"reflect"
"strconv"
"time"
"github.com/neilotoole/sq/libsq/core/errz"
"github.com/neilotoole/sq/libsq/core/kind"
)
// Record is a []interface{} row of field values returned from a query.
//
// In the codebase, we distinguish between a "Record" and
// a "ScanRow", alt... |
package advisor
import (
"fmt"
"math"
"time"
autoscalingv2 "k8s.io/api/autoscaling/v2beta2"
corev1 "k8s.io/api/core/v1"
"k8s.io/klog/v2"
autoscalingapi "github.com/gocrane/api/autoscaling/v1alpha1"
predictionapi "github.com/gocrane/api/prediction/v1alpha1"
"github.com/gocrane/crane/pkg/prediction/config"
... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package ecs
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type ListContainerInstancesInput struct {
_ struct{} `type:"structure"`
// The short name or full Amazon Resource Name (ARN) ... |
package util
import (
"errors"
"fmt"
"reflect"
"strconv"
"time"
)
// MapFillStruct 用map填充结构体,遇到未知字段或数值转换错误返回具体错误
func MapFillStruct(data map[string]interface{}, obj interface{}) error {
for k, v := range data {
if v == nil {
continue
}
err := setField(obj, k, v)
if err != nil {
return err
}
}
... |
package output
import (
"bytes"
"embed"
"encoding/base64"
"fmt"
"html/template"
"math"
"os"
"reflect"
"regexp"
"strconv"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws/awsutil"
"github.com/cloudskiff/driftctl/pkg/alerter"
"github.com/cloudskiff/driftctl/pkg/analyser"
"github.com/cloudskiff/driftctl/p... |
package rainbow
import (
"bufio"
"fmt"
"os"
)
// a rmodule define the intermediate step for the reduce function.
type rmodule struct {
// a rmodule is provided a subslice from the hash and the previous
// rmodules. It will use it to make its decisions,
// thus modifying the password p byte array.
// It will tr... |
// Copyright 2019 PingCAP, 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... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package personalize
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type ListCampaignsInput struct {
_ struct{} `type:"structure"`
// The maximum number of campaigns to return.
MaxResu... |
package kafkachannel
import (
"context"
"fmt"
"github.com/confluentinc/confluent-kafka-go/kafka"
kafkav1alpha1 "github.com/kyma-incubator/knative-kafka/components/controller/pkg/apis/knativekafka/v1alpha1"
"github.com/kyma-incubator/knative-kafka/components/controller/pkg/env"
"github.com/kyma-incubator/knative-... |
package query
import (
"context"
"encoding/json"
"fmt"
"io"
"time"
"github.com/hashicorp/go-multierror"
"github.com/seventv/common/errors"
"github.com/seventv/common/mongo"
"github.com/seventv/common/redis"
"github.com/seventv/common/structures/v3"
"github.com/seventv/common/utils"
"go.mongodb.org/mongo-d... |
// MIT License
//
// Copyright (c) 2020 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 2019 The OpenEBS Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... |
/*
Copyright 2020, 2021 The Flux 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, s... |
/**
# Copyright (c) 2021, NVIDIA 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
#
# Unless required by a... |
// Copyright (C) 2017 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 t... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package mq
import (
"context"
"time"
"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 CreateConfigurationInput struct {
_ struct{} `type:"structure"`
... |
package google
import (
"fmt"
"strings"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"google.golang.org/api/iam/v1"
)
func resourceGoogleProjectIamCustomRole() *schema.Resource {
return &schema.Resource{
Create: resourceGoogleProjectIamCustomRoleCreate,
... |
// Copyright 2018 The go-python Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Opcodes from opcodes.h
package vm
// Type for OpCodes
type OpCode byte
const (
// Instruction opcodes for compiled code
POP_TOP OpCode = 1
... |
package age
import (
"bytes"
"fmt"
"io"
"os"
"path/filepath"
"strings"
"filippo.io/age"
"filippo.io/age/armor"
"github.com/sirupsen/logrus"
"go.mozilla.org/sops/v3/logging"
)
var log *logrus.Logger
func init() {
log = logging.NewLogger("AGE")
}
const privateKeySizeLimit = 1 << 24 // 16 MiB
// MasterKey... |
// 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 stex
// Copyright (c) 2015-2019 Bitontop Technologies Inc.
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
import (
"encoding/json"
)
type JsonResponse struct {
Success int `json:"success"`
Data json.... |
package crypto
import (
"crypto/cipher"
"errors"
"github.com/turtledex/fastrand"
)
var (
// TypeDefaultRenter is the default CipherType that is used for
// encrypting pieces of uploaded data.
TypeDefaultRenter = TypeThreefish
// TypeDefaultWallet is the default CipherType that is used for
// wallet operation... |
package controllers
import (
"context"
"fmt"
"strings"
"time"
srov1beta1 "github.com/openshift-psap/special-resource-operator/api/v1beta1"
"github.com/openshift-psap/special-resource-operator/pkg/cache"
"github.com/openshift-psap/special-resource-operator/pkg/clients"
"github.com/openshift-psap/special-resour... |
package tachymeter
import (
"fmt"
"math"
"sort"
"sync/atomic"
"time"
)
// Calc summarizes Tachymeter sample data
// and returns it in the form of a *Metrics.
func (m *Tachymeter) Calc() *Metrics {
metrics := &Metrics{}
if atomic.LoadUint64(&m.Count) == 0 {
return metrics
}
m.Lock()
metrics.Samples = int... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.