text stringlengths 3.08k 10.4k |
|---|
package stmgr_test
import (
"context"
"fmt"
"io"
"testing"
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/actors"
"github.com/filecoin-project/lotus/chain/actors/aerrors"
"github.com/filecoin-project/lotus/chain/gen"
"github.com/fi... |
/*
Copyright 2018 Google, Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in... |
package service
import (
"context"
mux2 "github.com/gorilla/mux"
"github.com/gorilla/websocket"
"net/http"
"time"
)
var (
srv = make(map[string]Service)
mux *mux2.Router
Server *http.Server
)
func init() {
mux = mux2.NewRouter()
}
type Service interface {
Name() string
ServeHTTP(http.ResponseWriter... |
/*
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... |
package apps
import (
"encoding/json"
"fmt"
"github.com/TeaWeb/code/teaconfigs/agents"
"github.com/TeaWeb/code/teaconfigs/forms"
"github.com/TeaWeb/code/teaconfigs/notices"
"github.com/TeaWeb/code/teaconst"
"github.com/TeaWeb/code/teaweb/actions/default/agents/agentutils"
"github.com/iwind/TeaGo/actions"
"git... |
package booking
import (
"errors"
"time"
"github.com/Promacanthus/vigour/cargo"
"github.com/Promacanthus/vigour/location"
"github.com/Promacanthus/vigour/routing"
)
// ErrInvalidArgument 当一个或多个参数无效时返回
var ErrInvalidArgument = errors.New("invalid argument")
type Service interface {
// BookNewCargo 在追踪系统中注册尚未运输... |
package main
import (
"os"
"runtime"
"strings"
)
func pkgExists(pkgName string) bool {
pkgDispName := bolden(pkgName)
infoInstalled := pathExists(infoPath+pkgName+".json", "package info for %s", pkgDispName)
srcInstalled := pathExists(srcPath+pkgName, "package source for %s", pkgDispName)
switch { // Check c... |
/*
Copyright (c) 2021 AT&T Intellectual Property.
Copyright (c) 2018-2021 Nokia.
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
... |
// Copyright 2018 <NAME>. All rights reserved.
//
// SPDX-License-Identifier: Apache-2.0
package plsqlparser
import (
"fmt"
"io"
"log"
"strings"
"unicode/utf8"
"github.com/pkg/errors"
)
var Warning = errors.New("WARNING")
type InsertInto struct {
Table string
IsSelect bool
Fields []string
Values [... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package ec2
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type CreateSecurityGroupInput struct {
_ struct{} `type:"structure"`
// A description for the security group. This is informa... |
/*
* gomacro - A Go interpreter with Lisp-like macros
*
* Copyright (C) 2017-2019 <NAME>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
* as... |
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law ... |
package command
import (
"context"
"fmt"
"io/ioutil"
"os"
"github.com/pkg/errors"
"github.com/kyma-project/control-plane/components/kubeconfig-service/pkg/client"
"github.com/kyma-project/control-plane/components/kyma-environment-broker/cmd/cli/credential"
"github.com/kyma-project/control-plane/components/ky... |
package model
import (
"fmt"
"regexp"
"strings"
"time"
"github.com/Sho2010/cinderella-simple/encrypt"
"k8s.io/apimachinery/pkg/util/validation"
)
var (
ErrorRequireNamespace = &ClaimValidationError{mes: "Require Namespace field", field: "Namespaces", errorType: "empty value"}
ErrorRequireSubject = &ClaimVa... |
package main
import (
"crypto/sha1"
"encoding/hex"
"errors"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"sync"
"time"
"github.com/dustin/go-humanize"
"github.com/gosuri/uiprogress"
"github.com/gosuri/uiprogress/util/strutil"
"gopkg.in/kothar/go-backblaze.v0"
)
// TODO support subdirectories
// TODO su... |
package milrabliars
import (
"sort"
)
// RunningTotalLiars stores how many times any number has lied so far.
type RunningTotalLiars struct {
// HighestNumberChecked is the highest number that this data includes. We
// start checking at 3 and we only check odd numbers, so if this is 7, for
// example, th... |
package builder
import (
"errors"
"io"
"io/ioutil"
"regexp"
l "github.com/Sirupsen/logrus"
"github.com/moby/moby/pkg/archive"
"github.com/modcloth/go-fileutils"
"github.com/onsi/gocleanup"
"github.com/rafecolton/go-dockerclient-quick"
"github.com/winchman/builder-core/communication"
"github.com/winchman/b... |
package questdb
import (
"bufio"
"crypto"
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rand"
"database/sql"
"encoding/base64"
"errors"
"fmt"
"math/big"
"net"
_ "github.com/lib/pq"
)
// Config is a struct which holds Client's config fields
type Config struct {
ILPHost string
ILPAuthPrivateKey stri... |
package keygen
import (
"crypto/rand"
"errors"
"github.com/cronokirby/safenum"
"github.com/taurusgroup/multi-party-sig/internal/round"
"github.com/taurusgroup/multi-party-sig/internal/types"
"github.com/taurusgroup/multi-party-sig/pkg/hash"
"github.com/taurusgroup/multi-party-sig/pkg/math/curve"
"github.com/t... |
package devdeploy
import (
"bytes"
"context"
"io/ioutil"
"log"
"path/filepath"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/pkg/errors"
"golang.org/x/crypto/acme/autocert"
)
// S3AutocertCa... |
package client
import (
"context"
"crypto/tls"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/http/httptrace"
"net/url"
"os"
"time"
"github.com/goware/urlx"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/allenai/bytefmt"
"github.com/allenai/fileheap-client/api"
)
const user... |
/*
* Tencent is pleased to support the open source community by making 蓝鲸 available.
* Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the L... |
package releasemigration
import (
"context"
"fmt"
"time"
"github.com/giantswarm/app/v5/pkg/key"
"github.com/giantswarm/appcatalog"
"github.com/giantswarm/backoff"
"github.com/giantswarm/helmclient/v4/pkg/helmclient"
"github.com/giantswarm/k8sclient/v5/pkg/k8sclient"
"github.com/giantswarm/microerror"
"githu... |
/*
Copyright 2018 ZTE Corporation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... |
package hyperion
import (
"encoding/json"
"fmt"
"io"
"net"
"reflect"
"strconv"
"time"
log "github.com/Sirupsen/logrus"
"github.com/pdf/kodi-callback-daemon/config"
)
var (
cfg *config.Config
conn net.Conn
encoder *json.Encoder
decoder *json.Decoder
)
// Response stores Hyperion results for RPC c... |
package api
import (
"context"
"errors"
"net/http"
"path"
"strconv"
"time"
"github.com/golang/glog"
"github.com/julienschmidt/httprouter"
"github.com/livepeer/livepeer-data/health"
"github.com/livepeer/livepeer-data/pkg/data"
"github.com/livepeer/livepeer-data/pkg/jsse"
"github.com/prometheus/client_golan... |
package main
import (
"context"
"flag"
"fmt"
"github.com/google/go-github/v30/github"
"github.com/kouhin/envflag"
"golang.org/x/oauth2"
"log"
"strings"
"time"
)
var (
token = flag.String("token", "", "GitHub access token")
owner = flag.String("owner", "", "User/org whose repositories should be ... |
package circheatmap
import (
"fmt"
"math"
"github.com/knightjdr/prohits-viz-analysis/pkg/color"
"github.com/knightjdr/prohits-viz-analysis/pkg/float"
customMath "github.com/knightjdr/prohits-viz-analysis/pkg/math"
)
// Circle has properties for drawing one circle in a circular heatmap.
type Circle struct {
Att... |
package base
import (
"math/rand"
"sync/atomic"
"time"
"unsafe"
)
var (
gTimeMaster = newTimeMaster()
defaultISODateBuffer = []byte{
0x30, 0x30, 0x30, 0x30, 0x2D, 0x30, 0x30, 0x2D, 0x30, 0x30,
0x54, 0x30, 0x30, 0x3A, 0x30, 0x30, 0x3A, 0x30, 0x30, 0x2E,
0x30, 0x30, 0x30, 0x2B, 0x30, 0x30, 0x3A, 0x... |
package mailout
import (
"bytes"
"encoding/base64"
"io"
"net/http"
"net/url"
"strings"
"github.com/SchumacherFM/mailout/bufpool"
"github.com/SchumacherFM/mailout/maillog"
"golang.org/x/crypto/openpgp"
"gopkg.in/gomail.v2"
)
// pgpStartText is a marker which denotes the end of the message and the start of
... |
package client
import (
"errors"
"fmt"
"math/big"
"strings"
"github.com/threefoldtech/rivine/types"
)
var errUnableToParseSize = errors.New("unable to parse size")
// PeriodUnits turns a period in terms of blocks to a number of weeks.
func PeriodUnits(blocks types.BlockHeight) string {
return fmt.Sprint(block... |
package rabbitmq_consumer_bridge
import (
"io/ioutil"
"os"
"strconv"
"strings"
"time"
"github.com/sirupsen/logrus"
"github.com/streadway/amqp"
"github.com/tidwall/gjson"
"gopkg.in/yaml.v2"
)
type AppConfig struct {
Debug bool `yaml:"debug"`
Prefix string ... |
package mw_test
import (
"context"
"errors"
"fmt"
"sync"
"sync/atomic"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gitoa.ru/go-4devs/cache"
"gitoa.ru/go-4devs/cache/mw"
"gitoa.ru/go-4devs/cache/test"
)
var (
errFallback = errors.New("fallback error")
err... |
package net_test
import (
"context"
"fmt"
"testing"
"time"
"github.com/filecoin-project/go-filecoin/internal/pkg/block"
"github.com/libp2p/go-libp2p-pubsub"
"github.com/libp2p/go-libp2p-pubsub/pb"
mocknet "github.com/libp2p/go-libp2p/p2p/net/mock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/te... |
package keystone
import "time"
//AuthRequest is used to request an authentication.
type AuthRequest interface {
SetCredential(string, string)
GetIdentity() *Identity
GetScope() *Scope
}
//UnScopedAuthRequest is used to request an authentication.
type UnScopedAuthRequest struct {
Auth *UnScopedAuth `json:"auth"`
... |
package concurrent_map
import (
"sync"
)
// ConcurrentMap is a thread safe map collection with better performance.
// The backend map entries are separated into the different partitions.
// Threads can access the different partitions safely without lock.
type ConcurrentMap struct {
partitions []*innerMap
numOfB... |
// Copyright The OpenTelemetry 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 agre... |
package hst
import (
"encoding/json"
"fmt"
"html/template"
"net/http"
"net/url"
"strings"
"time"
)
// Context 上下文数据
type Context struct {
hst *HST
W *responseWriterWithLength
R *http.Request
status int
close bool
// template
templateDelims []string
templateFuncMap template.FuncMap
}
//... |
// Copyright 2014 <NAME>. 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 applic... |
package apimanagement
import (
"fmt"
"html"
"log"
"time"
"github.com/Azure/azure-sdk-for-go/services/apimanagement/mgmt/2021-08-01/apimanagement"
"github.com/hashicorp/terraform-provider-azurerm/helpers/azure"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-p... |
// Copyright 2015 stevejiang. 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... |
package config
import (
"encoding/json"
"fmt"
"os"
"path"
"path/filepath"
)
const ExchangeURLEnvvarName = "HZN_EXCHANGE_URL"
type HorizonConfig struct {
Edge Config
AgreementBot AGConfig
Collaborators Collaborators
ArchSynonyms ArchSynonyms
}
// This is the configuration options for Edge compone... |
// Copyright 2013 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 or at
// https://developers.google.com/open-source/licenses/bsd.
package gosrc
import (
"context"
"log"
"net/http"
"path"
"regexp"
"time"
)
func init(... |
package codec
import (
"encoding/binary"
"fmt"
"io"
)
type Serializable interface {
Serialize(w *EncodingWriter) error
ByteLength
FixedLength
}
type ByteLength interface {
ByteLength() uint64
}
const OFFSET_SIZE = 4
func Sum(values ...ByteLength) (out uint64) {
for _, v := range values {
out += v.ByteLen... |
package main
import (
"database/sql"
"flag"
"fmt"
_ "github.com/go-sql-driver/mysql"
"os"
"strings"
)
type dbConn struct {
base, target *sql.DB
}
func usage() {
fmt.Printf("Usage of %s:\n", os.Args[0])
flag.PrintDefaults()
fmt.Println("The following flags are required:")
fmt.Println("username, password... |
// Copyright (c) 2020 The qitmeer developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package testutils
import (
"bytes"
"context"
"crypto/tls"
"crypto/x509"
"encoding/base64"
"encoding/json"
"fmt"
"github.com/Qitmeer/qitmeer/rpc/client/cmds"
"io"
"i... |
// Copyright (C) 2015 Nippon Telegraph and Telephone 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... |
package distribute
import (
"bufio"
"fmt"
"github.com/Shopify/yaml"
"github.com/fatih/color"
"github.com/j3ssie/osmedeus/libs"
"github.com/j3ssie/osmedeus/provider"
"github.com/j3ssie/osmedeus/utils"
"github.com/olekukonko/tablewriter"
"golang.org/x/term"
"os"
"strings"
... |
package keyauth
import (
"bytes"
"crypto/sha256"
"errors"
"fmt"
"io/ioutil"
"net/http"
"strings"
"github.com/devopsfaith/krakend-ce/ext/util"
"github.com/devopsfaith/krakend/config"
"github.com/devopsfaith/krakend/logging"
"github.com/devopsfaith/krakend/proxy"
krakendgin "github.com/devopsfaith/krakend/r... |
package bucket
import (
"sync"
"time"
)
// Bucket 会保留一部分的 token,仅供 Hurry 使用。
type Bucket interface {
// Hurry 会先使用为自己保存的 hToken
// 不够的时候,再使用 wToken
Hurry(count int64)
// Wait 只能使用 wToken
Wait(count int64)
}
var now = time.Now
var sleep = time.Sleep
// New 返回了 Bucket 接口的变量
// reserving 代表了 duration 期间保留给 Hur... |
package main
import (
"context"
"errors"
"io"
"io/ioutil"
"math/rand"
"net/http"
"net/url"
"os"
"os/signal"
"path"
"path/filepath"
"runtime"
"strings"
"syscall"
"time"
"github.com/gin-contrib/cors"
"github.com/gin-gonic/gin"
"github.com/h2non/filetype"
log "github.com/sirupsen/logrus"
"github.com/... |
package main
import (
"bufio"
"fmt"
"io"
"log"
"os"
"path/filepath"
"regexp"
"strings"
"github.com/insomnimus/fields/args"
)
var (
exeName = "fields"
lines []int
words []int
separator = ""
maxLine = -1
file, word, line string
)
var (
reSep = regexp.MustCompile(`^\-(?:s|\-separa... |
package collectors
import (
"encoding/json"
"fmt"
"net/http"
"sync"
"time"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/log"
apiv1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
)
// ElasticsearchCollector exports redis hea... |
/*
* Copyright (c) 2017, 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 vulcand
import (
"context"
"encoding/json"
"fmt"
"sync"
"time"
etcd "github.com/coreos/etcd/clientv3"
"github.com/mailgun/log"
"github.com/pkg/errors"
)
const (
reconnectInterval = time.Second
frontendFmt = "%s/frontends/%s.%s/frontend"
middlewareFmt = "%s/frontends/%s.%s/middlewares/%s"... |
package node
import (
"crypto/ecdsa"
"math/big"
"math/rand"
"strings"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/ethdb"
"github.com/ethereum/go-ethereum/params"
"github.com/pkg/errors"
"github.com/harmony-one/harmony/core"
"github.com... |
package main
import (
"bufio"
"context"
"encoding/json"
"fmt"
"log"
"os"
"os/exec"
"strconv"
"strings"
"sync"
"time"
cmap "github.com/orcaman/concurrent-map"
pb "github.com/ss87021456/gRPC-KVStore/proto"
)
type ServerMgr struct {
inMemoryCache cmap.ConcurrentMap
lastSnapTime int64
logLock sync... |
// Copyright 2019 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 datastore
import (
"fmt"
"time"
"github.com/golang/protobuf/proto"
"go.chromium.org/chromiumos/infra/proto/go/lab"
"go.chromium.org/gae/... |
// Copyright 2016 <NAME>. All Rights Reserved.
// See LICENSE for licensing terms.
// Package http_dialer provides HTTP(S) CONNECT tunneling net.Dialer. It allows you to
// establish arbitrary TCP connections (as long as your proxy allows them) through a HTTP(S) CONNECT point.
package http_dialer
import (
"bufio"
"... |
/**
* @Author: <NAME> <d33pblue>
* @Date: 2020-May-22
* @Project: Proof of Evolution
* @Filename: transact_res.go
* @Last modified by: d33pblue
* @Last modified time: 2020-May-27
* @Copyright: 2020
*/
package blockchain
import(
"fmt"
"time"
"encoding/json"
"github.com/D33pBlue/poe/utils"
)
// A R... |
// Created by Hisen at 2022/3/2.
package server
import (
"context"
"errors"
"fmt"
"github.com/gin-contrib/pprof"
"github.com/gin-gonic/gin"
"github.com/hanxinhisen/moss/internal/pkg/middleware"
"github.com/hanxinhisen/moss/pkg/log"
"github.com/marmotedu/component-base/pkg/core"
"github.com/marmotedu/component... |
package main
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
"os/exec"
"strconv"
"strings"
"github.com/tidwall/gjson"
)
type issue struct {
Number string
Title string
Labels []string
}
func valueExistsInSlice(value string, slice []string) bool {
for _, v := range slice {
if v == ... |
// Command-line tool for collecting status information from a BKG NtripCaster instance, e.g. uptime, number of sources etc.
package main
import (
"encoding/json"
"flag"
"fmt"
"log"
"os"
"runtime"
"strings"
"time"
"github.com/de-bkg/gognss/pkg/ntrip"
)
const (
version = "0.1"
)
func main() {
opts := ntrip... |
package session
import (
"github.com/cyverse/go-irodsclient/irods/connection"
"github.com/cyverse/go-irodsclient/irods/types"
log "github.com/sirupsen/logrus"
)
// IRODSSession manages connections to iRODS
type IRODSSession struct {
account *types.IRODSAccount
config *IRODSSessionConfi... |
package webapp
import (
"strconv"
"strings"
)
// An AcceptHeader represents a set of media ranges as sent in the Accept header
// of an HTTP request.
//
// http://tools.ietf.org/html/rfc2616#section-14.1
type AcceptHeader []MediaRange
func (h AcceptHeader) String() string {
parts := make([]string, len(h))
for i ... |
package v1alpha1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
runtime "k8s.io/apimachinery/pkg/runtime"
)
// OpenShiftObject ...
type OpenShiftObject interface {
metav1.Object
runtime.Object
}
// KogitoAppSpec defines the desired state of KogitoApp
// +k8s:openapi-gen=true
... |
package main
import (
"flag"
"fmt"
"image"
"image/jpeg"
"io"
"io/ioutil"
"log"
"os"
"path/filepath"
"strconv"
"strings"
"sync"
"github.com/disintegration/imaging"
)
var (
flagInFolder = flag.String("in", "./", "input folder")
flagOutFolder = flag.String("out", "", "output folder")
flagSize = fl... |
package handler
import (
"crypto/rsa"
"github.com/google/uuid"
protocol "github.com/trisacrypto/trisa/pkg/trisa/api/v1beta1"
"github.com/trisacrypto/trisa/pkg/trisa/crypto"
"github.com/trisacrypto/trisa/pkg/trisa/crypto/aesgcm"
"github.com/trisacrypto/trisa/pkg/trisa/crypto/rsaoeap"
"google.golang.org/protobuf... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: proto/status.proto
package server_status
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 ... |
// +build fuzzy
package xlsx
import (
"archive/zip"
"bytes"
"encoding/xml"
"flag"
"fmt"
"io"
"log"
"math/rand"
"path/filepath"
"reflect"
"strconv"
"testing"
"time"
. "gopkg.in/check.v1"
)
type Fuzzy struct{}
var _ = Suite(&Fuzzy{})
var randseed *int64 = flag.Int64("test.seed", time.Now().Unix(), "Set... |
package util
// Contains helper functions for OVN
// Eventually these should all be migrated to go-ovn bindings
import (
"fmt"
"net"
"strings"
"time"
ovntypes "github.com/ovn-org/ovn-kubernetes/go-controller/pkg/types"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/klog/v2"
)
// UpdateRouterSNAT checks if a NA... |
// Copyright 2017 The LUCI Authors. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.
package cookflags
import (
"flag"
"strconv"
"go.chromium.org/luci/common/flag/stringlistflag"
"go.chromium.org/luci/logdog/client/butlerl... |
package netx
import (
"fmt"
"io"
"net"
"sync/atomic"
"time"
"context"
"sync"
"github.com/coffeehc/logger"
)
const (
contextKeyID = "__ID__"
contextKeySyncHandler = "__syncHandler__"
//contextKey
)
//ConnContext 建立建立后的上下文
type ConnContext interface {
GetID() int64
AddListen(name string, listen... |
package parser
import (
"elljo/compiler/js-parser/ast"
"elljo/compiler/js-parser/parser"
"elljo/compiler/utils"
"regexp"
"strings"
)
type Import struct {
Source string
Name string
IsEllJo bool
}
type Property struct {
ExportStatement *ast.ExportStatement
Name string
}
type Variable struct {... |
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use ... |
/*
* Copyright 2018 Insolar
*
* 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... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package translate
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type TranslateTextInput struct {
_ struct{} `type:"structure"`
// The language code for the language of the source text... |
package parser
import (
"bufio"
"errors"
"fmt"
"os"
"strconv"
"strings"
"github.com/vale1410/bule/constraints"
"github.com/vale1410/bule/glob"
"github.com/vale1410/bule/sat"
)
type Problem struct {
// note that Opt points to first element in Pbs (for further analysis)
Opt *constraints.Threshold
Pbs []*co... |
package main
import (
// "No3371.github.com/song_librarian.bot/logger"
// "github.com/diamondburned/arikawa/v3/discord"
// "github.com/diamondburned/arikawa/v3/gateway"
"fmt"
"strconv"
"strings"
"No3371.github.com/song_librarian.bot/logger"
"github.com/diamondburned/arikawa/v3/api"
"github.com/diamondburned/... |
package gorose
import (
"database/sql"
"errors"
"github.com/meizhaorui/gorose/drivers"
"github.com/meizhaorui/gorose/utils"
)
// Connection is the database pre handle
type Connection struct {
// DB is origin DB
DB *sql.DB
// all config sets
DbConfig map[string]interface{}
// default database
Default string
... |
/*
Copyright (C) 2020 Yahoo Japan Corporation Athenz team.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agre... |
package main
//keys.txt layout
//pubkey\nprivkey
import (
"bufio"
"encoding/hex"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"strconv"
"strings"
"github.com/polygonledger/node/block"
cryptoutil "github.com/polygonledger/node/crypto"
)
func readKeys(keysfile string) cryptoutil.Keypair {
dat, _ ... |
/* _ _
*__ _____ __ ___ ___ __ _| |_ ___
*\ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
* \ V V / __/ (_| |\ V /| | (_| | || __/
* \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
*
* Copyright © 2016 - 2019 Weaviate. All rights reserved.
* LICENSE: https://github.com/semi-techno... |
// main HTTP server component
package main
import (
"encoding/json"
"github.com/dchest/uniuri"
"github.com/fvbock/endless"
"github.com/gin-contrib/cors"
"github.com/gin-contrib/static"
"github.com/gin-gonic/gin"
"github.com/mediocregopher/radix/v3"
"github.com/op/go-logging"
"net/http"
"os"
"time"
"strings... |
package pad4pi
import (
"os"
"os/signal"
"reflect"
"time"
"github.com/warthog618/gpio"
)
const (
// J8p27 export of j8 board raspberry
J8p27 = iota
J8p28
J8p3
J8p5
J8p7
J8p29
J8p31
J8p26
J8p24
J8p21
J8p19
J8p23
J8p32
J8p33
J8p8
J8p10
J8p36
J8p11
J8p12
J8p35
J8p38
J8p40
J8p15
J8p16
J8p1... |
/*
Package handshake is abstraction for agency level handshake protocol which
on-boards new clients to the agency. These clients are called EAs (Edge Agents).
Each EA has one CA to present it on the network. User can have many EAs which
all are connected to one CA.
*/
package handshake
import (
"encoding/gob"
"fmt"
... |
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: pb/www.proto
/*
Package pb is a generated protocol buffer package.
It is generated from these files:
pb/www.proto
It has these top-level messages:
EmptyMessage
VersionResponse
ServiceStatus
ServicesStatusList
RsvpCreationRequest
RsvpInfo
RsvpCreat... |
package pedersen
import (
"encoding/binary"
"errors"
"io"
ristretto "github.com/bwesterb/go-ristretto"
generator "github.com/dusk-network/dusk-blockchain/pkg/crypto/rangeproof/generators"
)
// Pedersen represents a pedersen struct which holds
// the necessary information to commit a vector or a scalar to a poin... |
package database
import (
"context"
"errors"
"github.com/google/uuid"
"github.com/uptrace/bun"
"scrumlr.io/server/common"
"scrumlr.io/server/database/types"
"time"
)
type Board struct {
bun.BaseModel `bun:"table:boards"`
ID uuid.UUID
Name *string
AccessPolicy ... |
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: accessors.proto
/*
Package accessors is a generated protocol buffer package.
It is generated from these files:
accessors.proto
It has these top-level messages:
MessageEvent
*/
package accessors
import proto "github.com/gogo/protobuf/proto"
import fmt "... |
package render
import (
goimage "image"
"image/color"
"math"
"photofield/internal/image"
"github.com/tdewolff/canvas"
"golang.org/x/image/draw"
"golang.org/x/image/math/f64"
)
func getRGBA(col color.Color) color.RGBA {
r, g, b, a := col.RGBA()
return color.RGBA{uint8(r >> 8), uint8(g >> 8), uint8(b >> 8), u... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: proto/account/service.proto
/*
Package account is a generated protocol buffer package.
It is generated from these files:
proto/account/service.proto
It has these top-level messages:
ProfileReq
ProfileResp
*/
package account
import proto "github.com/gola... |
package model
const (
// TempTaskPrefix used to separate from the DB tasks.
TempTaskPrefix = "t"
// APPIDBBPhone 哔哩哔哩动画
APPIDBBPhone = 1
// HTTPCodeOk http response normally.
HTTPCodeOk = 0
// SwitchOff off.
SwitchOff = 0
// SwitchOn on.
SwitchOn = 1
// DelMiFeedback feedback 删除 (无效token删除方式)
DelMiFeed... |
package image
import (
"bytes"
gocontext "context"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
"os/exec"
"runtime"
"time"
"github.com/sirupsen/logrus"
"github.com/travis-ci/worker/context"
"golang.org/x/sync/errgroup"
)
type LXCImage struct {
Aliases []struct {
Name stri... |
package servicesync
import (
"context"
stderrors "errors"
mcv1 "q42/mc-robot/pkg/apis/mc/v1"
"sort"
"strings"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"sigs.k8s.io/controller-runtime/pkg/client"
)
func (r *ReconcileServiceSync) getLocalNodeList() (map[string]bool, error) {
n... |
package worker
import (
"encoding/json"
"github.com/gorilla/websocket"
"github.com/pion/webrtc/v3"
"github.com/tk1122/cloud-gaming/pkg/worker/emulator"
"log"
"os"
"sync"
"time"
)
type client struct {
wsWriteMux sync.Mutex
wsConn *websocket.Conn
peerConn *webrtc.PeerConnection
track *webrtc.Trac... |
package main
import "github.com/donomii/throfflib"
import (
"code.google.com/p/gowut/gwu"
"strconv"
"os"
"fmt"
_ "net/http/pprof"
"log"
"net/http"
)
type MyButtonHandler struct {
counter int
text string
}
func (h *MyButtonHandler) HandleEvent(e gwu.Event) {
if b, isButton := e.Src().(gwu.Button); is... |
package main
import (
"errors"
"fmt"
"image"
"image/png"
"io"
"log"
"mime/multipart"
"net/http"
"os"
"path/filepath"
"strings"
"github.com/studio2l/roi"
)
type Env struct {
User *roi.User
useOIDC bool
oidcClientID string
oidcClientSecret string
oidcRedirectURI string
oidcHostDomain ... |
/*************************************************************************
*
* COPYRIGHT 2018 Deluxe Entertainment Services Group Inc. and its subsidiaries (“Deluxe”)
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Deluxe and its suppliers,
* if any. The... |
/*
Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
*/
package metrics
import (
"fmt"
"github.com/oracle/oci-service-operator/pkg/loggerutil"
"github.com/prometheus/client_golang/promethe... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.