text stringlengths 3.08k 10.4k |
|---|
package api
import (
"context"
"encoding/json"
"fmt"
"github.com/kubemq-io/kubemq-community/services/broker"
"github.com/kubemq-io/kubemq-community/services/metrics"
"net/http"
"time"
"github.com/kubemq-io/kubemq-community/config"
"github.com/kubemq-io/kubemq-community/pkg/logging"
"github.com/kubemq-io/... |
package kp
import (
"fmt"
"time"
"github.com/square/p2/Godeps/_workspace/src/github.com/hashicorp/consul/api"
"github.com/square/p2/pkg/kp/consulutil"
"github.com/square/p2/pkg/util"
)
type Lock struct {
client *api.Client
session string
name string
// Coordination channels
//
// signals that contin... |
// Copyright 2020 VMware, Inc.
// SPDX-License-Identifier: Apache-2.0
package registry
import (
"fmt"
"strings"
"sync"
"time"
regauthn "github.com/google/go-containerregistry/pkg/authn"
regname "github.com/google/go-containerregistry/pkg/name"
)
type KeychainOpts struct {
Username string
Password string
Tok... |
// Copyright (C) 2019 St<NAME>, Inc.
// See LICENSE for copying information.
package storj
import (
"database/sql/driver"
"github.com/zeebo/errs"
"golang.org/x/crypto/ed25519"
)
// ErrPieceKey is used when something goes wrong with a piece key.
var ErrPieceKey = errs.Class("piece key")
// PiecePublicKey is the ... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package rekognition
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type StartTextDetectionInput struct {
_ struct{} `type:"structure"`
// Idempotent token used to identify the start re... |
package main
import (
"testing"
)
func checkTokens(t *testing.T, t1, t2 *Token) {
if t1.type_ != t2.type_ {
t.Errorf("Incorrect type: expected %s, got %s\n", t1.type_, t2.type_)
}
if t1.literal != t2.literal {
t.Errorf("Incorrect literal: expected %s, got %s\n", t1.literal, t2.literal)
}
if t1.line_num != t... |
package decompile
import (
"fmt"
"go/ast"
"go/token"
"math"
"strconv"
"github.com/llir/llvm/ir"
"github.com/llir/llvm/ir/constant"
"github.com/pkg/errors"
)
// liftConst lifts the LLVM IR constant to an equivalent Go expression.
func (gen *Generator) liftConst(irConst constant.Constant) (ast.Expr, error) {
... |
package model
import (
"net/http"
"strings"
"time"
"github.com/sirupsen/logrus"
"github.com/spf13/viper"
"github.com/topfreegames/resources-check/controller"
"github.com/topfreegames/resources-check/extension"
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
)
// Worker loops every inte... |
/*
Copyright IBM Corp. 2016, 2017 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 ... |
// Copyright 2016 <NAME> and contributors
//
// 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 a... |
package internal
import (
"container/list"
"fmt"
"reflect"
"server/msg"
"strconv"
"time"
"github.com/name5566/leaf/gate"
"github.com/name5566/leaf/log"
)
//user state
const (
state_normal = iota
state_in_matching = iota
state_game_start = iota
state_fired = iota
)
type game struct {
user_ag... |
package ascii
import (
"errors"
"image"
"image/draw"
"github.com/golang/freetype"
"github.com/golang/freetype/truetype"
)
const (
CharSetLimited = iota // Use the limited character set: " .:-=+*#%@"
CharSetExtended // Use the extended character set: ".'`^\",:;Il!i><~+_-?][}{1)(|\\/tfjrxnuvczXYUJCLQ0OZ... |
package kinetic
import (
"context"
"encoding/json"
"log"
"math/rand"
"strconv"
"sync"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/request"
)
type TestMessage struct {
ID int `json:"id"`
Message string `json:"message"`
}
t... |
//go:generate ../../../tools/readme_config_includer/generator
package fluentd
import (
_ "embed"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"time"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/inputs"
)
// DO NOT REMOVE THE NEXT TWO LINES! This is required to embed the sample... |
package s3
import (
"io/ioutil"
"regexp"
"runtime"
"strconv"
"strings"
"sync"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/ser... |
/*
Copyright (c) 2020 the Octant contributors. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package printer
import (
"context"
"fmt"
"strings"
"github.com/pkg/errors"
"github.com/vmware-tanzu/octant/pkg/view/component"
storagev1 "k8s.io/api/storage/v1"
)
// StorageClassListHandler is a printF... |
package pipy
import (
"strings"
"github.com/google/uuid"
"github.com/pkg/errors"
v1 "k8s.io/api/core/v1"
"github.com/openservicemesh/osm/pkg/certificate"
"github.com/openservicemesh/osm/pkg/constants"
"github.com/openservicemesh/osm/pkg/errcode"
"github.com/openservicemesh/osm/pkg/identity"
"github.com/open... |
package main
import (
"bytes"
"net/url"
"path"
"path/filepath"
"regexp"
"strings"
"github.com/PuerkitoBio/goquery"
log "github.com/Sirupsen/logrus"
"github.com/alphagov/govuk_crawler_worker/http_crawler"
"github.com/streadway/amqp"
)
type CrawlerMessageItem struct {
amqp.Delivery
Response *http_crawler.C... |
package test
import (
"io/ioutil"
"math/rand"
"net/http"
"net/url"
"os"
"strings"
"testing"
"time"
"github.com/gruntwork-io/terratest/modules/terraform"
"github.com/stretchr/testify/assert"
)
var seededRand = rand.New(rand.NewSource(time.Now().UnixNano()))
var assumeRoleArn = os.Getenv("SANDBOX_ORG_ROLE_AR... |
package dsort
import (
"math"
"sync"
"time"
"github.com/NVIDIA/aistore/cmn"
)
// TimeStats contains statistics about time spent on specific task. It calculates
// min, max and avg times.
type TimeStats struct {
// total contains total number of milliseconds spend on
// specific task.
Total int64 `json:"total_... |
package main
import (
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net"
"net/rpc"
"net/rpc/jsonrpc"
"os"
"os/exec"
"path"
"path/filepath"
"strconv"
"strings"
"sync"
"github.com/DeimosC2/DeimosC2/lib/logging"
"github.com/DeimosC2/DeimosC2/lib/modulescommon"
)
//ModData is used for RPC
t... |
// Code generated by go-swagger; DO NOT EDIT.
package platformclientmodels
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-op... |
package main
import (
"bytes"
"crypto/rand"
"crypto/tls"
"encoding/base64"
"encoding/hex"
"errors"
"io"
"log"
"net/http"
"net/http/cookiejar"
"net/url"
"os"
"strings"
"time"
"github.com/felixge/httpsnoop"
"github.com/nimbusec-oss/minion"
"golang.org/x/crypto/nacl/secretbox"
)
const (
// RPSLoginURL... |
package model
import (
"fmt"
"math"
"strings"
"time"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/postgres"
"github.com/jinzhu/now"
"github.com/miyanokomiya/strava-client-go"
)
// Summary model
type Summary struct {
ID int64 `json:"id"`
AthleteID in... |
package repository
import (
"fmt"
"github.com/jenkins-x/jx-gitops/pkg/common"
"github.com/jenkins-x/jx-gitops/pkg/kyamls"
"github.com/jenkins-x/jx/v2/pkg/cmd/helper"
"github.com/jenkins-x/jx/v2/pkg/cmd/templates"
"github.com/jenkins-x/jx/v2/pkg/gits"
"github.com/jenkins-x/jx/v2/pkg/log"
"github.com/jenkins-x/... |
package cmd
import (
"archive/tar"
"bytes"
"compress/gzip"
"errors"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/apex/log"
"github.com/h2non/filetype"
"github.com/h2non/filetype/matchers"
"github.com/marcosnils/bin/pkg/config"
"github.com/marcosnils/bin/pkg/options"
"github.com/ma... |
package main
import (
"bytes"
"errors"
"flag"
"fmt"
"io"
"net/http"
"os"
"strings"
"text/tabwriter"
"go.uber.org/zap"
"github.com/blippar/aragorn/log"
_ "expvar"
_ "net/http/pprof"
_ "github.com/blippar/aragorn/notifier/slack"
_ "github.com/blippar/aragorn/testsuite/grpcexpect"
_ "github.com/blippa... |
/*
Copyright 2018 The Elasticshift Authors.
*/
package repository
import (
"context"
"errors"
"fmt"
"strings"
"time"
"github.com/graphql-go/graphql"
"github.com/sirupsen/logrus"
"github.com/elasticshift/elasticshift/api/types"
"github.com/elasticshift/elasticshift/internal/pkg/logger"
"github.com/elasticshi... |
package main
import (
"bytes"
"crypto/sha1"
"flag"
"fmt"
"io"
"os"
"os/exec"
"runtime"
"strings"
)
type result struct {
parent, child []byte
}
func referToChildInParent(parent, child string, shaPrefixLength int, begin, end uint64, extraHeader string, ch chan *result) {
// Find a place to insert the custom... |
package service
import (
"fmt"
"io"
"net/http"
"net/url"
"path"
"regexp"
"strings"
"github.com/a-zara-n/Matchlock/src/domain/repository"
"github.com/a-zara-n/Matchlock/src/domain/value"
"golang.org/x/net/html"
)
//CrawlerInterface は
type CrawlerInterface interface {
Init(r io.Reader, method, urlstring str... |
package meshview
import (
"math"
"github.com/fogleman/fauxgl"
"github.com/go-gl/glfw/v3.2/glfw"
)
type Arcball struct {
Sensitivity float64
Start fauxgl.Vector
Current fauxgl.Vector
Rotation fauxgl.Matrix
Translation fauxgl.Vector
Scroll float64
Rotate bool
Pan bool
}
func ... |
package compatibilityVars
var RubyVersionAgentSupportability = map[string][]string{
//the keys are the ruby version and the values are the agent versions that support that specific version
"2.7": []string{"6.9.0.363+"},
"2.6": []string{"5.7.0.350+"},
"2.5": []string{"4.8.0.341+"},
"2.4": []string{"3.18.0.... |
package redicrypt
import (
"testing"
)
func TestBase64Encoding(t *testing.T) {
charthing := []byte("these are the days of our lives")
res := B64Encode(charthing)
benc := "dGhlc2UgYXJlIHRoZSBkYXlzIG9mIG91ciBsaXZlcw=="
if res != benc {
t.Errorf("received %s instead of %s", res, benc)
}
}
func TestBase64Decodin... |
package kvm
import (
"gosb/commons"
"gosb/vtx/arch"
"sync/atomic"
"syscall"
"unsafe"
)
var (
uregs userRegs
sregs systemRegs
)
//go:linkname throw runtime.throw
func throw(string)
// VCPUPtr returns a CPU for the given address.
//
//go:nosplit
func VCPUPtr(addr uintptr) *VCPU {
return (*VCPU)(unsafe.Pointer... |
package main
import (
"flag"
"fmt"
"log"
"net/http"
"net/url"
"strings"
"sync"
"github.com/PuerkitoBio/fetchbot"
"github.com/PuerkitoBio/goquery"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/postgres"
"strconv"
)
type Artwork struct {
gorm.Model
Title string
Artist string
Url ... |
package main
import (
"encoding/json"
"io/ioutil"
"log"
"net/http"
"github.com/graphql-go/graphql"
// Database and yours Drives
"database/sql"
// _ "github.com/lib/pq"
_ "github.com/go-sql-driver/mysql"
"time"
"github.com/dgrijalva/jwt-go"
"regexp"
"fmt"
)
func handler(schema graphql.Schema) http.Handle... |
package nodelabeler
import (
"context"
"flag"
"io/ioutil"
"log"
"os"
"reflect"
"testing"
"time"
"github.com/EdgeNet-project/edgenet/pkg/signals"
"github.com/EdgeNet-project/edgenet/pkg/util"
"github.com/sirupsen/logrus"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/a... |
// Copyright © 2018 <NAME> <<EMAIL>>
//
// 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... |
// Copyright 2015 CoreOS, 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... |
// refactortests converts old parser table tests to golden files.
//
// refactortests takes the old parser_test.go file, in which the tests were
// written using the old-style nodes, and writes test cases as input files:
// testdata/<testname>/<testcase>.input
//
// Output input files will then be read by the new parse... |
package main
import (
"fmt"
"net"
"net/http"
"os/exec"
"runtime"
"strings"
"time"
"github.com/zmb3/spotify"
)
// these variables are set during the build process
// using the specified envrionment varaibles
var clientID string //SPOTIFY_CLIENT_ID
var clientSecret string //SPOTIFY_CLIENT_SECRET
var ports ... |
//nolint
package descriptors
import (
"encoding/json"
"google.golang.org/protobuf/encoding/protojson"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
"google.golang.org/protobuf/types/dynamicpb"
"google.golang.org/protobuf/types/known/anypb"
"google.golang.org/protobuf/type... |
package v1
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
type YandexHostClassRedis string
// YandexDiskType type for yandex disk type string
// +kubebuilder:validation:Enum=network-ssd;local-ssd
type YandexDiskType string
type YandexDiskSize int
// YandexZone type for yandex zone string
// +kubebuilder... |
// Copyright 2018 <NAME>. All rights reserved.
package main
import (
"context"
"encoding/json"
"flag"
"fmt"
"os"
"github.com/mongodb/mongo-go-driver/x/network/connstring"
"github.com/simagix/keyhole/mdb"
"github.com/simagix/keyhole/sim"
"github.com/simagix/keyhole/sim/util"
"github.com/simagix/keyhole/web"... |
package main
import (
"bufio"
"fmt"
"os"
"strings"
"github.com/fatih/color"
)
var (
Red = color.New(color.FgRed)
Blue = color.New(color.FgBlue)
Green = color.New(color.FgGreen)
Magenta = color.New(color.FgMagenta)
White = color.New(color.FgWhite)
Black = color.New(color.FgBlack)
BRed ... |
package help
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"path"
"path/filepath"
"strings"
"testing"
"text/template"
)
// Passed to template.Execute()
type TemplateData map[string]string
type Renamer func(string) string
// If name begins with "dot.", replace with ".". Otherwise leave it alone.
func DotRen... |
/*
Copyright 2020 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, sof... |
// Copyright © 2018 NAME HERE <EMAIL>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
// *** 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 spanner
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// > This content is derived from https://github.com... |
// Copyright 2016 Gravitational Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed ... |
// Copyright 2018 Immutable Systems, 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 a... |
package cli
import (
"fmt"
"runtime"
"strings"
"sync"
"time"
"github.com/dustin/go-humanize"
"github.com/nats-io/nats.go"
"gopkg.in/alecthomas/kingpin.v2"
)
type trafficCmd struct {
raftVote rateTrackInt
raftAppend rateTrackInt
raftProp rateTrackInt
raftRemovePeer rateTrackInt
raftReply ... |
package main
import (
"bufio"
"fmt"
"os"
"sort"
)
func readInt(bytes []byte, from int, val *int) int {
i := from
sign := 1
if bytes[i] == '-' {
sign = -1
i++
}
tmp := 0
for i < len(bytes) && bytes[i] >= '0' && bytes[i] <= '9' {
tmp = tmp*10 + int(bytes[i]-'0')
i++
}
*val = tmp * sign
return i
}
... |
package main
import (
"bufio"
"bytes"
"fmt"
"os"
"sort"
)
func main() {
reader := bufio.NewReader(os.Stdin)
tc := readNum(reader)
var buf bytes.Buffer
for tc > 0 {
tc--
line := readNNums(reader, 4)
s, _ := reader.ReadString('\n')
res := solve(line[0], line[1], line[2], line[3], s)
buf.WriteString... |
// Copyright © 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, distribu... |
package persist
import (
"encoding/json"
"fmt"
"os"
"strings"
"sync"
"time"
"github.com/byuoitav/common/log"
"github.com/byuoitav/common/nerr"
"github.com/byuoitav/common/structs"
"github.com/byuoitav/shipwright/alertstore/config"
"github.com/byuoitav/shipwright/elk"
)
type ElkPersist struct {
config con... |
package gohome
import (
"github.com/PucklaMotzer09/mathgl/mgl32"
)
// A transform storing everything needed for the transform matrix
type TransformableObject3D struct {
// The position in the world
Position mgl32.Vec3
// The scale the multiplies all vertices
Scale mgl32.Vec3
// The rotation represented as a ... |
package ff
import (
"github.com/kaspanet/kaspad/util/panics"
"github.com/pkg/errors"
"hash/crc32"
"os"
"syscall"
)
// write appends the specified data bytes to the store's write cursor location
// and increments it accordingly. When the data would exceed the max file size
// for the current flat file, this funct... |
// Copyright 2017 The master-pfa-info 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 imgsrv
import (
"bytes"
"encoding/base64"
"fmt"
"image"
"image/png"
"log"
"net"
"net/http"
"os"
"strconv"
"time"
"go-hep.org... |
package main
import (
"fmt"
"image"
"runtime/debug"
"sync"
"time"
"github.com/gotk3/gotk3/gdk"
"github.com/gotk3/gotk3/glib"
"github.com/gotk3/gotk3/gtk"
"github.com/korandiz/v4l"
"github.com/korandiz/v4l/fmt/yuyv"
)
type video struct {
window *gtk.Window
image *gtk.Image
pixbuff *gdk.Pixbuf... |
package cli
import (
"flag"
"fmt"
"github.com/posener/complete"
nsx "github.com/shyiko/kubensx/context"
"io"
"os"
"path/filepath"
)
type Completion struct {
ctx func() nsx.Context
}
func (c *Completion) GenBashCompletion(w io.Writer) error {
bin, err := os.Executable()
if err != nil {
return err
}
fmt.... |
/*
*
* Copyright 2021 waterdrop 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 ... |
package s3
import (
"crypto/md5"
"encoding/base64"
"encoding/xml"
"net/url"
"strconv"
"time"
)
// Implements an interface for s3 bucket lifecycle configuration
// See goo.gl/d0bbDf for details.
const (
LifecycleRuleStatusEnabled = "Enabled"
LifecycleRuleStatusDisabled = "Disabled"
LifecycleRuleDateFormat ... |
// Copyright 2019 <NAME>. All rights reserved.
// Use of this source code is governed by a MIT license
// that can be found in the LICENSE file.
package vm
import (
"bytes"
"fmt"
"os"
"os/exec"
"runtime"
"strconv"
"strings"
"github.com/google/shlex"
"github.com/gentee/gentee/core"
)
// ArgCount returns th... |
/*******************************************************************************
*
* Copyright 2017-2018 SAP SE
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You should have received a copy of the License along with this
* progra... |
package translit
import (
"bufio"
"compress/gzip"
"fmt"
"os"
"path/filepath"
"regexp"
"sort"
"strings"
"unicode"
"golang.org/x/text/transform"
"golang.org/x/text/unicode/norm"
"golang.org/x/text/unicode/runenames"
)
func ReadFile(fn string) ([]string, error) {
fn = filepath.Clean(fn)
var res []string
... |
// Package unsafeslice contains functions for zero-copy casting between typed slices and byte slices.
package unsafeslice
import (
"reflect"
"unsafe"
)
// Useful constants.
const (
Uint64Size = 8
Uint32Size = 4
Uint16Size = 2
Uint8Size = 1
)
func newRawSliceHeader(sh *reflect.SliceHeader, b []byte, stride int... |
package internal
import (
"fmt"
"os"
"os/exec"
"path"
"sort"
)
type (
FSMStateID int8
FSMStateIDSlice []FSMStateID
)
func (v FSMStateIDSlice) Len() int {
return len(v)
}
func (v FSMStateIDSlice) Less(i, j int) bool {
return v[i] < v[j]
}
func (v FSMStateIDSlice) Swap(i, j int) {
v[i], v[j] = v[j], v... |
package ui
import (
"fmt"
"github.com/go-gl/gl/v4.1-core/gl"
"github.com/go-gl/mathgl/mgl64"
"github.com/maxfish/gojira2d/pkg/graphics"
)
// Text is a UI element that just renders a string
type Text struct {
drawable *graphics.Primitive2D
position mgl64.Vec3
size mgl64.Vec2
color graphics.Color
text ... |
//
// Copyright (c) 2017 10X Genomics, Inc. All rights reserved.
//
// Package adapter provides a golang-native Martian job adapter and utilities.
//
// A stage executable should should look something like
//
// package main
//
// import (
// "github.com/martian-lang/martian/martian/adapter"
// "github.com/marti... |
// Copyright 2019 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 irc
import (
"sync"
"time"
)
// Client is a sharded connection to the Twitch IRC service
type Client struct {
length int
shards map[int]*Conn
awaitingClose int
onShardReconnect []func(int)
onShardMessage []func(int, ChatMessage)
onShardLatencyUpdate []func(int, time.Duration)
... |
package protocol
import (
"bytes"
"encoding/binary"
"hash/adler32"
"hash/crc32"
"math/rand"
"net"
"github.com/Dreamacro/clash/common/pool"
"github.com/Dreamacro/clash/transport/ssr/tools"
)
func init() {
register("auth_sha1_v4", newAuthSHA1V4, 7)
}
type authSHA1V4 struct {
*Base
*authData
iv ... |
// Code generated by monitor-code-gen. DO NOT EDIT.
package expvar
import (
"github.com/signalfx/golib/v3/datapoint"
"github.com/signalfx/signalfx-agent/pkg/monitors"
)
const monitorType = "expvar"
var groupSet = map[string]bool{}
const (
memstatsAlloc = "memstats.alloc"
memstatsBuckHashSys ... |
package bird
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 (
admiralBirthday = nook.Birthday{
Day: 27,
Mont... |
package main
import (
"errors"
"flag"
"fmt"
"os"
"runtime"
"runtime/pprof"
"runtime/trace"
"time"
"gitlab.com/alephledger/consensus-go/pkg/config"
"gitlab.com/alephledger/consensus-go/pkg/run"
"gitlab.com/alephledger/core-go/pkg/core"
"gitlab.com/alephledger/core-go/pkg/tests"
)
func getMember(filename s... |
package timeparse
import (
"os"
"testing"
"time"
"github.com/itsabot/abot/core/log"
)
func TestMain(m *testing.M) {
log.SetDebug(true)
if err := os.Setenv("ABOT_DEBUG", "true"); err != nil {
log.Fatal(err)
}
os.Exit(m.Run())
}
func TestParse(t *testing.T) {
n := time.Now()
// _, zone := n.Zone()
n.Add(... |
package main
import (
"bytes"
"flag"
"fmt"
"github.com/tvdburgt/passman/crypto"
"github.com/tvdburgt/passman/store"
"github.com/tvdburgt/passman/term"
"log"
"os"
"os/user"
"path/filepath"
"strings"
)
const (
storeFilePerm os.FileMode = 0600 // Store only requires rw perms for owner
storeFileCreateF... |
package main
import (
"flag"
"github.com/iakrevetkho/tinkoff-invest-bot/candles_loader/internal/db"
"log"
"time"
sdk "github.com/TinkoffCreditSystems/invest-openapi-go-sdk"
"github.com/iakrevetkho/tinkoff-invest-bot/candles_loader/internal/config"
"github.com/iakrevetkho/tinkoff-invest-bot/candles_loader/inter... |
// Package logx provides ...
package logx
import (
"bytes"
"context"
"encoding/json"
"fmt"
"os"
"runtime"
"strings"
"time"
"go.opentelemetry.io/otel/trace"
)
// Logger represents a logger.
type Logger interface {
// Info logs to INFO log.
Info(args ...interface{})
// Info logs to INFO log.
Infof(format ... |
package docker_test
import (
"context"
"fmt"
"io/ioutil"
"math/rand"
"os"
"path/filepath"
"strconv"
"strings"
"testing"
"time"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/network"
"github.com/docker/docker/client"
"github.com/s... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: cli.proto
package localinterface
import (
context "context"
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
va... |
package vrp
import (
"bytes"
"encoding/json"
"fmt"
"github.com/mobius-scheduler/mobius/common"
log "github.com/sirupsen/logrus"
"os"
"os/exec"
"time"
)
// wrapper for pdptw solver (written in Python)
type PdptwSolver struct {
solver Solver
interest_map common.InterestMap
vehicle... |
package vsphere
import (
"encoding/json"
"fmt"
"github.com/netapp/cake/pkg/config/cluster"
vsphereConfig "github.com/netapp/cake/pkg/config/vsphere"
"github.com/netapp/cake/pkg/progress"
"github.com/netapp/cake/pkg/provider"
"github.com/vmware/govmomi"
"github.com/vmware/govmomi/object"
"io/ioutil"
"net/http... |
package valuation
const yearsOfHighGrowth = 5
// OutputYear defines the cash flow calculation of one particular year in the future
type OutputYear struct {
RevenueGrowthRate float64
Revenue float64
EBITMargin float64
EBIT float64
TaxRate float64
A... |
package post
import (
"encoding/binary"
"errors"
"time"
"github.com/rs/xid"
)
const (
postMetaVersion = 1
postMetaPrefix = "POST"
)
var (
// ErrPostMeta specifies the error of bad post meta
ErrPostMeta = errors.New("bad post meta")
)
// A Post specifies a post of postdb.
type Post struct {
PKey [12]by... |
// Copyright 2021 Matrix Origin
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to ... |
package cmd
import (
"fmt"
"github.com/ory/viper"
"github.com/spf13/cobra"
"github.com/boson-project/faas"
"github.com/boson-project/faas/buildpacks"
"github.com/boson-project/faas/prompt"
)
func init() {
root.AddCommand(buildCmd)
buildCmd.Flags().StringP("builder", "b", "default", "Buildpacks builder")
bu... |
// Copyright (c) 2019, The Emergent 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 eve
import (
"github.com/goki/ki/ki"
"github.com/goki/ki/kit"
)
// Node is the common interface for all eve nodes
type Node interface {
... |
package lexer
import (
"github.com/jacob-elektronik/gofact/editoken"
"github.com/jacob-elektronik/gofact/editoken/types"
"github.com/jacob-elektronik/gofact/reader"
"github.com/jacob-elektronik/gofact/utils"
)
// Lexer struct ...
type Lexer struct {
EdiFactMessage []byte
EdiReader *reader.E... |
/*
Copyright © 2021 xujiahua <<EMAIL>>
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... |
package node
import (
"sync"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc"
)
// Probing result information
// Using a short naming struct to save logging storage space when using gob
type L struct {
S int64 // client sending time
E int64 // client receiving time
C int64 // server clock time
}
ty... |
package worker
import (
"context"
"errors"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
"github.com/werf/logboek"
)
const (
TaskStartedCallback = "TaskStartedCallback"
TaskFailedCallback = "TaskFailedCallback"
TaskSucceededCallback = "TaskSucceededCallback"
)
var t... |
package theme
import (
"image"
"gioui.org/layout"
"gioui.org/op"
"gioui.org/unit"
"gioui.org/widget"
"gioui.org/widget/material"
"gioui.org/x/component"
"gioui.org/x/markdown"
"gioui.org/x/richtext"
"git.sr.ht/~whereswaldon/sprig/ds"
"git.sr.ht/~whereswaldon/sprig/icons"
sprigWidget "git.sr.ht/~whereswald... |
package main
import (
"bytes"
"crypto/tls"
"crypto/x509"
"encoding/json"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"net/http/httptest"
"net/http/httputil"
"net/url"
"os"
"strconv"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/schema"
)
const group = "openshift.o... |
package validating
import (
"encoding/hex"
"errors"
"log"
"github.com/knd/kndchain/pkg/calculating"
"github.com/knd/kndchain/pkg/crypto"
"github.com/knd/kndchain/pkg/hashing"
"github.com/knd/kndchain/pkg/listing"
)
// Service provides blockchain validating operations
type Service interface {
IsValidChain(bc ... |
package app
import (
"context"
"errors"
"fmt"
"log"
"net/url"
"strings"
"time"
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing"
"github.com/go-git/go-git/v5/plumbing/object"
goGitlab "github.com/xanzy/go-gitlab"
pkg "github.com/alexandear/import-gitlab-commits/internal"
"github.com/a... |
package cli_test
import (
"bytes"
"errors"
"net"
"os"
"strings"
"syscall"
"testing"
"github.com/alecthomas/kong"
"github.com/moby/buildkit/frontend/dockerfile/parser"
log "github.com/sirupsen/logrus"
"gotest.tools/assert"
"github.com/cremindes/whalelint/cli"
TestHelper "github.com/cremindes/whalelint/te... |
// Package iface defines the actual database interface used
// by a Prysm beacon node, also containing useful, scoped interfaces such as
// a ReadOnlyDatabase.
package iface
import (
"context"
"io"
"github.com/ethereum/go-ethereum/common"
eth "github.com/prysmaticlabs/ethereumapis/eth/v1alpha1"
"github.com/prysm... |
package constant
// events
const (
Support = "<EMAIL>"
UnloadPluginKillDelay = 3000
GatewayStop = "gatewayStop"
// DeviceAdded Addon Manager Event
DeviceAdded = "deviceAdded"
DeviceRemoved = "deviceRemoved"
)
// path
const (
UsersPath = "/users"
ThingsPath = "/things"
PropertiesPat... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.