text stringlengths 3.08k 10.4k |
|---|
package main
import (
"context"
"encoding/json"
"errors"
"fmt"
"math/rand"
"os"
"strconv"
"time"
"cloud.google.com/go/pubsub"
"github.com/honeycombio/libhoney-go"
)
// ErrEventSkippedDueToSampling is a sentinel error that represents a skipped message.
var ErrEventSkippedDueToSampling = errors.New("skipped ... |
package stream
import (
"bytes"
"fmt"
"io"
"regexp"
"strconv"
"strings"
"sync"
logging "github.com/op/go-logging"
)
const (
ioBufferSize = 32 * 1024
//messageBufferSize = 10 * 1024
)
var (
log = logging.MustGetLogger("stream")
pmMsgPattern = regexp.MustCompile("^(\\d+)(:{2,3})(.*)$")
headerP... |
package schema
import (
"errors"
"fmt"
"go/ast"
"reflect"
"sync"
)
var (
// ErrUnsupportedType unsupported data type
ErrUnsupportedType = errors.New("unsupported type")
ErrUnsupportedTag = errors.New("unsupported tag")
ErrTypeMismatchTag = errors.New("type mismatch tag")
ErrTagCo... |
// +build darwin
package trash
import (
"bytes"
"errors"
"fmt"
"os"
"os/exec"
"os/user"
"path/filepath"
"strconv"
"strings"
"time"
)
// Adapted from https://github.com/morgant/tools-osx/blob/master/src/trash
func haveScriptableFinder() (bool, error) {
// Get current user
user, err := user.Current()
if e... |
/*
* @Author: yangdihang
* @Date: 2020/5/21
*/
package virtualservice
import (
"context"
"k8s.io/apimachinery/pkg/api/errors"
v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/controller"
"sigs.k8s.io/co... |
package parser
import (
"fmt"
"strconv"
"github.com/domterion/yapl/ast"
"github.com/domterion/yapl/lexer"
"github.com/domterion/yapl/token"
)
/*
This is a recursive descent parser
We start with one root node then that builds child nodes by calling respective functions for tokens
Then we repeat this, recursion,... |
package tbuikit
import (
"github.com/nsf/termbox-go"
)
// A widget which essentially knows how to draw a slice of strings.
// It relies on a buffer type which meets the TextBuffer interface being passed in.
//
// To control where it is drawn on the screen, it uses a function value which returns the four corners
// o... |
/*
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 writing, ... |
// Copyright 2009 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.
// SRPC server
package srpc
import (
"bytes";
"log";
"os";
"syscall";
)
// TODO(rsc): I'd prefer to make this
// type Handler func(m *msg) Errno
// but ... |
// Copyright Istio Authors. 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 l... |
package main
import (
"log"
"strconv"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/widget"
"github.com/Knetic/govaluate"
)
type calc struct {
equation string //输出的字符串
last string //最后输出的字符串
output *widget.Label // 输出框
buttons map[string]*widget.Button // 按钮合集
window f... |
// Copyright © 2019 <NAME>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in wri... |
package cluster
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"net/http"
"sync"
"time"
"github.com/toni-moreno/influxdb-srelay/pkg/backend"
"github.com/toni-moreno/influxdb-srelay/pkg/relayctx"
"github.com/toni-moreno/influxdb-srelay/pkg/utils"
)
func (c *Cluster) HandlePing(w http.ResponseWriter, r *ht... |
// Copyright 2017 Drone.IO 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 gitea
import (
"context"
"fmt"
"time"
"github.com/drone/go-scm/scm"
)
type pullService struct {
client *wrapper
}
func (s *pullService) Find(ctx ... |
package actions
import (
"github.com/gobuffalo/buffalo"
"github.com/gobuffalo/buffalo/middleware"
"github.com/gobuffalo/buffalo/middleware/csrf"
"github.com/gobuffalo/buffalo/middleware/i18n"
"github.com/gobuffalo/buffalo/middleware/ssl"
"github.com/gobuffalo/buffalo/worker"
"github.com/gobuffalo/gocraft-work-a... |
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use ... |
// Copyright (c) 2016, 2018, 2020, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei... |
package main
import (
"encoding/binary"
"fmt"
"math"
"os"
"runtime"
"gonum.org/v1/gonum/mat"
"github.com/phil-mansfield/gotetra/render/geom"
"github.com/phil-mansfield/gotetra/render/io"
"github.com/phil-mansfield/minnow/go/minh"
"github.com/phil-mansfield/tetra_deformation/lib"
)
const (
NumCPU = 1
... |
// Copyright 2014 The Azul3D Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Example - Demonstrates texture coordinates.
package main
import (
"go/build"
"image"
_ "image/png"
"log"
"os"
"path/filepath"
"azul3d.org/gfx.v1... |
package main
import (
"encoding/json"
"flag"
"fmt"
"log"
"net/http"
"net/http/pprof"
"os"
"strings"
mqtt "github.com/eclipse/paho.mqtt.golang"
"golang.org/x/net/trace"
)
var (
listenAddress = flag.String("listen",
":8773",
"listen address for HTTP API (e.g. for Shelly buttons)")
mqttBroker = flag.St... |
/*
Copyright 2020 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 transfer
import (
"context"
"errors"
"fmt"
"net"
"sync"
"github.com/coredns/coredns/plugin"
clog "github.com/coredns/coredns/plugin/pkg/log"
"github.com/coredns/coredns/request"
"github.com/miekg/dns"
)
var log = clog.NewWithPlugin("transfer")
// Transfer is a plugin that handles zone transfers.
t... |
package umbrella
import (
"context"
"database/sql"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"strings"
"testing"
"time"
_ "github.com/lib/pq"
"github.com/ory/dockertest/v3"
)
// Global vars used across all the tests
var dbUser = "goumbrellatest"
var dbPass = "<PASSWORD>"
var dbName = "goumbrella"
var dbCon... |
package gtdb
import (
"time"
"github.com/jinzhu/gorm"
)
// type OnlineAppData struct {
// ID uint64 `redis:"id" json:"id,string"`
// Account string `redis:"account" json:"account"`
// Appname string `redis:"appname" json:"appname"`
// Zonename string `redis:"zonename" json:"zonename"`
// Nickname stri... |
package gemax
import (
"bytes"
"context"
"errors"
"fmt"
"io"
"io/fs"
"net/http"
"path"
"strings"
"github.com/ninedraft/gemax/gemax/status"
)
// FileSystem serves file systems as gemini catalogs.
// It will search index.gmi and index.gemini in each catalog
// to use it content as header of corresponding dir... |
/*
Copyright (c) 2016, The go-imagequant author(s)
Permission to use, copy, modify, and/or distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright notice
and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WA... |
package codegen
import (
"fmt"
"os"
"path"
"strings"
"text/template"
"github.com/cortezaproject/corteza-server/pkg/slice"
"gopkg.in/yaml.v3"
)
type (
// definitions are in one file
eventsDef struct {
Package string
App string
Source string
outputDir string
// List of imports
// Used ... |
package main
import (
"bufio"
"encoding/base64"
"image/png"
"io/ioutil"
"log"
"net"
"os"
"os/exec"
"strconv"
screenshot "github.com/kbinani/screenshot"
goInfo "github.com/matishsiao/goInfo"
)
const (
IP = "IPAddress:ServerPort"
FILENAME = "FileNameCHAOS"
FOLDER_PATH = "... |
package srnd
import (
"bufio"
"crypto/rand"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/pem"
"errors"
"io"
"io/ioutil"
"log"
"math/big"
"net"
"net/textproto"
"os"
"path/filepath"
"strings"
"time"
)
var TlsNotSupported = errors.New("TLS not supported")
var TlsFailedToLoadCA =... |
package metrics
// Histograms calculate distribution statistics from a series of int64 values.
type Histogram interface {
Clear()
Count() int64
Max() int64
Mean() float64
Min() int64
Percentile(float64) float64
Percentiles([]float64) []float64
Sample() Sample
Snapshot() Histogram
StdDev() float6... |
package vcs
import (
"os"
"os/exec"
"path/filepath"
"regexp"
"strings"
"time"
)
var bzrDetectURL = regexp.MustCompile("parent branch: (?P<foo>.+)\n")
// NewBzrRepo creates a new instance of BzrRepo. The remote and local directories
// need to be passed in.
func NewBzrRepo(remote, local string) (*BzrRepo, error... |
// Copyright 2016 The rkt 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... |
package scopeagent // import "go.undefinedlabs.com/scopeagent"
import (
"context"
"fmt"
"os"
"os/signal"
"reflect"
"runtime"
"sync"
"syscall"
"testing"
"go.undefinedlabs.com/scopeagent/agent"
"go.undefinedlabs.com/scopeagent/env"
"go.undefinedlabs.com/scopeagent/instrumentation"
"go.undefinedlabs.com/sco... |
// 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... |
// Code generated by go-swagger; DO NOT EDIT.
package operations
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.c... |
// Package endpoint provides a consistent hash map for URLs to kubernetes
// endpoints.
package endpoint
import (
"context"
"fmt"
"hash/crc32"
"net/url"
"strings"
"sync"
"time"
"github.com/ericchiang/k8s"
corev1 "github.com/ericchiang/k8s/apis/core/v1"
log15 "gopkg.in/inconshreveable/log15.v2"
"github.com... |
package monkey
import (
"time"
"github.com/lindsaygelle/nook"
"github.com/lindsaygelle/nook/animal"
"github.com/lindsaygelle/nook/character"
"github.com/lindsaygelle/nook/gender"
"github.com/lindsaygelle/nook/personality"
"golang.org/x/text/language"
)
var (
flipBirthday = nook.Birthday{
Day: 21,
Month... |
package yabi
import (
"database/sql"
"fmt"
"net/http"
"strconv"
"strings"
"time"
"github.com/itrepablik/itrlog"
"github.com/itrepablik/tago"
"github.com/itrepablik/timaan"
)
// LoginRequired is to make any pages protected with the yabi auth system
func LoginRequired(endpoint func(http.Respon... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: physical/types.proto
package physical // import "github.com/hashicorp/vault/physical"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.M... |
package views
import (
"encoding/csv"
"fmt"
"os"
"path/filepath"
"regexp"
"strings"
"time"
"github.com/derailed/k9s/internal/config"
"github.com/derailed/k9s/internal/resource"
"github.com/derailed/k9s/internal/ui"
)
const (
titleFmt = "[fg:bg:b] %s[fg:bg:-][[count:bg:b]%d[fg:bg:-]] "
searchFmt ... |
package mysql
import (
"database/sql"
"fmt"
"time"
"github.com/jmoiron/sqlx"
"github.com/kolide/fleet/server/kolide"
"github.com/pkg/errors"
)
func (d *Datastore) NewCarve(metadata *kolide.CarveMetadata) (*kolide.CarveMetadata, error) {
stmt := `INSERT INTO carve_metadata (
host_id,
name,
block_count,
... |
// +build linux,cgo,!agent
package db
// The code below was generated by lxd-generate - DO NOT EDIT!
import (
"database/sql"
"fmt"
"github.com/grant-he/lxd/lxd/db/cluster"
"github.com/grant-he/lxd/lxd/db/query"
"github.com/grant-he/lxd/shared/api"
"github.com/pkg/errors"
)
var _ = api.ServerEnvironment{}
var... |
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use ... |
package httpc
import (
"errors"
"io"
"net/http"
"net/url"
"path"
"github.com/influxdata/influxdb/v2"
)
type (
// WriteCloserFn is a write closer wrapper than indicates the type of writer by
// returning the header and header value associated with the writer closer.
// i.e. GZIP writer returns header Content... |
package outgoing
import (
"encoding/json"
"fmt"
"strconv"
"time"
interfaces "github.com/shoplineapp/captin/interfaces"
models "github.com/shoplineapp/captin/models"
log "github.com/sirupsen/logrus"
)
var dLogger = log.WithFields(log.Fields{"class": "Dispatcher"})
// DispatcherError - Error when send events
t... |
package in
import (
"encoding/base64"
"errors"
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
"github.com/alphagov/paas-s3-resource"
"github.com/alphagov/paas-s3-resource/versions"
)
var ErrMissingPath = errors.New("missing path in request")
type RequestURLProvider struct {
s3Client s3resource.S3Client
}
... |
package database
import (
"syscall/js"
)
func (db *Database) LoadAccountsFromDisk() <-chan Accounts {
accountsChan := make(chan Accounts, 1)
go func() {
accounts := Accounts{}
if db.db == nil {
accountsChan <- accounts
return
}
dbi := db.db.(js.Value)
if !dbi.IsUndefined() && !dbi.IsNull() {
req... |
// Package x stores utility functions, mostly for internal usage.
package x
import (
"bytes"
"encoding/gob"
"encoding/json"
"fmt"
"math/rand"
"net/http"
"strings"
"time"
"github.com/Sirupsen/logrus"
)
var log = Log("x")
// Create and seed the generator.
// Typically a non-fixed seed should be used, such as... |
package main
import (
"context"
"fmt"
"net"
"net/http"
_ "net/http/pprof"
"os"
"os/signal"
"sync"
"syscall"
"time"
"github.com/PacktPublishing/Hands-On-Software-Engineering-with-Golang/Chapter09/linksrus/linkgraphapi"
linkgraphproto "github.com/PacktPublishing/Hands-On-Software-Engineering-with-Golang/Cha... |
package dependency
import (
"fmt"
"strings"
"github.com/pkg/errors"
)
// Graph is the dependency graph structure
type Graph struct {
Nodes map[string]*Node
Root *Node
}
// NewGraph creates a new graph with given root node
func NewGraph(root *Node) *Graph {
graph := &Graph{
Nodes: make(map[string]*Node),
... |
/*
Copyright 2014 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... |
// Go MySQL Driver - A MySQL-Driver for Go's database/sql package
//
// Copyright 2013 The Go-MySQL-Driver Authors. All rights reserved.
//
// 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://... |
package helper
import (
"context"
"net/http"
"strings"
"time"
"github.com/go-redis/redis/v8"
"github.com/vicanso/beginner/config"
"github.com/vicanso/beginner/log"
"github.com/vicanso/hes"
"go.uber.org/atomic"
)
var (
defaultRedisClient, defaultRedisHook = mustNewRedisClient()
// ErrRedisTooManyProcessin... |
// Copyright © 2019 Developer Network, LLC
//
// This file is subject to the terms and conditions defined in
// file 'LICENSE', which is part of this source code package.
package alog
import "context"
// Printc creates informational logs based on the data coming from the
// concurrency channel that is passed in for ... |
package main
import (
"bufio"
"flag"
"fmt"
"github.com/abhimanyu003/sttr/processors"
"os"
"strings"
"github.com/charmbracelet/bubbles/list"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
)
// version specify version of application using ldflags
var version string
var items = [... |
package rflct
import (
"errors"
"net/url"
"reflect"
"regexp"
"testing"
"github.com/stretchr/testify/assert"
)
func TestIsStructPtr(t *testing.T) {
tests := []struct {
name string
s interface{}
expectedError error
}{
{
"NonStruct",
new(string),
errors.New("non-struct type... |
/**
* Copyright 2019 Whiteblock 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 entity
import (
"encoding/json"
"fmt"
"runtime"
"github.com/imdario/mergo"
)
// ResultType is the type of the result
type ResultType int
... |
/*
Copyright (c) 2021 Red Hat, 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, software... |
package cli
import (
"flag"
"fmt"
"os"
"syscall"
"time"
"github.com/golang/glog"
cli "github.com/jawher/mow.cli"
controller "github.com/kubernetes-sigs/sig-storage-lib-external-provisioner/controller"
//"github.com/kubernetes-incubator/external-storage/lib/controller"
freenasProvisioner "github.com/travisgh... |
package binding
import (
"bufio"
"bytes"
"fmt"
"os"
"path/filepath"
"reflect"
"runtime"
"strings"
"github.com/wailsapp/wails/v2/internal/typescriptify"
"github.com/leaanthony/slicer"
"github.com/wailsapp/wails/v2/internal/logger"
)
type Bindings struct {
db *DB
logger logger.CustomLogger
e... |
package libimage
import (
"context"
"time"
"github.com/containers/image/v5/manifest"
"github.com/containers/image/v5/types"
"github.com/opencontainers/go-digest"
ociv1 "github.com/opencontainers/image-spec/specs-go/v1"
"github.com/sirupsen/logrus"
)
// ImageData contains the inspected data of an image.
type I... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package codepipeline
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
// Please also see https://docs.aws.amazon.com/goto/WebAPI/codepipeline-2015-07-09/ListWebhooksInput
type ListWebhooksI... |
package events
import (
"encoding/json"
"fmt"
"strings"
"sync"
"github.com/dipdup-net/go-lib/tzkt/events/signalr"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
)
// TzKT - struct that used for connection to TzKT events server
type TzKT struct {
s *signalr.SignalR
invokationID int
subscrip... |
// Copyright 2018-2020 opcua authors. All rights reserved.
// Use of this source code is governed by a MIT-style license that can be
// found in the LICENSE file.
package main
import (
"context"
"flag"
"fmt"
"log"
"time"
"github.com/gopcua/opcua"
"github.com/gopcua/opcua/debug"
"github.com/gopcua/opcua/id"
... |
// Copyright (c) 2015-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 ... |
// Copyright 2020 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, ... |
package nlpword
// Trie 短语组成的Trie树.
type Trie struct {
Root *Node
}
// Node Trie树上的一个节点.
type Node struct {
isRootNode bool
isPathEnd bool
Character rune
Children map[rune]*Node
Failure *Node
Parent *Node
depth int
}
// BuildFailureLinks 更新Aho-Corasick的失败表
func (tree *Trie) BuildFailureLinks(... |
package users
import (
"encoding/json"
"net/http"
team "github.com/kobsio/kobs/pkg/api/apis/team/v1beta1"
user "github.com/kobsio/kobs/pkg/api/apis/user/v1beta1"
"github.com/kobsio/kobs/pkg/api/clusters"
"github.com/kobsio/kobs/pkg/api/middleware/errresponse"
"github.com/kobsio/kobs/pkg/api/plugins/plugin"
"g... |
package configuration
import (
"bufio"
"errors"
"flag"
"github.com/sonatype-nexus-community/nancy/types"
"github.com/stretchr/testify/assert"
"io/ioutil"
"os"
"testing"
)
func TestConfigParse(t *testing.T) {
file := setupCVEExcludeFile(t, "CVF-000\nCVF-123\nCVF-9999")
emptyFile := setupCVEExcludeFile(t, "")... |
/*
Copyright 2016, Cossack Labs Limited
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, softwa... |
package restscenario
import (
"encoding/base64"
"flag"
"fmt"
"log"
"os"
"strings"
"time"
"os/exec"
"bou.ke/monkey"
"github.com/go-resty/resty/v2"
"github.com/jmleefree/actiontest2/src/core/service"
lb_conf "github.com/jmleefree/actiontest2/src/utils/config"
"github.com/jmleefree/actiontest2/src/utils/l... |
package asmbunny
import (
"fmt"
"strconv"
"strings"
)
type opCode int
type regType string
const REGNAMES string = "abcd"
const NREG int = len(REGNAMES)
const NOTREG regType = ""
type Registers [NREG]int
// Get returns the value of the named register.
func (r Registers) Get(regname string) (value int) {
i := st... |
package apoco
import (
"bufio"
"compress/gzip"
"encoding/gob"
"errors"
"fmt"
"io"
"os"
"strings"
"git.sr.ht/~flobar/apoco/pkg/apoco/ml"
)
// Model holds the different models for the different training
// runs for a different number of OCRs. It is used to save and load
// the models for the automatic postco... |
package iperf
import (
"encoding/json"
"fmt"
"io/ioutil"
"testing"
"github.com/lichangjiang/iperf-operator/pkg/util"
"gotest.tools/assert"
is "gotest.tools/assert/cmp"
)
func TestHtmlPrint(t *testing.T) {
content, err := ioutil.ReadFile("../../test/udp_test.json")
assert.NilError(t, err)
htmlResult, err :... |
// flac implements FLAC support for gotag.
package flac
import (
"strings"
"strconv"
"errors"
"fmt"
"github.com/mewkiz/flac"
"github.com/mewkiz/flac/meta"
"github.com/jcjordyn130/gotag/types"
"github.com/jcjordyn130/gotag/decoders"
)
// metadata is the struct that contains the metadata and the FLAC stream.
ty... |
/*
Code to call the IBM IAM Services and get a session object that will be used by the Power Colo Code.
*/
package ibmpisession
import (
"bytes"
"crypto/tls"
"encoding/json"
"io"
"log"
"net/http"
"time"
"github.com/bkhadars/power-go-client/power/client"
"github.com/bkhadars/power-go-client/power/models"
... |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: peer.proto
/*
Package peers is a generated protocol buffer package.
It is generated from these files:
peer.proto
It has these top-level messages:
Peer
*/
package peers
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
/... |
package main
import (
goflag "flag"
"log"
"net/http"
"os"
"os/signal"
"syscall"
"time"
dlog "github.com/docker/machine/libmachine/log"
"github.com/docker/machine/libmachine/ssh"
"github.com/golang/glog"
"github.com/kube-node/kube-machine/pkg/controller"
"github.com/kube-node/kube-machine/pkg/controller/no... |
/*
Copyright 2018 Pressinfra SRL
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
... |
package blockchain
import (
"time"
"github.com/incognitochain/incognito-chain/common"
)
type SlashLevel struct {
MinRange uint8
PunishedEpoches uint8
}
/*
Params defines a network by its component. These component may be used by Applications
to differentiate network as well as addresses and keys for one ... |
package types
import (
"bytes"
"fmt"
"time"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/wire"
)
// Pool - dynamic parameters of the current state
type Pool struct {
LooseTokens sdk.Dec `json:"loose_tokens"` // tokens which are not bonded in a validator
BondedTokens ... |
package main
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/url"
"os"
"strconv"
"strings"
"time"
"github.com/Nitro/sidecar-executor/container"
"github.com/fsouza/go-dockerclient"
log "github.com/sirupsen/logrus"
)
// copyLogs will copy the Docker container logs to stdout and stderr so we can
// cap... |
// Copyright 2019 dfuse Platform 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 agre... |
/*
Package goriot is a library that provides a means of connecting and recieving data from Riot's League of Legend API
*/
package goriot
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"strconv"
"strings"
"time"
)
var (
apikey string
//BaseURL is the base of the url used by Riot's API service... |
package redis
import (
"github.com/kataras/golog"
"github.com/kataras/iris/v12/sessions"
"time"
)
type DatabaseHashed struct {
c Config
logger *golog.Logger
}
// Config returns the configuration for the redis server bridge, you can change them.
func (db *DatabaseHashed) Config() *Config {
return &db.c // ... |
package context
import (
"fmt"
"io"
"net/http"
"path/filepath"
"reflect"
"strconv"
"strings"
"time"
"github.com/labstack/echo/v4"
"github.com/thecodingmachine/gotenberg/internal/app/xhttp/pkg/resource"
"github.com/thecodingmachine/gotenberg/internal/pkg/conf"
"github.com/thecodingmachine/gotenberg/interna... |
/*
Copyright 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, softwar... |
// Copyright 2021 Confluent 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 main
import (
"context"
"flag"
"fmt"
"net/http"
"os"
"os/signal"
"sync"
"syscall"
"time"
log "github.com/sirupsen/logrus"
"github.com/tuenti/secrets-manager/backend"
k8s "github.com/tuenti/secrets-manager/kubernetes"
"github.com/tuenti/secrets-manager/secrets-manager"
"k8s.io/client-go/kubernet... |
// Copyright (c) 2018 <NAME> <<EMAIL>>
// MIT Licence - http://opensource.org/licenses/MIT
/*
Workflow update is an example of how to use AwGo's update API.
It demonstrates best practices for handling updates, in particular
loading the list of available releases in a background process and only
showing an "Update is ... |
package circuitbreaker
import (
"errors"
"math"
"math/rand"
"sync"
"time"
"github.com/project-flogo/core/activity"
"github.com/project-flogo/core/data/metadata"
)
const (
// CircuitBreakerModeA triggers the circuit breaker when there are contiguous errors
CircuitBreakerModeA = "a"
// CircuitBreakerModeB tr... |
package main
import (
"context"
"fmt"
"github.com/foae/gorgonzola/adblock"
"github.com/joho/godotenv"
"go.uber.org/zap"
"log"
"net/http"
"net/http/pprof"
"os"
"os/signal"
"runtime"
"syscall"
"time"
"github.com/foae/gorgonzola/dns"
httpHandler "github.com/foae/gorgonzola/handler/http"
"github.com/foae/... |
// +build linux_bpf
package tracer
import (
"fmt"
"sync"
"sync/atomic"
"github.com/DataDog/datadog-agent/pkg/network/netlink"
"github.com/DataDog/datadog-agent/pkg/process/util"
"github.com/DataDog/datadog-agent/pkg/util/log"
ct "github.com/florianl/go-conntrack"
"github.com/golang/groupcache/lru"
"golang.o... |
package agent
import (
"errors"
log "github.com/Sirupsen/logrus"
docker "github.com/fsouza/go-dockerclient"
"github.com/weaveworks/flux/common/daemon"
)
type ContainerUpdate struct {
Containers map[string]*docker.Container
Reset bool
}
type dockerListener struct {
client DockerClient
stop <-ch... |
// Package trafficpolicy defines the types to represent traffic policies internally in the OSM control plane, and
// utility routines to process them.
package trafficpolicy
import (
mapset "github.com/deckarep/golang-set"
policyv1alpha1 "github.com/openservicemesh/osm/pkg/apis/policy/v1alpha1"
"github.com/openser... |
// Copyright (c) 2021 Couchbase, 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 la... |
package recast
import (
"fmt"
"io"
)
const (
maxOffMeshConnections = 256
maxVolumes = 256
maxConvexVolPts = 12
)
type ConvexVolume struct {
Verts [maxConvexVolPts * 3]float32
HMin, HMax float32
NVerts int32
Area int32
}
type BuildSettings struct {
// Cell size in world unit... |
package autospotting
import (
"fmt"
"regexp"
"strings"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/autoscaling"
"github.com/aws/aws-sdk-go/service/ec2"
)
type launchConfiguration struct {
*autoscaling.LaunchConfiguration
}
var secGroupRegex = regexp.MustCompile(`^sg-[a-f0-9]{8,17}$`)
... |
// Licensed to the Apache Software Foundation (ASF) under one or more
// contributor license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright ownership.
// The ASF licenses this file to You under the Apache License, Version 2.0
// (the "License"); you may not... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.