text stringlengths 3.08k 10.4k |
|---|
package rbtree
import (
"log"
)
type color bool
const (
red color = true
black color = false
)
var (
nilNode = &RBTree{0, 0, black, nil, nil, nil}
)
// RBTree ...
type RBTree struct {
key uint32
value interface{}
color color // true - red, false - black
left *RBTree
right *RBTree
parent *RBTree
}... |
package color
import (
"image/color"
"math"
)
type HSV struct {
H, S, V float64 // TODO consider a fixed-point repr, e.g., int32
}
// Conform to color.Color interface:
func (c HSV) RGBA() (r, g, b, a uint32) {
r, g, b = hsvToRGB(c.H, c.S, c.V)
a = 0xffff
return
}
// Conform to color.ColorModel:
func hsvModel(... |
package main
import (
"database/sql"
"encoding/hex"
"math/rand"
"strconv"
"time"
)
// List is a to-do list (along with its list items).
type List struct {
ID string
TimeCreated time.Time
Name string
Items []*Item
}
// Item is a single to-do list item.
type Item struct {
ID st... |
package assets
import (
"crypto/sha256"
"encoding/base64"
"errors"
"fmt"
"html/template"
"io/fs"
"log"
"mime"
"net/http"
"os"
"path"
"path/filepath"
"strings"
"time"
)
const year = 8766 * time.Hour
type Maps map[string][]string
type Path struct {
p string
i []string
}
func (p Path) Name() string {
... |
package generator
import (
"fmt"
"io/ioutil"
"strings"
)
// CreateMakeFile create make file
func CreateMakeFile(fileName, binName string) error {
createDir(fileName)
mkfile := strings.Replace(mkfiletpl, "[[bin]]", binName, -1)
mkfile = strings.Replace(mkfile, "[[u]]", binName, -1)
if err := ioutil.WriteFile(fi... |
package terminal
type Node interface {
Value() string
Start() int
End() int
Type() string
}
type baseNode struct {
start, end int
value string
}
func (bn *baseNode) Value() string {
return bn.value
}
func (bn *baseNode) Start() int {
return bn.start
}
func (bn *baseNode) End() int {
return bn.end
}
... |
package cache
import (
"encoding/json"
"errors"
"fmt"
"html"
"log"
"net"
"net/http"
"os"
"path/filepath"
"regexp"
"time"
)
var blobNameSHA256 = regexp.MustCompile("^/?(.*/)?(ac/|cas/)([a-f0-9]{64})$")
// HTTPCache ...
type HTTPCache interface {
CacheHandler(w http.ResponseWriter, r *http.Request)
Status... |
// Copyright 2019 Yunion
//
// 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 timeconv provides some simple function to convert go time.Time values. Please refer to functions below.
package timeconv
import (
// "log"
"bytes"
"fmt"
"time"
)
var (
uptime = time.Now()
)
// AddDate returns the time corresponding to adding the given number of years, months, and days to t. For examp... |
package gcsemu
import (
"context"
"os"
"sync"
"time"
"github.com/google/btree"
"google.golang.org/api/storage/v1"
)
type memstore struct {
mu sync.RWMutex
buckets map[string]*memBucket
}
var _ Store = (*memstore)(nil)
func NewMemStore() *memstore {
return &memstore{buckets: map[string]*memBucket{}}
}... |
package service
import (
"crypto/sha256"
"encoding/hex"
"encoding/json"
publicUtil "github.com/txchat/dtalk/pkg/util"
"github.com/txchat/dtalk/service/auth/model"
"gopkg.in/yaml.v2"
"io/ioutil"
"net/http"
"strings"
"time"
)
func (s *Service) Auth(request *model.AuthRequest) (res *model.AuthResponse, err err... |
package services
import (
"Kinux/core/k8s"
"Kinux/core/web/models"
"Kinux/tools/bytesconv"
"errors"
jsoniter "github.com/json-iterator/go"
"github.com/sirupsen/logrus"
"github.com/spf13/cast"
v1 "k8s.io/api/core/v1"
"k8s.io/client-go/tools/remotecommand"
)
func init() {
RegisterWebsocketOperation(wsOpNewPty... |
package lib
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"strings"
"time"
)
type flirt4FreeCheckResponse struct {
Status string `json:"status"`
}
type flirt4FreeOnlineModel struct {
Name string `json:"name"`
ScreencapImage string `json:"screencap_image"`
}
type flirt4F... |
package main
import (
"log"
"os"
"github.com/docopt/docopt.go"
"github.com/go-martini/martini"
"github.com/martini-contrib/binding"
"github.com/martini-contrib/render"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
)
// Note contains a title and content.
type note struct {
ID bson.ObjectId `json:"id" bson:... |
/*
CircuitBreaker package implements circuit breaker pattern which
acts as a proxy for a particular remote service. It trips the circuit
if requests are likely to be failed to remote service and untrips it
after requests would be successful.
Trip function is used to open the circuit based on the circuit counters
... |
// Code generated by go-swagger; DO NOT EDIT.
package verification
// 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... |
package main
import (
"context"
"docker.io/go-docker"
"docker.io/go-docker/api/types"
"docker.io/go-docker/api/types/swarm"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"github.com/docker/distribution/notifications"
"io"
"net/http"
)
var allowedWebHookEndpoints = map[string]bool{
APIEndpointWebHookReg... |
// 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 writ... |
// Package btree provides an implementation of a B-tree. A B-tree is a
// logarithmic search tree that maintains key-value pairs in sorted order. It
// is not binary because it stores more than 2 data entries per node. The
// branching factor for this tree is 64.
package btree
import (
g "github.com/zyedidia/generic"... |
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: export.proto
package info
import (
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
_ "github.com/gogo/protobuf/types"
_ "github.com/mwitkow/go-proto-validators"
math "math"
)
// Reference imports to suppress e... |
package local
import (
"bytes"
"context"
"fmt"
"io/ioutil"
"math/rand"
"os"
"testing"
"github.com/google/uuid"
"github.com/grafana/tempo/tempodb/backend"
"github.com/grafana/tempo/tempodb/encoding/common"
"github.com/stretchr/testify/assert"
)
const objectName = "test"
const objectReaderName = "test-reade... |
package consumer
import (
"context"
"encoding/json"
"time"
"github.com/boxidau/sampled/consumer/config"
"github.com/boxidau/sampled/consumer/sample"
"github.com/boxidau/sampled/consumer/storedriver"
"github.com/golang/glog"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com... |
package cmd
import (
"strings"
"time"
"github.com/rsteube/carapace"
"github.com/rsteube/carapace-bin/completers/helm_completer/cmd/action"
"github.com/rsteube/carapace-bin/pkg/util"
"github.com/spf13/cobra"
)
var installCmd = &cobra.Command{
Use: "install",
Short: "install a chart",
Run: func(cmd *cobra... |
// Code generated by go-swagger; DO NOT EDIT.
package devices
// 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.com/... |
package main
import (
"fmt"
"net/http"
manners "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/braintree/manners"
ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
manet "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr-net"
cmds "githu... |
// Copyright 2018-2019 The logrange 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... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: outbound.proto
package pbs
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-t... |
/*
Copyright The KubeDB 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, software
... |
// Code generated by go-swagger; DO NOT EDIT.
// Copyright (c) 2016, 2017, 2018 <NAME> <<EMAIL>>.
// 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 ... |
// Copyright (c) 2004-present Facebook All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated (@generated) by entc, DO NOT EDIT.
package ent
import (
"context"
"errors"
"strconv"
"github.com/facebookincubator/ent/dialect/sql... |
// Copyright 2014,2015,2016,2017,2018,2019,2020,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 a... |
package certmanager
import (
"context"
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"crypto/x509/pkix"
"errors"
"fmt"
"time"
cmapi "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1"
cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1"
cmversionedclient "github.com/jetstack/cert-manager/pkg/client... |
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016 Datadog, Inc.
package elastic
import (
"bytes"
"errors"
"fmt"
"io"
"io/ioutil"
"os"
"te... |
// Copyright 2019-present Open Networking 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
//
// Unless required by applica... |
package cmdutil
import (
"fmt"
"os"
"reflect"
"regexp"
"strings"
"github.com/spf13/cobra"
)
type flags []flag
type flag struct {
// e.g. foo
Name string
// With struct hierarchy prefix
// e.g. prefix-foo
FullName string
Shorthand string
Usage string
// Enable env
EnableEnv bool
// With struct ... |
package egoscale
// InstancePoolState represents the state of an instance pool.
type InstancePoolState string
const (
// InstancePoolCreating creating state.
InstancePoolCreating InstancePoolState = "creating"
// InstancePoolRunning running state.
InstancePoolRunning InstancePoolState = "running"
// InstancePool... |
package policycache
import (
"sync"
kyvernov1 "github.com/kyverno/kyverno/api/kyverno/v1"
"github.com/kyverno/kyverno/pkg/autogen"
"github.com/kyverno/kyverno/pkg/policy"
kubeutils "github.com/kyverno/kyverno/pkg/utils/kube"
"k8s.io/apimachinery/pkg/util/sets"
)
type store interface {
// set inserts a policy ... |
package main
import (
"fmt"
"math/rand"
"reflect"
"strings"
"time"
)
// NbTirage is the number of letters in the tirage
const nbTirage = 10
// Mot is the class that holds the game
type Mot struct {
voyelles string
consonnes string
}
// NewMot initializes the Mot structure
func NewMot() *Mot {
m := new(Mot)... |
package entities
import (
"math/rand"
"sort"
tl "github.com/JoelOtter/termloop"
"github.com/zladovan/gorched/core"
"github.com/zladovan/gorched/debug"
"github.com/zladovan/gorched/entities/terrain"
"github.com/zladovan/gorched/physics"
)
// World represents game world with all entities.
// It extends from ter... |
package message
import (
"errors"
"log"
"time"
)
type Channel struct {
name string
addClientChan chan ChanReq
removeClientChan chan ChanReq
clients []*Client
backend NSQueue
incomingMessageChan chan *Message
msgChan chan *Message
inFlightMessageCh... |
package dns
import (
"context"
"net"
"sync"
"time"
"github.com/qdm12/golibs/command"
"github.com/qdm12/golibs/logging"
"github.com/qdm12/private-internet-access-docker/internal/constants"
"github.com/qdm12/private-internet-access-docker/internal/settings"
)
type Looper interface {
Run(ctx context.Context, r... |
// Code generated by go-swagger; DO NOT EDIT.
package client
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
strfmt "github.com/go-ope... |
package bplustree
import (
"bytes"
"encoding/binary"
"errors"
"io"
"minidb-go/storage/index"
"minidb-go/storage/pager"
"minidb-go/storage/pager/pagedata"
"minidb-go/storage/recovery/redo/redolog"
"minidb-go/util"
"sort"
"sync"
)
type BPlusTreeNode struct {
Addr util.UUID
Parent util.UUID
PreLeaf ... |
/*
Copyright 2017 The Goock 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, softw... |
/*
Copyright 2020.
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
distributed un... |
package manta
import (
"container/heap"
"fmt"
)
// Interface for the tree, only implements Weight
type huffmanTree interface {
Weight() int
IsLeaf() bool
Value() int
Left() huffmanTree
Right() huffmanTree
}
// A leaf, contains encoded value
type huffmanLeaf struct {
weight int
value int
}
// A node with p... |
package auth
import (
"context"
"errors"
"fmt"
"strconv"
"strings"
"github.com/txsvc/stdlib/pkg/timestamp"
)
const (
// AuthTypeBearerToken constant token
AuthTypeBearerToken = "token"
// AuthTypeJWT constant jwt
AuthTypeJWT = "jwt"
// AuthTypeSlack constant slack
AuthTypeSlack = "slack"
// other defau... |
package crypto
import (
"os"
"path"
"path/filepath"
"github.com/VirtusLab/go-extended/pkg/files"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
// Crypt is an abstraction for encryption and decryption with files support
type Crypt interface {
Crypter
EncryptFile(inputPath, outputPath string) error
E... |
package object
import (
"encoding/json"
"github.com/denisskin/bin"
"github.com/likecoin-pro/likecoin/assets"
"github.com/likecoin-pro/likecoin/blockchain"
"github.com/likecoin-pro/likecoin/blockchain/state"
"github.com/likecoin-pro/likecoin/commons/bignum"
"github.com/likecoin-pro/likecoin/crypto"
)
type Tran... |
package interval
import (
"fmt"
"github.com/mewmew/lnp/pkg/cfa"
"github.com/mewmew/lnp/pkg/cfa/primitive"
"gonum.org/v1/gonum/graph"
)
// structNway structures n-way conditionals in the given control flow graph and
// its dominator tree.
//
// Pre: G is a control flow graph.
//
// Post: n-way conditionals are st... |
package main
import (
"bytes"
"fmt"
"log"
"net"
"net/http"
"net/url"
"strings"
"time"
shadowsocksr "github.com/mzz2017/shadowsocksR"
"github.com/mzz2017/shadowsocksR/client"
"github.com/mzz2017/shadowsocksR/tools/leakybuf"
"github.com/mzz2017/shadowsocksR/tools/socks"
"github.com/nadoo/glider/proxy"
)
v... |
package generate
import (
"errors"
"os"
"path/filepath"
"strings"
"github.com/gobuffalo/buffalo/generators/resource"
"github.com/gobuffalo/envy"
"github.com/gobuffalo/makr"
"github.com/markbates/inflect"
"github.com/spf13/cobra"
)
const resourceExamples = `$ buffalo g resource users
Generates:
- actions/us... |
// -----------------------------------------------------------------------------
// Go Language Experiments go-experiments/[rsa_demo.go]
// (c) <EMAIL> License: MIT
// -----------------------------------------------------------------------------
package mai... |
package cache
import (
"fmt"
"strings"
"sync"
"time"
"github.com/miekg/dns"
backer "github.com/patrickmn/go-cache"
"github.com/chrisruffalo/gudgeon/util"
)
const (
// pattern to use for building each step of the key
_keyPattern = "%s|%s|%s"
// absolute max TTL
dnsMaxTTL = uint32(604800)
/// default time... |
package sink_aliyun
import (
"fmt"
"net/url"
sls "github.com/aliyun/aliyun-log-go-sdk"
"github.com/aliyun/aliyun-log-go-sdk/producer"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
)
const (
AliyunSLSSchema = "aliyun-sls"
AliyunSLSParamProject = "project"
AliyunSLSParamLogStore ... |
// Copyright 2016 The Vanadium 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 (
"bufio"
"fmt"
"net"
"os"
"path/filepath"
"strconv"
"strings"
"time"
"v.io/x/ref/services/agent/server"
)
// In addition ... |
package webpush
import (
"bytes"
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"encoding/binary"
"fmt"
"io"
"io/ioutil"
)
const (
NULLBYTE = '\x00'
BLOCK_SIZE = 4078
ENCRYPTED_BLOCK_SIZE = 4096
GCM_WEBPUSH_ENDPOINT = "https://gcm-http/googleapis.com/gcm"
GCM_URL = "ht... |
package main
import (
"fileutils"
"flag"
"fmt"
"image/png"
"image"
"io/ioutil"
"os"
"scummatlas"
l "scummatlas/condlog"
"scummatlas/templates"
"strings"
"sync"
)
const REQUIRED string = "REQUIRED"
var gamedir string
var outputdir string
var singleRoom int
var noimages bool
var multicpu bool
var dumpdecod... |
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"sync"
"time"
"github.com/Clever/http-science/config"
"github.com/Clever/http-science/email"
"github.com/Clever/http-science/getfiles"
"github.com/Clever/http-science/gor"
"github.com/Clever/http-science/science"
"github.com/C... |
package vsltag
import (
"github.com/Showmax/vslparser"
"math"
"net"
"net/url"
"strconv"
"strings"
"time"
)
// Based on Varnish docs
// https://varnish-cache.org/docs/trunk/reference/vsl.html
// BackendOpen stands for Backend connection opened. Logged when a new backend
// connection is opened.
type BackendOpe... |
//
// Modified BSD 3-Clause Clear License
//
// Copyright (c) 2019 Insolar Technologies GmbH
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted (subject to the limitations in the disclaimer below) provided that
// the following conditions a... |
/*
* Copyright (C) 2020 Intel Corporation
* SPDX-License-Identifier: BSD-3-Clause
*/
package tasks
import (
"fmt"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
clog "intel/isecl/lib/common/v4/log"
"intel/isecl/lib/common/v4/setup"
"intel/isecl/sgx_agent/v4/config"
"intel/isecl/sgx_agent/v4/constants"
... |
package gobus
import (
"fmt"
"strings"
goeh "github.com/hetacode/go-eh"
"github.com/streadway/amqp"
)
// RabbitMQServiceBus implementation of service bus
type RabbitMQServiceBus struct {
mode ServiceBusMode
logger ServiceBusLogger
channel *amqp.Channel
options *RabbitMQServiceBusOptio... |
package gorean
import (
"fmt"
)
// GenerateEdgeNGramTokens is for creating forward match at service
func GenerateEdgeNGramTokens(str string) ([]string, error) {
var tokens []string
var stackedKeywords []string
argRunes := []rune(str)
for alphabetPos := range argRunes {
var stack []rune
for i := 0; i <= alpha... |
package ws
import (
"net/http"
"time"
"github.com/gorilla/websocket"
)
var (
// debug can be set to true to enable verbose http errors
// TODO add debug logger
debug = false
)
// SetDebug turns debug output on or off
func SetDebug(on bool) {
debug = on
}
func onConnect(ctr Connector, r *http.Request) error ... |
/*
Command gudcat either starts a server to listen for data (gudcat server), or
starts sending data itself (gudcat client).
Usage
gudcat client [options] address
gudcat server address
See `gudcat <command> -h` for more info
Server Usage:
gudcat server [options] address
Listen on <address> for data ... |
package components
import (
"fmt"
"github.com/abadojack/whatlanggo"
"github.com/daviddengcn/go-colortext"
"log"
"os"
"os/user"
"path/filepath"
"strings"
"time"
)
type Blog struct {
Title string
Author string
CreateTime string
Category string
Summary string
CopyrightInfo str... |
package config
import (
"errors"
"net/netip"
"os"
"github.com/go-void/portal/pkg/constants"
"github.com/go-void/portal/pkg/utils"
"github.com/pelletier/go-toml/v2"
)
var (
ErrInvalidResolverUpstream = errors.New("invalid resolver upstream")
ErrInvalidCollectorBackend = errors.New("invalid collector backend"... |
// 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 (
"net/http"
"time"
"golang.org/x/net/context"
"github.com/go-openapi/errors"
"github.com/go-openapi/runt... |
// Package compress contains CLI `compress` command implementation.
package compress
import (
"context"
"errors"
"fmt"
"os"
"runtime"
"sort"
"sync"
"sync/atomic"
"time"
"github.com/spf13/cobra"
"github.com/tarampampam/tinifier/v3/internal/pkg/breaker"
"github.com/tarampampam/tinifier/v3/internal/pkg/env"
... |
package api
import (
"github.com/gin-gonic/gin"
"github.com/konveyor/tackle2-hub/model"
"net/http"
)
//
// Kind
const (
BusinessServiceKind = "business-service"
)
//
// Routes
const (
BusinessServicesRoot = ControlsRoot + "/business-service"
BusinessServiceRoot = BusinessServicesRoot + "/:" + ID
)
//
// Busi... |
package base
// Copyright 2020 The GoVision Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use 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... |
// Copyright 2019 Yunion
//
// 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 retwitch
import (
"bytes"
"encoding/json"
"sort"
"strconv"
"strings"
)
type Text []TextSegment
type TextSegment struct {
Text string
EmoteID string
EmoteText string
Bits int
BitsColor string
}
func (t Text) String() string {
b := &strings.Builder{}
for _, segment := range t {
b.Wr... |
package ansicsi
import "io"
const (
SGRReset = 0 // Default rendition (implementation-defined), cancels the effect of any preceding occurrence of SGR
SGRBold = 1 // Bold or increased intensity
SGRFaint = 2 // Faint, decreased intensity or second color
SGRI... |
// Copyright <NAME>, 2022-present. All rights reserved.
package hummingbird
import (
"context"
"fmt"
"os"
"strings"
"time"
"go.mongodb.org/mongo-driver/bson/primitive"
"github.com/simagix/gox"
"github.com/simagix/keyhole/mdb"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
)
const ... |
package types
import (
"fmt"
"go/ast"
"reflect"
"sort"
"sync"
"github.com/redneckbeard/thanos/bst"
)
type Class struct {
name, parentName, Prefix string
*proto
Instance instance
parent *Class
children []*Class
UserDefined bool
}
func NewClass(name, parent string, inst instance, registry *clas... |
// Copyright 2015 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... |
/*
A message to/from a peer.
*/
package messages
import (
"crypto/ed25519"
"errors"
"github.com/cryptic-monk/go-nyzo/internal/nyzo/messages/message_content"
"github.com/cryptic-monk/go-nyzo/internal/nyzo/messages/message_content/message_fields"
"github.com/cryptic-monk/go-nyzo/internal/nyzo/utilities"
"github.co... |
/*
* © 2018 SwiftyCloud OÜ. All rights reserved.
* Info: <EMAIL>
*/
package main
import (
"log"
"time"
"sync"
"errors"
"sync/atomic"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
)
var quotaCheckThresh uint32 = 4
var unlockScanPeriod time.Duration = time.Minute
var quotas sync.Map
type cheqReq struct {
db str... |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package akamai
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// **Scopes**: Security policy
//
// Returns the slo... |
package server
import (
"github.com/runatlantis/atlantis/server/logging"
)
// UserConfig holds config values passed in by the user.
// The mapstructure tags correspond to flags in cmd/server.go and are used when
// the config is parsed from a YAML file.
type UserConfig struct {
AllowForkPRs bool `ma... |
package cryptoAmino
import (
"os"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"my-tendermint/tendermint/crypto"
"my-tendermint/tendermint/crypto/ed25519"
"my-tendermint/tendermint/crypto/multisig"
"my-tendermint/tendermint/crypto/secp256k1"
)
type byter interface {
B... |
package compat
import (
"fmt"
"io/ioutil"
"net/http"
"os"
goRuntime "runtime"
"strings"
"time"
"github.com/containers/common/pkg/config"
"github.com/containers/common/pkg/sysinfo"
"github.com/containers/podman/v2/libpod"
"github.com/containers/podman/v2/libpod/define"
"github.com/containers/podman/v2/pkg/... |
package manager
import (
"context"
"fmt"
"path/filepath"
"plugin"
"strconv"
"strings"
"sync"
"github.com/infrawatch/apputils/logging"
"github.com/infrawatch/sg-core/pkg/application"
"github.com/infrawatch/sg-core/pkg/bus"
"github.com/infrawatch/sg-core/pkg/handler"
"github.com/infrawatch/sg-core/pkg/trans... |
package gameutils
import (
"github.com/hajimehoshi/ebiten/v2"
"image"
)
// Interfaz básica de Entidad
type BaseEntity interface {
Update() error
Draw(screen *ebiten.Image)
CheckPosition(x int, y int) bool
GetPosition() (float64, float64)
SetPosition(x float64, y float64)
Move(x float64... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package devicefarm
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
// Represents a request to the get device pool compatibility operation.
type GetDevicePoolCompatibilityInput struct {
_ ... |
package main
import (
"context"
"flag"
"fmt"
"github.com/sirupsen/logrus"
"log"
"net/http"
_ "net/http/pprof"
"runtime"
"strconv"
"strings"
"time"
"github.com/rpcxio/rpcx-benchmark/proto"
"github.com/spf13/viper"
"github.com/topfreegames/pitaya/v2"
"github.com/topfreegames/pitaya/v2/acceptor"
"github.... |
package thorchain
import (
"fmt"
"github.com/blang/semver"
"gitlab.com/thorchain/thornode/common"
"gitlab.com/thorchain/thornode/common/cosmos"
"gitlab.com/thorchain/thornode/constants"
"gitlab.com/thorchain/thornode/x/thorchain/keeper"
)
// SetNodeKeysHandler process MsgSetNodeKeys
// MsgSetNodeKeys is used ... |
package test
import (
"flag"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"testing"
"time"
"github.com/joho/godotenv"
"github.com/mantil-io/mantil/kit/aws"
"github.com/mantil-io/mantil/domain"
"github.com/mantil-io/mantil/kit/clitest"
"github.com/mantil-io/mantil/kit/testutil"
"github.com/stretchr/t... |
// Package dhcpv6 provides encoding and decoding of DHCPv6 messages and
// options.
package dhcpv6
import (
"fmt"
"net"
"github.com/u-root/uio/uio"
)
type DHCPv6 interface {
Type() MessageType
ToBytes() []byte
String() string
Summary() string
IsRelay() bool
// GetInnerMessage returns the innermost encapsul... |
package pgpmail
import (
"bytes"
"io"
"testing"
"github.com/ProtonMail/go-crypto/openpgp"
"github.com/emersion/go-message/textproto"
)
func init() {
forceBoundary = "foo"
}
func TestEncrypt(t *testing.T) {
var h textproto.Header
h.Set("From", "<NAME> <<EMAIL>>")
h.Set("To", "<NAME> <<EMAIL>>")
var encryp... |
package gopack
import (
"encoding/binary"
"errors"
"io"
"net"
"sync"
"time"
)
// ErrMissingParams missing parameters error
var ErrMissingParams = errors.New("missing parameters")
// GoPack2 GoPack2 main class
// naming GoPack2 instead of GoPack to compatible with gomobile bind
type GoPack2 struct {
opts ... |
// Copyright 2020 CUE Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package lambda
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 ListLayersInput struct {
_ struct{} `type:"structure"`
// A runtime ... |
package main
import (
"encoding/json"
"errors"
"flag"
"fmt"
"regexp"
"strings"
"time"
"github.com/cloudfoundry/cli/cf/api/resources"
//"github.com/cloudfoundry/cli/cf/terminal"
"github.com/cloudfoundry/cli/plugin"
)
type JanitorPlugin struct{
cliConnection plugin.CliConnec... |
package content
import (
"fmt"
"log"
"net/http"
"github.com/ponzu-cms/ponzu/management/editor"
"github.com/ponzu-cms/ponzu/system/admin/user"
"github.com/ponzu-cms/ponzu/system/api"
"github.com/ponzu-cms/ponzu/system/item"
)
type Song struct {
item.Item
Title string `json:"title"`
... |
// Copyright ©2017 The Gonum 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 mat
import (
"gonum/blas"
"gonum/blas/blas64"
)
var (
symBandDense *SymBandDense
_ Matrix = symBandDense
_ Sy... |
//
// Copyright (c) 2019-2020 FRAGATA COMPUTER SYSTEMS AG
// Copyright (c) 2017 The Khronos Group 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/lice... |
// 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.