text stringlengths 3.08k 10.4k |
|---|
package ws
import (
"errors"
"math/rand"
"net/http"
"net/url"
"sync"
"time"
"fmt"
"github.com/gorilla/websocket"
"github.com/jpillora/backoff"
"go.uber.org/zap"
)
var (
ErrNotConnected = errors.New("websocket not connected")
ErrUrlEmpty = errors.New("url can not be empty")
ErrUrlW... |
/*
*
* Copyright 2021 EPAM Systems
*
* 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 ... |
package controllers
import (
"encoding/json"
"github.com/zhangCan112/stm_server_project/errcode"
"github.com/zhangCan112/stm_server_project/errors"
"github.com/zhangCan112/stm_server_project/services"
"github.com/zhangCan112/stm_server_project/utils"
"github.com/zhangCan112/stm_server_project/validation"
)
//U... |
// Code generated by go-swagger; DO NOT EDIT.
package projects
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com... |
package collector
import (
"context"
"log"
"strconv"
"sync"
"time"
"github.com/prometheus/client_golang/prometheus"
"github.com/uhthomas/tesla"
)
type VehicleCollector struct {
ctx context.Context
s *tesla.Service
expire time.Duration
m *sync.RWMutex
cond *sync.Cond
metrics []prometh... |
package cmd
import (
"context"
"fmt"
"os"
"path/filepath"
"github.com/bgentry/speakeasy"
"github.com/phrase/phrase-cli/cmd/internal/updatechecker"
"github.com/phrase/phrase-go"
api "github.com/phrase/phrase-go"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
var (
// Used for flags.
cfgFile string
C... |
package main
import (
"log"
"net/http"
"os"
"os/signal"
"syscall"
"github.com/l3njo/yap/db"
"github.com/l3njo/yap/handler"
"github.com/l3njo/yap/model"
"github.com/joho/godotenv"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
)
var (
e *echo.Echo
port string
jwtSec... |
// Copyright 2021 The Chromium 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 schedulingunit
import (
"context"
"fmt"
"github.com/golang/protobuf/proto"
"github.com/maruel/subcommands"
"go.chromium.org/luci/auth/clien... |
package controller
import (
"fmt"
"sync"
"testing"
kcache "github.com/GoogleCloudPlatform/kubernetes/pkg/client/cache"
kutil "github.com/GoogleCloudPlatform/kubernetes/pkg/util"
)
func TestRetryController_handleOneRetryableError(t *testing.T) {
retried := false
retryErr := fmt.Errorf("retryable error")
cont... |
package scenario
import (
"context"
"fmt"
"github.com/kyma-incubator/compass/components/director/pkg/apperrors"
"github.com/kyma-incubator/compass/components/director/pkg/persistence"
log "github.com/sirupsen/logrus"
"github.com/kyma-incubator/compass/components/director/internal/domain/packageinstanceauth"
... |
package blockchain
import (
"encoding/hex"
"encoding/json"
"fmt"
"math/big"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/libs/kv"
"github.com/tendermint/tendermint/libs/log"
"github.com/amolabs/amoabci/amo/store"
"github.com/... |
package util
import (
"encoding/json"
"fmt"
"gincmf/app/model"
"github.com/gin-contrib/sessions"
"github.com/gin-gonic/gin"
cmf "github.com/gincmf/cmf/bootstrap"
"log"
"os"
"runtime"
"strconv"
"strings"
"time"
)
var PublicPath string
//获取当前登录管理员id
func CurrentAdminId(c *gin.Context) string {
userId, _ :... |
package aws
import (
"fmt"
"time"
"github.com/CloudCoreo/cli/client"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/cloudformation"
"github.com/aws/aws-sdk-go/service/cloudtrail"
)
//SetupService is the struct implements CloudProvider interface for ... |
/*
Copyright 2018 Platform9, Inc
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
... |
package costmanagement
// Copyright (c) Microsoft and contributors. 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
//... |
// 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... |
// Code generated by entc, DO NOT EDIT.
package ent
import (
"fmt"
"strings"
"time"
"entgo.io/ent/dialect/sql"
"github.com/lalifeier/vvgo-mall/app/shop/admin/internal/data/ent/role"
)
// Role is the model entity for the Role schema.
type Role struct {
config `json:"-"`
// ID of the ent.
// 角色id
ID int64 `j... |
// Copyright 2017 <NAME> <<EMAIL>>
// Licensed under the BSD, see LICENSE file for details.
package server
import (
"bytes"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"time"
hh "dmitryfrank.com/geekmarks/server/httphelper"
"github.com/dimonomid/interrors"
"goji.io/pat"
"github.com/gola... |
// 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{}
_... |
// Code generated by go-swagger; DO NOT EDIT.
package public
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/g... |
// +build evm
package evmcompat
import (
"bytes"
"crypto/ecdsa"
"encoding/binary"
"encoding/hex"
"errors"
"fmt"
"math/big"
"strconv"
"strings"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/crypto"
"github.com/ethereum/go-ethereum/crypto/sha3"
ssha "github.com/miguelmota/go-so... |
// Copyright (c) 2015 <NAME> <<EMAIL>>.
// All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
package gv
import (
"image"
//"fmt"
)
type PointType struct { image.Point }
type SizeType struct { image.Point }
type Connec... |
// Copyright 2016 The Cockroach 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 ag... |
// Command lifx allows performing basic operations on LIFX devices over the LAN
package main
import (
"bytes"
"fmt"
"net"
"os"
"os/signal"
"runtime"
"syscall"
"time"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/cobra/doc"
"github.com/arrendy/golifx"
"github.com/arrendy/golifx/... |
// Code generated by cdpgen. DO NOT EDIT.
package dom
import (
"encoding/json"
"github.com/mafredri/cdp/protocol/internal"
)
// NodeID Unique DOM node identifier.
type NodeID int
// BackendNodeID Unique DOM node identifier used to reference a node that may
// not have been pushed to the front-end.
type BackendNo... |
/*
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 applicable law or agreed to in writing, ... |
package geom
// Sequence represents a list of point locations. It is immutable after
// creation. All locations in the Sequence are specified using the same
// coordinates type.
//
// The zero value is an empty sequence of coordinate type DimXY.
type Sequence struct {
ctype CoordinatesType
floats []float64
}
// ... |
package remote
import (
"fmt"
"reflect"
"sort"
"strconv"
"strings"
"github.com/coveooss/terragrunt/v2/options"
"github.com/coveooss/terragrunt/v2/shell"
"github.com/coveooss/terragrunt/v2/tgerrors"
"github.com/coveooss/terragrunt/v2/util"
"github.com/zclconf/go-cty/cty"
)
// State is the configuration for ... |
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use ... |
package imageutil
import (
"bytes"
"crypto/sha256"
"encoding/hex"
"reflect"
"sort"
"testing"
)
type Pillars [][4]int32
func (p Pillars) Len() int { return len(p) }
func (p Pillars) Swap(i, j int) { p[i], p[j] = p[j], p[i] }
func (p Pillars) Less(i, j int) bool {
for k := 0; k < 4; k += 1 {
if p[i][k... |
package main
import (
"errors"
"flag"
"fmt"
"math/rand"
"os"
"os/signal"
"runtime"
"runtime/pprof"
"time"
"github.com/cloudfoundry/gosteno"
"github.com/cloudfoundry/loggregatorlib/cfcomponent"
"github.com/cloudfoundry/loggregatorlib/cfcomponent/localip"
"github.com/cloudfoundry/loggregatorlib/cfcomponent... |
package properties
import (
"fmt"
"math"
"github.com/benoitkugler/webrender/css/parser"
)
var Inf = Float(math.Inf(+1))
// Tag is a flag indicating special values,
// such as "none" or "auto".
type Tag uint8
const (
_ Tag = iota
Auto // "auto"
None // "none"
)
// --------------- Values ---------... |
package binance
import (
"context"
"encoding/json"
"fmt"
"net/url"
"github.com/luno/jettison/errors"
)
// KlineInterval represents the time interval aggregated per candlestick.
type KlineInterval string
// Enumerated types for KlineInterval.
const (
OneMinute KlineInterval = "1m"
ThreeMinutes KlineInt... |
package cli_test
import (
"fmt"
"net/url"
"path/filepath"
"regexp"
"strings"
"testing"
"time"
"github.com/remind101/empire"
"github.com/remind101/empire/empiretest"
"github.com/remind101/empire/empiretest/cli"
"github.com/remind101/empire/pkg/timex"
"github.com/remind101/empire/server/auth"
"github.com/r... |
/*
Copyright 2022 TriggerMesh 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, softwar... |
// Package app provides a full featured framework for any web app.
package app
import (
"context"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"github.com/gowww/cli"
"github.com/gowww/compress"
"github.com/gowww/crypto"
"github.com/gowww/fatal"
"github.com/gowww/i18n"
gowwwlog "github.com/gowww/log"
"github.c... |
// Code generated by " ../generate.py --output=string_freepool.go --prefix=strings -DELEM=[]string --package=tests ../randomized_freepool.go.tpl ". DO NOT EDIT.
// +build !race
// StringsFreePool is thread-safe pool that uses power-of-two loadbalancing across
// CPUs.
// This library requires the following two addit... |
package samson
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"io/ioutil"
"net/http"
"os"
"time"
)
// Job a Samson job configuration
type Job struct {
client *http.Client
deployTimeout int `required:"true"`
pollInterval int `required:"tru... |
/*
* @Author: Sy.
* @Create: 2019-11-01 20:54:15
* @LastTime: 2019-11-18 21:48:58
* @LastEdit: Sy.
* @FilePath: \server\controllers\admin_controllers\base_controller.go
* @Description: 后台管理
*/
package admin_controllers
import (
"strconv"
"strings"
"vue-typescript-beego-admin/server/libs"
"vue-typescript-b... |
package tracelog
import (
"context"
"fmt"
"net/http"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/propagation"
semconv "go.opentelemetry.io/otel/semconv/v1.4.0"
"go.opentelemetry.io/otel/trace"
"go.uber.org/zap"
)
// A TraceLogger wraps the base Logger functional... |
// Copyright 2019 The Gaea Authors. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by appl... |
package ckks
import (
"errors"
"github.com/ldsec/lattigo/ring"
)
// Operand is a common interface for Ciphertext and Plaintext types.
type Operand interface {
Element() *ckksElement
Degree() uint64
Level() uint64
Scale() float64
}
type ckksElement struct {
value []*ring.Poly
scale float64
isNTT bool
}
// n... |
package info
import (
"encoding/json"
"fmt"
"gisa/controllers"
"gisa/models"
"strconv"
"github.com/astaxie/beego/orm"
"github.com/astaxie/beego/utils"
)
type MenuController struct {
controllers.BaseController
}
type MenuOrder struct {
Id int `json:"id"`
Children []*MenuOrder `json:"children"... |
package hms
import (
"net/http"
"time"
uas "github.com/avct/uasurfer"
"github.com/cespare/xxhash"
)
// HistItem is history item. Contains PUID of served file or
// opened directory and UNIX-time in milliseconds of start of this event.
type HistItem struct {
PUID string `json:"puid"`
Time int64 `json:"time"`
}... |
package store
import (
"context"
"fmt"
"github.com/cortezaproject/corteza-server/compose/types"
"github.com/cortezaproject/corteza-server/pkg/envoy"
"github.com/cortezaproject/corteza-server/pkg/envoy/resource"
"github.com/cortezaproject/corteza-server/pkg/filter"
"github.com/cortezaproject/corteza-server/stor... |
package main
import (
"context"
"flag"
"fmt"
"github.com/containerd/containerd/log"
"github.com/containerd/containerd/tracing"
"github.com/containerd/ttrpc"
"github.com/sirupsen/logrus"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribute"
"go.opentelemetry.io/otel/codes"
"go.opentelemetry.io/ote... |
package model
import (
"errors"
"fmt"
"sort"
)
// BestPublicIpAddress 应用动态规划,寻求最佳EIP列表
// 参考:
// golang实现动态规划算法(背包问题) https://blog.csdn.net/runbat/article/details/94016554
type BestPublicIpAddress struct {
// 原始EIP检测数据
origin []EipAvgBandwidthInfo
//minBandwidth 最小带宽
minBandwidth int
maxBandwidth int
// cell... |
package main
import (
"context"
"errors"
"fmt"
"net/http"
"os"
"os/signal"
"syscall"
"time"
"github.com/ardanlabs/conf"
"github.com/fvosberg/kickstart/hello-go/internal/postgres"
"github.com/fvosberg/kickstart/hello-go/internal/rest"
"github.com/sirupsen/logrus"
"golang.org/x/sync/errgroup"
)
// main sh... |
/*
* Console Module
*
* Manage the Natyla administration form console
*
*/
package natyla
import (
"fmt"
"net"
"strconv"
"strings"
)
/*
* Start the command console
*/
func console() {
ln, err := net.Listen("tcp", ":"+config["telnet_port"].(string))
if err != nil {
// handle error
}
for {
conn, er... |
/**
* Copyright 2019 Whiteblock Inc. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/
package repository
import (
"context"
"fmt"
"io/ioutil"
"net/http"
"strings"
"time"
"github.com/whiteblock/genesis/pkg/entity"
"github.com/do... |
package command
import (
"context"
"path/filepath"
"testing"
"github.com/evergreen-ci/evergreen/model"
"github.com/evergreen-ci/evergreen/model/task"
modelutil "github.com/evergreen-ci/evergreen/model/testutil"
"github.com/evergreen-ci/evergreen/rest/client"
"github.com/evergreen-ci/evergreen/testutil"
"gith... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/firestore/admin/v1/location.proto
package admin // import "google.golang.org/genproto/googleapis/firestore/admin/v1"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import _ "google.golang.org/genproto/googleapis/ap... |
package getopt
import (
"bytes"
"fmt"
"strings"
"testing"
"time"
)
type flagValue bool
func (f *flagValue) Set(value string, opt Option) error {
switch strings.ToLower(value) {
case "true", "t", "on", "1":
*f = true
case "false", "f", "off", "0":
*f = false
default:
return fmt.Errorf("invalid flagValu... |
/*
* Copyright (c) 2021 THL A29 Limited, a Tencent company.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... |
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"path"
"strings"
"github.com/spf13/cobra"
yaml "gopkg.in/yaml.v2"
"github.com/ovh/cds/cli"
"github.com/ovh/cds/sdk"
"github.com/ovh/cds/sdk/exportentities"
)
var actionCmd = cli.Command{
Name: "action",
Short: "Manage CDS action",
}
func action()... |
package configuration
import (
"fmt"
"strings"
errs "github.com/pkg/errors"
"github.com/spf13/viper"
"github.com/fabric8-services/fabric8-jenkins-idler/internal/util"
)
const (
// Constants for viper variable names. Will be used to set
// default values as well as to get each value
proxyURL =... |
package nodegateway
import (
"errors"
"sync"
"time"
go_redis_orm "github.com/fananchong/go-redis-orm.v2"
"github.com/fananchong/go-xserver/common"
"github.com/fananchong/go-xserver/common/config"
"github.com/fananchong/go-xserver/common/context"
nodecommon "github.com/fananchong/go-xserver/internal... |
package scheduler
import (
"fmt"
"strings"
"sync"
"time"
"github.com/runar-rkmedia/gabyoall/api/types"
"github.com/runar-rkmedia/gabyoall/auth"
"github.com/runar-rkmedia/gabyoall/cmd"
"github.com/runar-rkmedia/gabyoall/logger"
"github.com/runar-rkmedia/gabyoall/printer"
"github.com/runar-rkmedia/gabyoall/re... |
package provider
import (
"errors"
"net"
"strconv"
"testing"
"time"
"github.com/devopsext/sre/common"
)
func newrelicNewMeter(endpoint string) (*NewRelicMeter, *Stdout) {
stdout := NewStdout(StdoutOptions{
Format: "template",
Level: "debug",
Template: "{{.msg}}",
TimestampFo... |
package configOperator
import (
"github.com/aerogear/ups-config-operator/pkg/constants"
"fmt"
"os"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/pkg/api/v1"
"k8s.io/client-go/kubernetes"
"log"
"github.com/pkg/errors"
sc "github.com/aerogear/mobile-crd-client/pkg/client/servicecatalog/client... |
package dnsdog
import (
"fmt"
"os"
"time"
"github.com/DataDog/datadog-go/statsd"
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"github.com/google/gopacket/pcap"
"github.com/patrickmn/go-cache"
)
const BPFFilter = "udp port 53"
type statsdClient interface {
Count(name string, value int64,... |
package main
import (
"encoding/json"
"fmt"
"log"
"net"
"net/http"
"os"
"os/signal"
"path/filepath"
"syscall"
"time"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
)
var url string
var clientset *kubernetes.Clientset
var readch chan map[string]float64
var writech chan map[string]float64
// Plugin... |
// Copyright 2020 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 main
import (
"flag"
"fmt"
"log"
"os"
"go.fuchsia.dev/fuchsia/tools/fidl/fidlgen_hlcpp/codegen"
"go.fuchsia.dev/fuchsia/tools/fidl/lib/fidl... |
/*
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... |
// BSD 2-Clause License
//
// Copyright (c) 2020, <NAME>
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, this
// ... |
package cps
import (
"fmt"
"sort"
)
// ByAffectedVariable implements sort.Interface for []Constraint based on
// number of affect affected varaibles.
type ByAffectedVariable []Constraint
func (a ByAffectedVariable) Len() int { return len(a) }
func (a ByAffectedVariable) Swap(i, j int) { a[i], a[j] = a[j], a[i... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package kinesisvideo
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
)
// Please also see https://docs.aws.amazon.com/goto/WebAPI/kinesisvide... |
package model
import (
"database/sql"
"gorm.io/gorm"
)
// this is the schema for Postgres database)
type SchemaVer struct {
gorm.Model // updated_at etc
BuildTime string
GitCommit string
Version string
}
// don't pluralise table name
func (SchemaVer) TableName() string {
return "schema_ver"
}
type Dat... |
package strings
import (
"fmt"
"strconv"
"time"
"unicode"
"github.com/flowonyx/functional/list"
"github.com/flowonyx/functional/option"
"golang.org/x/exp/constraints"
)
// Common date formats.
const (
YYYYMMDD = "2006-01-02"
YYYYMMDDNoDashes = "20060102"
YYYYMD = "2006-1-2"
MMDDYYYY ... |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package sakuracloud
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Get information about an existing Private Ho... |
// Copyright 2015 The Vanadium 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 main
import (
"fmt"
"regexp"
"sort"
"time"
cloudmonitoring "google.golang.org/api/monitoring/v3"
"v.io/jiri/tool"
"v.io/v23/context"
"v... |
package proxy
import (
"fmt"
"net/http"
"strings"
"time"
envoy_service_auth_v2 "github.com/envoyproxy/go-control-plane/envoy/service/auth/v2"
"github.com/golang/protobuf/ptypes"
"github.com/gorilla/mux"
"github.com/rs/zerolog"
"github.com/pomerium/pomerium/internal/httputil"
"github.com/pomerium/pomerium/i... |
/*
Copyright NetFoundry, 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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
... |
package builder
import (
"fmt"
"path/filepath"
"time"
"github.com/aleroux85/meta-builder/refmap"
"github.com/fsnotify/fsnotify"
"github.com/pkg/errors"
)
type Config struct {
project ProjectLoader
source string
destination string
force bool
watching bool
metaFile string
refMap ... |
package pawn
import (
"errors"
"sync"
)
var (
ErrorMoveByWrongColor = errors.New("pawn: move by wrong color")
ErrorInvalidPosition = errors.New("pawn: invalid position")
)
type Board struct {
Squares []*Square
turnNumber int
moveMutex *sync.Mutex
}
func NewBoard() *Board {
return &Board{Squares: AllSqu... |
package orm
import (
"context"
"database/sql"
"encoding/json"
"fmt"
_ "github.com/go-sql-driver/mysql"
"net/http"
"strings"
"testing"
"time"
)
/**
* @Author: feiliang.wang
* @Description: 分页查询测试
* @File: limit_test
* @Version: 1.0.0
* @Date: 2021/1/5 11:01
*/
func TestLimit(t *testing.T) {
tests := ... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: vcs_event.proto
package vcs
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import google_protobuf "github.com/golang/protobuf/ptypes/empty"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
/... |
//
// Copyright 2020 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 agreed to ... |
package log
import (
"bufio"
"encoding/json"
"github.com/sirupsen/logrus"
"github.com/zhsyourai/URCF-engine/config"
"github.com/zhsyourai/URCF-engine/models"
"github.com/zhsyourai/URCF-engine/repositories"
"github.com/zhsyourai/URCF-engine/repositories/log"
"github.com/zhsyourai/URCF-engine/services"
"io"
"s... |
package nullable_test
import (
"testing"
"github.com/Thor-x86/nullable"
"gorm.io/gorm/utils/tests"
)
func TestScanUint64(t *testing.T) {
nullableInt := nullable.NewUint64(nil)
// uint8
nullableInt.Scan(37)
tests.AssertEqual(t, nullableInt.Get(), 37)
// raw binary of uint8
nullableInt.Scan("000000000000000... |
package core
import (
"context"
"io"
"log"
"github.com/dush-t/ryz/core/entities"
"google.golang.org/grpc"
p4ConfigV1 "github.com/p4lang/p4runtime/go/p4/config/v1"
p4V1 "github.com/p4lang/p4runtime/go/p4/v1"
)
// Client contains all the information required to handle a client
type Client struct {
p4V1.P4Runt... |
package libkb
import (
"fmt"
"github.com/keybase/client/go/protocol/keybase1"
context "golang.org/x/net/context"
)
func loadAndUnlockKey(ctx context.Context, g *GlobalContext, lctx LoginContext, kr *SKBKeyringFile, secretStore SecretStore, uid keybase1.UID, kid keybase1.KID) (key GenericKey, err error) {
defer g.... |
package main
import (
"fmt"
"os"
"os/exec"
"path"
"strings"
"github.com/golang/glog"
actuator "github.com/openshift/cluster-api-provider-libvirt/cmd/libvirt-actuator/utils"
libvirtutils "github.com/openshift/cluster-api-provider-libvirt/pkg/cloud/libvirt/actuators/machine/utils"
"github.com/spf13/cobra"
)
/... |
/*
Copyright 2021 <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... |
// Code generated by gotdgen, DO NOT EDIT.
package tg
import (
"context"
"fmt"
"strings"
"github.com/gotd/td/bin"
)
// No-op definition for keeping imports.
var _ = bin.Buffer{}
var _ = context.Background()
var _ = fmt.Stringer(nil)
var _ = strings.Builder{}
// Folder represents TL type `folder#ff544e65`.
// F... |
package extstr
import (
"strings"
"unicode"
)
// Recombine 转换驼峰字符串为用delimiter分隔的字符串
// example: delimiter = '_'
// HelloWorld -> hello_world
// Hello_World -> hello_world
// HiHello_World -> hi_hello_world
// IDCom -> id_com
// IDcom -> i_dcom
// nameIDCom -> name_id_com
// nameIDcom -> name_i_dcom
func Recombine(s... |
package precompiled
import (
"math/big"
"math"
"github.com/0xPolygon/polygon-edge/chain"
)
type modExp struct {
p *Precompiled
}
var (
big1 = big.NewInt(1)
big4 = big.NewInt(4)
big8 = big.NewInt(8)
big16 = big.NewInt(16)
big32 = big.NewInt(32)
big64 = big.NewInt(64)
big96 ... |
// Package adapter provides utility methods that help convert events
// into an http.Request and http.ResponseWriter
// The code below is adapted from https://github.com/awslabs/aws-lambda-go-api-proxy/blob/19825165bd2fce09ee70ddbd1d4a9a1f710d64a4/core/request.go
package core
import (
"bytes"
"context"
"encoding/ba... |
/*
http://www.apache.org/licenses/LICENSE-2.0.txt
Copyright 2017 Intel 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 ... |
// github.com/bingohuang/go-codes
/**
题目: 52. N皇后 II
难度: 3
地址: https://leetcode-cn.com/problems/n-queens-ii/
*/
package test
import (
"fmt"
"math"
"reflect"
"testing"
)
// input and ouput
type IO52 struct {
in int
out int
}
func Test52(t *testing.T) {
// add test cases
tc := map[string]IO52{
"1": IO52{3, ... |
package main
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"sort"
"strings"
log "github.com/Sirupsen/logrus"
"tzk-daemon/hosts"
"tzk-daemon/commons"
"net"
)
//Files contains all the files needed to configure tinc and
//connect to other nodes
type Files struct {
Hosts map[... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package frauddetector
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type GetEventPredictionInput struct {
_ struct{} `type:"structure"`
// The detector ID.
//
// DetectorId i... |
// 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 date
import (
"errors"
"fmt"
"strconv"
"strings"
"time"
"unicode"
)
// MustAutoParse is as per AutoParse except that it panics if the string can... |
/*
Copyright 2021.
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
distributed un... |
package launchplan
import (
"context"
"fmt"
"runtime/pprof"
"time"
"github.com/lyft/flytestdlib/logger"
"github.com/lyft/flytestdlib/contextutils"
"github.com/lyft/flytestdlib/promutils"
"github.com/lyft/flytestdlib/utils"
"github.com/lyft/flyteidl/gen/pb-go/flyteidl/admin"
"github.com/lyft/flyteidl/gen... |
package fdk
import (
"context"
"io"
"log"
"net/http"
"os"
"time"
)
// Handler is a function handler, representing 1 invocation of a function
type Handler interface {
// Serve contains a context with request configuration, the body of the
// request as a stream of bytes, and a writer to output to; user's may s... |
package main
import (
"bytes"
"compress/zlib"
"errors"
"io/ioutil"
"log"
"os"
"os/exec"
"path"
"path/filepath"
"runtime"
// extends support for mutating and writing ELFs
"github.com/Binject/debug/elf"
)
const (
Compiler string = "clang"
//StubSectionName string = ".ward.protect"
)
// Helper that compi... |
// Copyright 2016 Palantir 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 ... |
package errors
import (
"fmt"
"runtime"
"strings"
"google.golang.org/grpc/codes"
grpcstatus "google.golang.org/grpc/status"
)
var (
basePath = ""
)
//StackFrame represents the stackframe for tracing exception
type StackFrame struct {
File string `json:"file"`
Line int `json:"line"`
Func string `json:"fu... |
package bot
import (
"fmt"
"strconv"
"net/url"
)
const BASE_URL = "https://api.vk.com/method/"
type Bot struct
{
token string // access_token
names []interface{} // bot mentions
version string // vk api version
is_group bool // is bot group?
poll LPData // data of LongPoll
id int // bot vk id
bot_id int ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.