text stringlengths 3.08k 10.4k |
|---|
package aggregate_test
import (
"log"
"reflect"
"testing"
"github.com/google/uuid"
"github.com/modernice/goes/aggregate"
"github.com/modernice/goes/aggregate/test"
"github.com/modernice/goes/event"
etest "github.com/modernice/goes/event/test"
)
func TestNew(t *testing.T) {
id := uuid.New()
b := aggregate.N... |
package gen
import (
"os"
"fmt"
"strings"
"go/ast"
"github.com/s0ulw1sh/soulgost/hash"
)
type apiGenerator struct {
apitypes map[string]*apitype
}
type apitype struct {
typename string
usemiddle bool
funcs []apifunc
}
func (self *apitype) start_func() string {
return "func (self *"+self.typename+") "
}
... |
// Copyright Red Hat
package v1alpha1
import (
dexoperatorv1alpha1 "github.com/identitatem/dex-operator/api/v1alpha1"
openshiftconfigv1 "github.com/openshift/api/config/v1"
policyv1 "github.com/stolostron/governance-policy-propagator/api/v1"
hypershiftdeploymentv1alpha1 "github.com/stolostron/hypershift-deploymen... |
package opts
import (
"flag"
"fmt"
"log"
"os"
"strings"
"time"
"github.com/kyma-project/kyma/components/event-bus/internal/trace"
"github.com/nats-io/go-nats-streaming"
)
const (
defaultPort = 8080
defaultClientID = "event-bus-push"
defaultNatsURL = stan.Defa... |
package internal
import (
"bytes"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"strings"
"text/template"
"github.com/mkideal/cbuild/etc"
"github.com/mkideal/log"
"github.com/mkideal/log/logger"
"github.com/mkideal/pkg/errors"
)
var sourceFileSuffixList = [...]string{
"cpp",
"cxx",
"hpp",
"hxx",
"cc",
... |
package table
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
func TestTable_RenderCSV(t *testing.T) {
tw := NewWriter()
tw.AppendHeader(testHeader)
tw.AppendRows(testRows)
tw.AppendRow(testRowMultiLine)
tw.AppendRow(testRowTabs)
tw.AppendFooter(testFooter)
tw.SetCaption(testCaption)
tw.Se... |
package main
import (
"context"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"time"
"0dns.io/core/common"
"0dns.io/core/config"
"0dns.io/core/datastore"
"0dns.io/core/logging"
. "0dns.io/core/logging"
"0dns.io/zdnscore/models"
"0dns.io/zdnscore/worker"
"github.com/0chain/gosdk/cor... |
package authentic
import (
"encoding/base64"
"errors"
"fmt"
"log"
"net/http"
"net/mail"
"net/url"
"strconv"
"strings"
"github.com/dadamssolutions/adaptd"
"github.com/dadamssolutions/authentic/handlers/passreset"
"github.com/dadamssolutions/authentic/handlers/session"
)
// PasswordResetRequestAdapter hand... |
package tools
import (
"context"
"errors"
"fmt"
"strconv"
"github.com/figment-networks/firehose-cosmos/transform"
pbcosmos "github.com/figment-networks/proto-cosmos/pb/sf/cosmos/type/v1"
"github.com/spf13/cobra"
"github.com/streamingfast/bstream"
"github.com/streamingfast/bstream/stream"
bstransform "github... |
/*
Copyright 2021 Alibaba Group Holding 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 wr... |
package main
import (
"fmt"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/spf13/viper"
"opgenorth.net/labradar/pkg/config"
"opgenorth.net/labradar/pkg/labradar"
"opgenorth.net/labradar/pkg/mylittlerangebook"
"os"
"strings"
)
func main() {
rootCmd := buildRoo... |
/*
Copyright 2018 Turbine Labs, 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, softw... |
package farandula
import (
"testing"
)
type lexTest struct {
name string
input string
tokens []token
}
func mToken(typ tokenType, text string) token {
return token{
typ: typ,
val: text,
}
}
var (
tEOF = mToken(tokenEOF, "")
tSearch = mToken(tokenSearch, "search")
tFlights = mToken(tokenFl... |
package cmd
import (
"fmt"
"log"
"os"
homedir "github.com/mitchellh/go-homedir"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
type clusterConfig struct {
idpIssuerURL string
clientID string
clientSecret string
refreshToken string
idToken string
clusterName string
userNa... |
// Copyright 2014 <NAME>. All rights reserved.
// This software may be modified and distributed under the terms
// of the BSD license. See the LICENSE file for details.
package modbus
import (
"crypto/tls"
"encoding/binary"
"fmt"
"io"
"log"
"net"
"sync"
"time"
)
// TLSClientHandler implements Packager and Tr... |
// Package container deals with the creation of docker containers
package container
import (
"context"
"io/ioutil"
"log"
"github.com/pkg/errors"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/client"
"golang.org/x/sync/errgroup"
"github.com/atlar... |
package vocaminder
import (
"math/rand"
"strconv"
"time"
"golang.org/x/net/context"
"github.com/gin-gonic/gin"
"google.golang.org/appengine"
"google.golang.org/appengine/datastore"
"google.golang.org/appengine/log"
)
const maxCards = 30
// Card contains the data of a card to learn
type Card struct {
Word ... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: kafmesh/discovery/v1/source.proto
package discoveryv1
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.... |
package main
import (
"fmt"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/render"
"html/template"
"net/http"
"os"
"strings"
)
func guidelineHP(c *gin.Context) {
fullPth := fmt.Sprintf("%v%ctemplate%cindex.html", exeAbsPath, os.PathSeparator, os.PathSeparator)
tp := template.Must(template.New("homepage... |
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdjson"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
// No-op definition for keeping imports.
var (
_ = bin.Buffer{}
_... |
package teamworkapi
import (
"encoding/json"
"fmt"
"math"
"strconv"
"time"
"github.com/google/go-querystring/query"
)
// Task models a specific task in Teamwork.
type Task struct {
ID int `json:"id"`
Title string `json:"content"`
Description string `json:"description"`
ProjectID ... |
package quorumFunTests
import (
"flag"
"fmt"
"os"
"testing"
q "github.com/selabhvl/cpnmbt/rwregister"
r "github.com/selabhvl/cpnmbt/rwregister/reader"
)
var (
rxmldir *string
wxmldir *string
readXmlDir string
writeXmlDir string
readTests r.XMLReadQFTest
writeTests r.XMLWriteQFTest
)
func ini... |
package function
import (
"fmt"
"os"
"path/filepath"
"reflect"
"strings"
"github.com/cozees/cook/pkg/runtime/args"
)
func AllPathFlags() []*args.Flags {
return []*args.Flags{pbaseFlags, pabsFlags, pcleanFlags, pdirFlags, pextFlags, psplitFlags, prelFlags, pglobFlags}
}
type pathOptions struct {
Args []strin... |
package modular_sqrt
import (
"fmt"
"math/big"
"strconv"
"time"
)
type cipherPair struct {
c *big.Int
positive bool
}
func mod_exp(base, exponent, modulus *big.Int) *big.Int {
return new(big.Int).Exp(base, exponent, modulus)
}
func quad_res(x, p *big.Int) bool {
//println("p-1/2="+new(big.Int).Div(Su... |
package client
import (
"bufio"
"errors"
"fmt"
"io"
"log"
"net"
"strconv"
"strings"
)
const (
GET = "get"
SET = "set"
DEL = "del"
TCPPort = 12346
)
type TcpClient struct {
net.Conn
r *bufio.Reader
}
func (c *TcpClient) SendGet(key string) error {
log.Printf("req-GET: key=%s", key)
if _, err := c.Wri... |
// Copyright 2020 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build ignore
// +build ignore
package main
import (
"bytes"
"fmt"
"go/format"
"go/types"
"io/ioutil"
"log"
"reflect"
"sort"
"strings"
"golang.... |
package peerexchange
import (
"context"
"errors"
"fmt"
"math"
"net"
"strconv"
"github.com/libp2p/go-eventbus"
"github.com/libp2p/go-libp2p-core/event"
"github.com/libp2p/go-libp2p-core/host"
ma "github.com/multiformats/go-multiaddr"
manet "github.com/multiformats/go-multiaddr/net"
"golang.org/x/sync/errgr... |
/*
Package syncbus provides an event bus for testing.
SyncBus can be used to execute test instructions in a concurrent program in a predefined order. It is expected
to be used as a test hook shared between the production and the test code, or left nil if not required.
It provides a wait function for processes in goro... |
package group // import "github.com/docker/infrakit/pkg/controller/group"
import (
"fmt"
"sync"
group_types "github.com/docker/infrakit/pkg/controller/group/types"
"github.com/docker/infrakit/pkg/spi/flavor"
"github.com/docker/infrakit/pkg/spi/group"
"github.com/docker/infrakit/pkg/spi/instance"
"github.com/do... |
package actions
import (
"encoding/json"
"fmt"
"net/http"
"time"
"go.uber.org/zap"
"github.com/bitrise-io/addons-firebase-testlab/analytics"
"github.com/bitrise-io/addons-firebase-testlab/database"
"github.com/bitrise-io/addons-firebase-testlab/firebaseutils"
"github.com/bitrise-io/addons-firebase-testlab/j... |
// Copyright © 2020 by PACE Telematics GmbH. All rights reserved.
// Created at 2020/05/20 by <NAME>
package transport
import (
"encoding/hex"
"fmt"
"net/http"
"net/http/httputil"
"net/url"
"strings"
"github.com/caarlos0/env"
"github.com/pace/bricks/maintenance/log"
"github.com/pace/bricks/pkg/redact"
)
//... |
package interpreter
import (
"fmt"
"github.com/smackem/ylang/internal/lang"
"math"
"reflect"
)
type ColorHsv struct {
H lang.Number
S lang.Number
V lang.Number
}
func hsvFromRgb(rgb lang.Color) ColorHsv {
r := rgb.ScR()
g := rgb.ScG()
b := rgb.ScB()
max := lang.Number(math.Max(float64(r), math.Max(float6... |
//go:build darwin || linux
// +build darwin linux
package fs
import (
"context"
"encoding/hex"
"math"
"strconv"
"sync"
"syscall"
"time"
"arhat.dev/pkg/hashhelper"
"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse"
"arhat.dev/credentialfs/pkg/security"
)
func newRootNode() *rootNode {
... |
package ssz
import (
"encoding/binary"
"fmt"
)
// ---- Unmarshal functions ----
// UnmarshallUint64 unmarshals a little endian uint64 from the src input
func UnmarshallUint64(src []byte) uint64 {
return binary.LittleEndian.Uint64(src)
}
// UnmarshallUint32 unmarshals a little endian uint32 from the src input
fun... |
package pgbouncer
import (
"bufio"
"bytes"
"context"
"database/sql"
"fmt"
"html/template"
"io/ioutil"
"os"
"regexp"
"github.com/jackc/pgx"
"github.com/pkg/errors"
)
type PgBouncer struct {
ConfigFile string
ConfigTemplateFile string // template that can be rendered with Host value
Executor ... |
package buildrunner
import (
"log"
"os"
"os/exec"
"path/filepath"
"strings"
"time"
"github.com/go-git/go-git/v5"
"github.com/kennygrant/sanitize"
"github.com/mouckatron/buildservice/v2/internal/logs"
"github.com/mouckatron/go-buildspec/buildspec"
)
var homeDir string
var buildsDir string
var phaseOrder = [... |
package main
import (
"bufio"
"bytes"
ui "github.com/gizak/termui"
tm "github.com/nsf/termbox-go"
"github.com/spf13/cobra"
"io/ioutil"
"log"
"os"
"os/exec"
"regexp"
)
func main() {
var rootCmd = cobra.Command{
Use: "",
Long: "",
Run: whichTomcat,
}
rootCmd.Execute()
}
func whichTomcat(cmd *cobra... |
// Copyright 2021 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
// http handler
package handlers
import (
"bytes"
"context"
"encoding/json"
"fmt"
"net/http"
"os"
"os/signal"
"strings"
"syscall"
"time"
"go.uber.org/zap"
"github.com/fukata/golang-stats-api-handler"
"github.com/go-zoo/bone"
"github.com/shogo82148/go-gracedown"
"github.com/swagchat/chat-api/datastore"... |
// Copyright (c) 2021 Apptainer a Series of LF Projects LLC
// For website terms of use, trademark policy, privacy policy and other
// project policies see https://lfprojects.org/policies
// Copyright (c) 2021, Sylabs Inc. All rights reserved.
// This software is licensed under a 3-clause BSD license. Please consul... |
// Copyright (C) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See LICENSE-CODE in the project root for license information.
package file
import (
"encoding/csv"
"fmt"
"os"
"sort"
"github.com/Azure/Avere/src/go/pkg/log"
"github.com/Azure/Avere/src/go/pkg/stats"
)
const (
fileO... |
package handler
import (
"context"
"errors"
"fmt"
apimodels "github.com/keptn/go-utils/pkg/api/models"
"time"
keptnv2 "github.com/keptn/go-utils/pkg/lib/v0_2_0"
"github.com/benbjohnson/clock"
"github.com/keptn/keptn/shipyard-controller/common"
"github.com/keptn/keptn/shipyard-controller/db"
"github.com/kep... |
package dateutil
import (
"fmt"
"github.com/chain5j/logger"
"strings"
"time"
)
/*
前面是含义,后面是 go 的表示值,多种表示,逗号","分割
年 06,2006
月份 1,01,Jan,January
日 2,02,_2
时 3,03,15,PM,pm,AM,am
分 4,04
秒 5,05
周几 Mon,Monday
时区时差表示 -07,-0700,Z0700,Z07:00,-07:00,MST
时区字母缩写 MST
您看出规律了么!哦是的,你发现了,这里面没有一个是重复的,所有的值表示都唯一对应一个时间部分。
并且涵盖了很... |
//go:build linux
// +build linux
/*
Copyright 2019 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 applic... |
package main
import (
"bytes"
"context"
"encoding/csv"
"encoding/json"
"fmt"
"github.com/shibukawa/configdir"
"github.com/skratchdot/open-golang/open"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
"google.golang.org/api/admin/directory/v1"
"google.golang.org/api/groupssettings/v1"
"io"
"io/ioutil"
"... |
// Copyright 2020 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 appl... |
/*
Copyright 2021 The Crossplane 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, ... |
package main
import (
"bufio"
"fmt"
"log"
"os"
"unicode/utf8"
)
type pos struct {
x, y int
}
func (p pos) add(o pos) pos {
return pos{p.x + o.x, p.y + o.y}
}
type portal struct {
name string
a, b pos
}
type maze struct {
grid map[pos]string
warp map[string]portal
warpPos map[pos]string
w, h i... |
package common
import (
"bufio"
"context"
"fmt"
"regexp"
"strings"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "k8s.io/client-go/kubernetes/typed/core/v1"
restclient "k8s.io/client-go/rest"
"k8s.io/klog/v2"
"github.com/openshift/insights-operator/pkg/record"
"github.com/o... |
// Copyright (C) 2019 Orange
//
// This software is distributed under the terms and conditions of the 'Apache License 2.0'
// license which can be found in the file 'License.txt' in this package distribution
// or at 'http://www.apache.org/licenses/LICENSE-2.0'.
package dgraph
import (
"context"
"encoding/json"
... |
package pty
import (
"errors"
"fmt"
"os"
"strconv"
"strings"
"unsafe"
"golang.org/x/sys/windows"
"golang.org/x/sys/windows/registry"
)
var (
kernel32 = windows.NewLazySystemDLL("kernel32.dll")
createPseudoConsole = kernel32.NewProc("CreatePseudoConsole")
procResizePs... |
/*
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 writing, software
distribu... |
package main
import (
"bytes"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"github.com/bazo-blockchain/bazo-client/REST"
"github.com/bazo-blockchain/bazo-client/client"
"github.com/bazo-blockchain/bazo-miner/storage"
"io/ioutil"
"log"
"math/big"
"net/http"
"os"
"os/exec"
"strconv"
"time"
)
var (
log... |
package unit_process
import (
"encoding/json"
"errors"
"github.com/gazercloud/gazernode/resources"
"github.com/gazercloud/gazernode/utilities/logger"
"github.com/prometheus/procfs"
"strconv"
"strings"
"time"
)
var Image []byte
func init() {
Image = resources.R_files_sensors_unit_comruter_process_png
}
func... |
package scheduler
import (
"encoding/json"
"fmt"
"k8s.io/klog/v2"
)
type GPUUnit struct {
Core int
Memory int
GPUCount int
}
func (g *GPUUnit) String() string {
return fmt.Sprintf("(core: %d, memory: %d, gpu count: %d)", g.Core, g.Memory, g.GPUCount)
}
type GPU struct {
CoreAvailable int
MemoryAvai... |
package module_test
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
dcm "github.com/open-ness/EMCO/src/dcm/pkg/module"
"github.com/open-ness/EMCO/src/orchestrator/pkg/infra/db"
orch "github.com/open-ness/EMCO/src/orchestrator/pkg/module"
)
var _ = Describe("Keyvalue", func() {
var (
mdb *d... |
package cmd
import (
"regexp"
"strings"
"github.com/rsteube/carapace"
spec "github.com/rsteube/carapace-spec"
"github.com/rsteube/carapace/pkg/style"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
os "github.com/rsteube/carapace-bin/pkg/actions/os"
)
var rootCmd = &cobra.Command{
Use: "ca... |
// build +linux
package main
import (
"C"
"net"
"os"
"strings"
"syscall"
"unsafe"
"github.com/sirupsen/logrus"
"golang.org/x/sys/unix"
)
// Device information for linux
var (
DefaultDevices = []*Device{
// /dev/urandom
{
Path: "/dev/urandom",
Type: 'c',
Major: 1,
Minor: ... |
/*
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 writing, software
distributed under the Li... |
package command
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
"github.com/Dataman-Cloud/swan/src/types"
"github.com/urfave/cli"
)
// NewRunCommand returns the CLI command for "run"
func NewRunCommand() cli.Command {
return cli.Command{
Name: "run",
Usage: "run new application",
Flags: []cl... |
package cleaner
import (
"errors"
"fmt"
"strings"
"time"
"github.com/Masterminds/semver/v3"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/ec2metadata"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ecr"
log "github.com/sirupsen/logrus"
)
// Cleaner allows for pr... |
package oneko
import (
"context"
"fmt"
"net/http"
"o-neko-catnip/pkg/o-neko-catnip/config"
"o-neko-catnip/pkg/o-neko-catnip/logger"
"time"
"github.com/ReneKroon/ttlcache/v2"
"github.com/go-resty/resty/v2"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promau... |
package main
import (
"fmt"
"io"
"net/http"
"strconv"
"github.com/gin-gonic/contrib/sessions"
"github.com/gin-gonic/gin"
)
const isLoginKey = "is_login"
// HandleAuth doc
func HandleAuth(c *gin.Context) {
session := sessions.Default(c)
isLogin := session.Get(isLoginKey)
if isLogin == nil || !isLogin.(bool)... |
package main
import (
"flag"
"math"
"os"
"strings"
"time"
log "github.com/sirupsen/logrus"
"github.com/infobloxopen/themis/pdp"
"github.com/infobloxopen/themis/pdp/ast"
"github.com/infobloxopen/themis/pdpserver/server"
)
const (
policyFormatNameYAML = "yaml"
policyFormatNameJSON = "json"
)
var policyPar... |
/*
Copyright 2020 Institute for Automation of Complex Power Systems,
E.ON Energy Research Center, RWTH Aachen University
This project is licensed under either of
- Apache License, Version 2.0
- MIT License
at your option.
Apache License, Version 2.0:
Licensed under the Apache License, Version 2.0 (the "License");
yo... |
package msg
import (
"bytes"
"encoding/binary"
. "github.com/workerwork/upf/core/elem"
"log"
)
type Head struct {
Version byte
MP bool
S bool
Type PFCPMsgType
Length uint16
SEID uint64
Sequence uint32 //3byte
Priority byte
}
type Msg struct {
Head
Cause //Cause
Node... |
package llbutil
import (
"os"
"path/filepath"
"strings"
"github.com/moby/buildkit/client/llb"
)
// MountRunOption gives access to capture custom MountOptions so we
// can easily capture if the mount is to be readonly
type MountRunOption struct {
Source llb.State
Target string
Opts []interface{}
}
type Read... |
package selector
import (
"fmt"
ipld "github.com/ipld/go-ipld-prime"
)
// Selector is a "compiled" and executable IPLD Selector.
// It can be put to work with functions like traversal.Walk,
// which will use the Selector's guidance to decide how to traverse an IPLD data graph.
//
// A Selector is created by parsin... |
// Copyright 2021 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package arc
import (
"context"
"path/filepath"
"time"
"chromiumos/tast/common/testexec"
"chromiumos/tast/errors"
androidui "chromiumos/tast/loc... |
package irc
import (
"fmt"
"image/color" //nolint:misspell // unfortunately the go devs cant spell colour.
"strconv"
"strings"
"unicode"
"awesome-dragon.science/go/goGoGameBot/pkg/format/transformer/intermediate"
"awesome-dragon.science/go/goGoGameBot/pkg/format/transformer/tokeniser"
)
const (
bold = '... |
// Copyright 2018-2020 <NAME> (<EMAIL>) and other 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 ... |
package rqs
import (
"errors"
"fmt"
"strings"
"time"
"github.com/sereiner/parrot/context"
"github.com/sereiner/parrot/registry"
"github.com/sereiner/parrot/servers"
"github.com/sereiner/library/jsons"
logger "github.com/sereiner/library/log"
"github.com/sereiner/library/net"
"github.com/sereiner/library/s... |
// +build !windows,cgo
/*
Copyright © 2019 blacktop
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, publi... |
package main
import (
"errors"
"fmt"
"github.com/briandowns/spinner"
"github.com/olekukonko/tablewriter"
"io"
"io/ioutil"
"math"
"os"
"os/signal"
"path/filepath"
"strconv"
"sync"
"syscall"
"time"
)
// Task for processing.
type Task struct {
FilePath string
ShouldStop bool // This bit means that goro... |
package main
import (
"context"
"encoding/json"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"sync"
"syscall"
"time"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/sqs"
"github.com/mctofu/alexa-smart-home/alexa"
"github.com/mctofu/alexa-smar... |
package main
import (
"math"
)
type Rnd interface {
Float64() float64
}
/***********************
* Vec3
************************/
// Vec3 defines a vector in 3D space
type Vec3 struct {
X, Y, Z float64
}
// Scale scales the vector by the value (return a new vector)
func (v Vec3) Scale(t float64) Vec3 {
return... |
/*
Copyright AppsCode Inc. 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 agreed to in writing... |
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package eks
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// An object representing an Amazon EKS cluste... |
package account
// AccountType utilization purpose of address
type AccountType string
// account_type
const (
AccountTypeClient AccountType = "client" // users who created address
AccountTypeDeposit AccountType = "deposit" // this address is used as receiver for deposit
AccountTypePayment AccountType = "payment"... |
// Copyright © 2018 <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... |
/* Copyright 2018 Google Inc. All Rights Reserved. */
package cas
import (
"context"
"encoding/hex"
"fmt"
"io"
"path"
"strconv"
"strings"
"sync"
"time"
rpb "github.com/bazelbuild/remote-apis/build/bazel/remote/execution/v2"
"github.com/google/uuid"
"go.opencensus.io/trace"
bpb "google.golang.org/genpro... |
package s18
import (
"errors"
"fmt"
"log"
"strconv"
"strings"
)
type expression interface {
value() int
}
type intValue int
func (v intValue) value() int {
return int(v)
}
func newIntValue(s string, existing expression) (intValue, error) {
if existing != nil {
return 0, fmt.Errorf("newIntValue got non-ni... |
package codeowners
import (
"context"
"errors"
"fmt"
"github.com/bmatcuk/doublestar"
"github.com/google/go-github/github"
"log"
"net/mail"
"strings"
"sync"
)
// comms holds the channels that are used for communicating async
type comms struct {
data chan *github.User
err chan error
wait *sync.WaitGroup
}
... |
package database
import (
"encoding/binary"
"encoding/json"
"errors"
"github.com/anacrolix/torrent/metainfo"
"github.com/boltdb/bolt"
)
var (
db *bolt.DB
// BucketQueued key, holds Torrent hash keys by auto ID that are queued for activity
BucketQueued = []byte("Queued")
// BucketTorrents key, holds Torrents... |
package requests
import (
"encoding/json"
"fmt"
"net/http"
"time"
)
//ConfigurationRequest - Accepted inputs for configuration
type ConfigurationRequest struct {
MarketCode string `json:"market_code"`
}
// Configuration - Struct for configuration
type Configuration struct {
MinLimit json.Number `json:"min_l... |
package api
import (
"errors"
log "github.com/sirupsen/logrus"
"github.com/kolo/xmlrpc"
"github.com/megamsys/libgo/cmd"
"strconv"
"strings"
)
const (
ENDPOINT = "endpoint"
USERID = "userid"
CURRENTUSER = "username"
PASSWORD = "password"
TEMPLATE = "template"
IMAGE ... |
package pubsub
import (
"fmt"
"net/http"
"net/http/httptest"
"strings"
"testing"
"github.com/caddyserver/caddy"
"github.com/caddyserver/caddy/caddyhttp/httpserver"
)
func configure(expectErr bool, str string) (rules []ruleType, err error) {
var c *caddy.Controller
var mids []httpserver.Middleware
var cfg *... |
package terraform
import (
"fmt"
"log"
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/terraform/addrs"
"github.com/hashicorp/terraform/plans"
"github.com/hashicorp/terraform/states"
"github.com/hashicorp/terraform-plugin-sdk/tfdiags"
)
// NodeAbstractResourceInstance represents a resource instance with n... |
package packets
import (
"encoding/binary"
"fmt"
"hash/crc32"
"swarmd/node"
"log"
"crypto/sha1"
"time"
"crypto/rand"
"math/big"
)
type Packet interface {
Serialize() SerializedPacket
Deserialize(raw SerializedPacket) bool
ToString() string
PacketType() uint8
IsValid() bool
}
type PeerPacket struct {
P... |
package solutions
type graphNode struct {
parentNode *graphNode
word string
}
type void struct{}
var member void
var possibleStates = []string{"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}
func findLadders(startWord str... |
package ssl
import (
"crypto/dsa"
"crypto/ecdsa"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"fmt"
"os"
"time"
"github.com/Sirupsen/logrus"
)
func CmdVerify(chainPath, privateKeyPath, hostname string, selfSigned bool, is ISSL) error {
if _, err := os.Stat(chainPath); os.IsNotExist(err) {
return fmt.Errorf("A... |
// 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
// Copyright 2015 Eryx <evorui аt gmаil dοt cοm>, 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 re... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: go.chromium.org/luci/server/auth/service/protocol/security_config.proto
package protocol
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marsh... |
package models
import (
"time"
"encoding/json"
"strconv"
"strings"
)
var (
ReportingexportjobresponseMarshalled = false
)
// This struct is here to use the useless readonly properties so that their required imports don't throw an unused error (time, etc.)
type ReportingexportjobresponseDud struct ... |
/*
*
* Copyright 2015 gRPC 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 agree... |
package main
import (
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"io/ioutil"
sealedSecretPkg "github.com/bitnami-labs/sealed-secrets/pkg/apis/sealed-secrets/v1alpha1"
"github.com/hashicorp/vault/api"
log "github.com/sirupsen/logrus"
"gopkg.in/yaml.v2"
v1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime/... |
package minikube
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"reflect"
"strings"
"sync/atomic"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/qaware/minikube-support/pkg/apis"
"github.com/qaware/minikube-support/pkg/kubernetes/fake"
"github.com/qaware/minikube-support/pkg/sh"
"github.c... |
// Copyright 2018 The Fuchsia 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 system_update_package
import (
"bufio"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"strings"
"syscall/zx"
"syscall/zx/zxwait"
... |
package perfdash
import (
"fmt"
"html/template"
"io/ioutil"
"net/http"
"path/filepath"
"github.com/evergreen-ci/evergreen/model"
"github.com/evergreen-ci/evergreen/model/version"
"github.com/evergreen-ci/evergreen/plugin"
"github.com/evergreen-ci/evergreen/util"
"github.com/gorilla/mux"
"github.com/mitchel... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.