text stringlengths 3.08k 10.4k |
|---|
package main
import (
"log"
"fmt"
pb "github.com/BaSuZ/SD_Lab/proto"
"google.golang.org/grpc"
"context"
"time"
)
var (
Score = 0
Status = "Alive"
Player = "-1"
input string
Jugada int32
ActualStage string
ActualRound int32
Finished = false
Playing = false
)
func main(){
conn,err := grpc.Dial("10.6.... |
package version
import (
"fmt"
"io/ioutil"
"path/filepath"
"regexp"
"strconv"
"strings"
"github.com/coreos/go-semver/semver"
)
// ReleasesPrefix denotes the expected prefix for all release files
const ReleasesPrefix = "suite_"
func versionFromString(versionStr string) (*semver.Version, error) {
// Strip the... |
package nui
import (
"encoding/json"
"fmt"
"html/template"
"image"
"reflect"
// need for image.Decode
_ "image/jpeg"
"image/png"
"net"
"net/http"
"net/url"
"os"
"os/exec"
"runtime"
"sync"
"github.com/gorilla/websocket"
"github.com/superp00t/etc"
"github.com/superp00t/etc/yo"... |
/*
Copyright IBM Corp. 2016 All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package protoutil_test
import (
"bytes"
"encoding/pem"
"io/ioutil"
"path/filepath"
"testing"
"github.com/golang/protobuf/proto"
"github.com/hyperledger/fabric-protos-go/common"
"github.com/hyperledger/fabric-protos-go/ms... |
package config
import (
"fmt"
"os"
)
// AuditLogFormat describes the audit log format in use.
type AuditLogFormat string
const (
// AuditLogFormatNone signals that no audit logging should take place.
AuditLogFormatNone AuditLogFormat = "none"
// AuditLogFormatBinary signals that audit logging should take place ... |
package aorm
import (
"database/sql"
"database/sql/driver"
"errors"
"fmt"
"reflect"
"strings"
)
var (
// ErrRecordNotFound record not found error, happens when haven'T find any matched data when looking up with a struct
ErrRecordNotFound = errors.New("record not found")
// ErrInvalidSQL invalid SQL error, ha... |
package ui
import (
"image/color"
"github.com/gpayer/pixelext/nodes"
"github.com/faiface/pixel"
"github.com/faiface/pixel/pixelgl"
)
type scrollBar struct {
nodes.BorderBox
clicked bool
}
func newScrollbar(h float64) *scrollBar {
s := &scrollBar{
BorderBox: *nodes.NewBorderBox("scrollbar", 10, h),
}
s.S... |
package main
import (
"bufio"
"flag"
"fmt"
"io"
"math/rand"
"net"
"net/http"
"os"
"strconv"
"strings"
"sync/atomic"
"time"
"github.com/huajiao-tv/qchat/logic"
)
func Info(args ...interface{}) {
fmt.Print("INFO:")
fmt.Println(args...)
fmt.Print("\n")
}
func Fail(args ...interface{}) {
fmt.Print("Fail... |
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
package shape
import (
"fmt"
"io"
"math"
"github.com/gregoryv/go-design/xy"
)
func NewArrow(x1, y1, x2, y2 int) *Arrow {
return &Arrow{
Start: xy.Position{x1, y1},
End: xy.Position{x2, y2},
Head: NewTriangle(x2, y2, "arrow-head"),
class: "arrow",
}
}
type Arrow struct {
Start xy.Position
End xy... |
package main
import (
"fmt"
"log"
"math/rand"
"sort"
"sync"
"time"
)
// Command: request/release
const Interval = 1 * time.Millisecond
const RandRange = 10
type Message struct {
Type string // Request, Release, Ack
Src int
Dst int
Clock int
}
func S(i int) string {
return string(65 + i)
}
func (m ... |
/*
The type of each word used by `IntSet` is `uint64`,
but 64-bit arithmetic may be inefficient on a 32-bit platform.
Modify the program to use the `uint` type,
which is the most efficient unsigned integer type for the platform.
Instead of dividing by 64, define a constant holding the effective `size of uint` in b... |
// Copyright 2012, 2013 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package state
import (
"github.com/juju/names"
"github.com/juju/juju/environs/config"
"github.com/juju/juju/instance"
"github.com/juju/juju/tools"
"github.com/juju/juju/version"
)
// EntityFinder is implemented b... |
package netcookiejar
import (
"bufio"
"errors"
"fmt"
"math"
"net/http"
"os"
"strconv"
"strings"
"time"
)
const (
MODE_STRING = 0
MODE_FILE = 1
)
// CookieJar Struct holds an array of http cookies, and can read in (parse), as well as write.
type NetCookieJar struct {
}
// NetCookie Special type which im... |
package main
import (
"encoding/json"
"flag"
"fmt"
"image"
"image/color"
"image/png"
"io/ioutil"
"log"
"net"
"sync"
"time"
"net/http"
"math"
"github.com/DheerendraRathor/GoTracer/models"
"github.com/DheerendraRathor/GoTracer/net/constants"
"github.com/DheerendraRathor/GoTracer/utils"
"github.com/go... |
package kana
import (
"regexp"
"strings"
"unicode"
"unicode/utf8"
)
var consonants []string = []string{"b", "d", "f", "g", "h", "j", "k", "l", "m", "p", "r", "s", "t", "w", "z"}
var hiragana_re = regexp.MustCompile(`ん([あいうえおなにぬねの])`)
var katakana_re = regexp.MustCompile(`ン([アイウエオナニヌネノ])`)
var kanaToRomajiTrie *... |
package rmq
import (
"net"
"net/http"
"os"
"strings"
"sync"
"github.com/apache/rocketmq-client-go/v2/primitive"
"gitlab.deepwisdomai.com/infra/go-zero/core/logx"
)
// auth 提供链接到Broker所需要的验证信息(按需配置)
type auth struct {
AccessKey string `json:"ak,omitempty" yaml:"ak,omitempty"`
SecretKey string `json:"sk,omite... |
package main
import (
"bufio"
"fmt"
"os"
"os/signal"
"strings"
"sync"
"github.com/cased/cased-go"
"github.com/cased/cased-go/event"
"github.com/cased/cased-go/workflow"
"github.com/cased/cased-go/workflow/controlstates/approval"
)
const WorkflowName = "provision-database"
type task struct {
workflow ... |
// Copyright 2018 Schibsted
// This package allows you to iterate over a set of service nodes, either in
// sequence or randomly. The RNG can be seeded and will give the same node
// order for the same seed.
package sbalance
import (
"bytes"
crand "crypto/rand"
"hash/fnv"
"io"
"math/rand"
)
// What kind of stra... |
package internal
import (
"errors"
"fmt"
"io"
"os"
"runtime"
"strconv"
"strings"
"sync"
"github.com/harrybrwn/go-canvas"
table "github.com/olekukonko/tablewriter"
)
// Homedir will get the correct home directory
func Homedir() string {
home := os.Getenv("HOME")
if home == "" && runtime.GOOS == "windows" ... |
// Copyright © 2018 <NAME> <<EMAIL>>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
package semioctet_test
import (
"bytes"
"fmt"
"testing"
"github.com/warthog618/sms/encoding/semioctet"
)
type decodePattern struct {
name string
inDst ... |
// Copyright 2014, <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package tff
import (
"encoding"
"fmt"
"io"
"math/big"
"reflect"
"strconv"
"strings"
)
type (
BasicEncodeFunc func(v reflect.Value) Node
BasicDecodeFunc func... |
package internal
import (
"bytes"
"fmt"
"io"
"log"
"os"
"reflect"
"runtime/debug"
"strconv"
"strings"
"sync/atomic"
"unsafe"
)
var (
GrowEnvStack func(env unsafe.Pointer, sz int)
SetEnvStack func(env unsafe.Pointer, stack unsafe.Pointer)
SetObjFun func(obj unsafe.Pointer, fun unsafe.Pointer)
unnam... |
package bnsd
import (
"io/ioutil"
"os"
"testing"
"time"
"github.com/iov-one/weave"
"github.com/iov-one/weave/coin"
"github.com/iov-one/weave/commands/server"
"github.com/iov-one/weave/weavetest"
"github.com/iov-one/weave/x/cash"
"github.com/iov-one/weave/x/sigs"
abci "github.com/tendermint/tendermint/abci/... |
package leafGooglePubsub
import (
"context"
"encoding/json"
"fmt"
leafHeader "github.com/paulusrobin/leaf-utilities/common/header"
leafLogger "github.com/paulusrobin/leaf-utilities/logger/logger"
leafMQ "github.com/paulusrobin/leaf-utilities/messageQueue/messageQueue"
leafSlack "github.com/paulusrobin/leaf-util... |
package xlog
import (
"bytes"
"fmt"
"text/template"
"time"
"github.com/yssk22/go/ansi"
)
// Formatter is an inerface to convert *Record to []byte
type Formatter interface {
Format(*Record) ([]byte, error)
}
// TextFormatter is an implementation of Formatter using text.Template
type TextFormatter struct {
d ... |
package udpnet
import (
"errors"
"fmt"
"net"
"time"
)
// ConnCallback is the interface implemented by objects that handles the main
// events happening on a connection, start, connect, disconnect and stop.
type ConnCallback interface {
OnStart()
OnStop()
OnConnect()
OnDisconnect()
}
// ConnMode indicates the... |
package queue
import (
"bufio"
"bytes"
"errors"
"io/ioutil"
"testing"
"strings"
"github.com/Freeaqingme/dkim"
)
const (
sampleMessage = `To: <EMAIL>
Subject: Example E-Mail
Date: Thu, 10 Nov 2016 19:42:46 +0330
Content-Type: multipart/mixed; boundary=03502b653d124d893d171a853d60488f7385f7d9f2ca7cefc8a4d6cf8... |
package format
import (
"github.com/plandem/xlsx/internal/ml"
"reflect"
)
//StyleID is alias of original ml.StyleID type to:
// 1) make it public
// 2) forbid usage of integers directly
// 3) getting valid ID for StyleFormat via style-sheet
// 4) put everything related to stylesheet to same package
type StyleID ml.... |
package simpleserialize
import (
"bytes"
"encoding/binary"
"errors"
"reflect"
)
// convert data struct into []byte
func MarshalStruct(v interface{}) ([]byte, error) {
obj := reflect.ValueOf(v)
var out bytes.Buffer
for i := 0; i < obj.NumField(); i += 1 {
val := obj.Field(i)
switch val.Kind() {
case re... |
/**
* Copyright 2014 @ z3q.net.
* name :
* author : jarryliu
* date : 2013-12-12 17:16
* description :
* history :
*/
package repos
import (
"database/sql"
"encoding/json"
"fmt"
"github.com/jsix/gof/db"
"github.com/jsix/gof/db/orm"
"github.com/jsix/gof/storage"
"go2o/core/domain/interface/merchant"
"go... |
package p2p
import (
"bytes"
"context"
"fmt"
"strings"
"sync"
"github.com/QuarkChain/go-minimal-pbft/consensus"
"github.com/ethereum/go-ethereum/log"
ethp2p "github.com/ethereum/go-ethereum/p2p"
"github.com/ethereum/go-ethereum/p2p/enode"
"github.com/ethereum/go-ethereum/p2p/nat"
"github.com/libp2p/go-libp... |
package gitea
import (
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"net/http"
)
// Server Path
const (
ServerPath = "/gitea/webhooks"
)
// parse errors
var (
ErrEventNotSpecifiedToParse = errors.New("no Event specified to parse")
ErrInvalidHTTPMethod ... |
package keeper
import (
"fmt"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/params"
core "github.com/terra-project/core/types"
"github.com/tendermint/tendermint/libs/log"
"github.com/terra-project/core/x/treasury/internal/types"
)
// Keeper of... |
// Diode Network Client
// Copyright 2019 IoT Blockchain Technology Corporation LLC (IBTC)
// Licensed under the Diode License, Version 1.0
package edge
import (
"bytes"
"fmt"
"math/big"
"reflect"
"github.com/diodechain/diode_go_client/util"
bert "github.com/diodechain/gobert"
)
var (
errWrongTree = fmt.Err... |
package aws
import (
"encoding/json"
"io/ioutil"
"net/http"
"github.com/supergiant/analyze-plugin-sunsetting/pkg/cloudprovider"
"github.com/aws/aws-sdk-go-v2/aws/ec2metadata"
"github.com/sirupsen/logrus"
"github.com/aws/aws-sdk-go-v2/aws/external"
"github.com/aws/aws-sdk-go-v2/service/ec2"
"github.com/pkg/... |
// Copyright 2017 Google 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... |
// Copyright 2011 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.
// On App Engine, the framework sets up main; we should be a different package.
package moustachio
import (
"bytes"
"crypto/sha1"
"fmt"
"html/template"
"i... |
package boot
import (
"fmt"
"log"
"sort"
"strconv"
"sync"
"sync/atomic"
)
type RestartPolicy int
const (
POLICY_QUIT RestartPolicy = 0
POLICY_RESTART RestartPolicy = 1
POLICY_RESTART_NEXT RestartPolicy = 2
)
type Service interface {
BootStart(id Id, appCfg interface{}, bootErrCh chan<- Err)
... |
package main
import (
"context"
"fmt"
"math"
"sync"
"time"
"github.com/mum4k/termdash/cell"
"github.com/mum4k/termdash/container"
"github.com/mum4k/termdash/container/grid"
"github.com/mum4k/termdash/linestyle"
"github.com/mum4k/termdash/widgets/linechart"
"github.com/mum4k/termdash/widgets/text"
)
// red... |
package k8s
import (
"context"
"fmt"
"github.com/go-logr/logr"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"
)
// StatefulSet the StatefulSet client tha... |
package parquet
import (
"fmt"
"io"
"sync"
"github.com/xitongsys/guery/config"
"github.com/xitongsys/guery/filesystem"
"github.com/xitongsys/guery/metadata"
"github.com/xitongsys/guery/row"
. "github.com/xitongsys/parquet-go/ParquetFile"
. "github.com/xitongsys/parquet-go/ParquetReader"
"github.com/xitongsy... |
package video
import (
"encoding/json"
"errors"
"fmt"
"golang.org/x/net/html"
"io"
"io/ioutil"
"net/url"
"regexp"
"sort"
"strings"
"github.com/grafov/m3u8"
"github.com/mmktomato/go-twmedia/svc/extcmd"
"github.com/mmktomato/go-twmedia/util"
"github.com/mmktomato/go-twmedia/util/domutil"
)
var authRegex ... |
package genetlink
import (
"syscall"
"github.com/mdlayher/netlink"
"golang.org/x/net/bpf"
)
// Protocol is the netlink protocol constant used to specify generic netlink.
const Protocol = 0x10 // unix.NETLINK_GENERIC
// A Conn is a generic netlink connection. A Conn can be used to send and
// receive generic net... |
package sdk
import (
"fmt"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
"github.com/okta/okta-sdk-golang/okta"
)
type (
IdentityProvider interface {
IsIDP() bool
}
SAMLIdentityProvider struct {
ID string `json:"id,omitempty"`
IssuerMode string `json:"issuerMode,omitemp... |
package kubehunter
import (
"context"
"fmt"
"github.com/aquasecurity/starboard/pkg/apis/aquasecurity/v1alpha1"
"github.com/aquasecurity/starboard/pkg/ext"
"github.com/aquasecurity/starboard/pkg/kube"
"github.com/aquasecurity/starboard/pkg/runner"
"github.com/aquasecurity/starboard/pkg/starboard"
"github.com/h... |
package main
import "math"
const EARTH_RADIUS float64 = 6370.856 //km 地球半径 平均值,千米
//地球半径
const EARTH_R float64 = 6378245.0
func HaverSin(theta float64) float64 {
v := math.Sin(theta / 2)
return v * v
}
func Distance(lat1, lon1, lat2, lon2 float64) float64 {
//用haversine公式计算球面两点间的距离。
//经纬度转换成弧度
lat1 = ConvertDe... |
// Copyright 2022 MongoDB 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... |
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package azurestack
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Linked Subscription information.
// ... |
/*
Copyright 2016 The Kubernetes 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 applicable law or ag... |
package sheep
import (
"time"
"github.com/lindsaygelle/nook"
"github.com/lindsaygelle/nook/animal"
"github.com/lindsaygelle/nook/character"
"github.com/lindsaygelle/nook/gender"
"github.com/lindsaygelle/nook/personality"
"golang.org/x/text/language"
)
var (
willowBirthday = nook.Birthday{
Day: 26,
Mont... |
package storage
import (
"bytes"
"context"
"encoding/json"
"fmt"
"log"
"net/http"
"time"
gcs "cloud.google.com/go/storage"
"github.com/googleapis/google-cloud-go-testing/storage/stiface"
"google.golang.org/api/googleapi"
"github.com/m-lab/etl/etl"
"github.com/m-lab/etl/factory"
"github.com/m-lab/etl/met... |
/*
SPDX-License-Identifier: Apache-2.0
Copyright Contributors to the Submariner project.
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 requ... |
// Copyright 2018 The Kubeflow 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 agr... |
package oci
import (
"context"
"strconv"
"strings"
"time"
archiveexporter "github.com/containerd/containerd/images/archive"
"github.com/containerd/containerd/leases"
"github.com/docker/distribution/reference"
"github.com/moby/buildkit/cache/blobs"
"github.com/moby/buildkit/exporter"
"github.com/moby/buildki... |
package opeth
import (
"math/rand"
"io/ioutil"
"strings"
"github.com/Krognol/dgofw"
)
type Opeth struct {
lines []string
g *Generator
}
func NewOpethPlugin() *Opeth {
b, err := ioutil.ReadFile("./opeth_record.txt")
if err != nil {
return nil
}
plugin := &Opeth{lines: strings.Split(string(b), "\n"),... |
// Package cdpgen generates the source code of the Go bindings for all the
// commands, events and types in the Chrome DevTools Protocol (CDP) - from the
// latest Chromium "tip-of-tree" (tot) definitions (see the details and API
// documentation in https://chromedevtools.github.io/devtools-protocol/tot,
// mirrored in... |
/*
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 wri... |
// Copyright 2016 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License included
// in the file licenses/BSL.txt and at www.mariadb.com/bsl11.
//
// Change Date: 2022-10-01
//
// On the date above, in accordance with the Business Source License, use
// of this software will be gov... |
// Copyright 2020 The PipeCD Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
package main
// Copyright 2009 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.
// taken from http://golang.org/src/pkg/net/ipraw_test.go
import (
"bytes"
"errors"
"net"
"os"
"time"
)
const (
icmpv4EchoRequest = 8
ic... |
//go:build windows
// +build windows
package winapi
import (
"fmt"
"os"
"reflect"
"sort"
"strings"
"syscall"
"time"
"unsafe"
so "github.com/gueencode/go-win64api/shared"
)
var (
modSecur32 = syscall.NewLazyDLL("secur32.dll")
sessLsaFreeReturnBuffer = modSecur32.NewProc("LsaFreeRe... |
// 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 a... |
/*
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, ... |
// Copyright 2019 Tetrate
//
// 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 writ... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package rdsdata
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"
)
// The request parameters represent the input of a request to run one or mo... |
// Copyright 2014 DoAT. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the follo... |
package rocky
import (
"encoding/json"
"fmt"
"io"
"log"
"path/filepath"
"strings"
bolt "go.etcd.io/bbolt"
"golang.org/x/xerrors"
"github.com/aquasecurity/trivy-db/pkg/db"
"github.com/aquasecurity/trivy-db/pkg/types"
"github.com/aquasecurity/trivy-db/pkg/utils"
ustrings "github.com/aquasecurity/trivy-db/p... |
package remote
import (
"errors"
"google.golang.org/protobuf/proto"
"io"
"github.com/asynkron/protoactor-go/actor"
"github.com/asynkron/protoactor-go/log"
"golang.org/x/net/context"
)
type endpointReader struct {
suspended bool
remote *Remote
}
func (s *endpointReader) mustEmbedUnimplementedRemotingServe... |
package kubernetessecrets
import (
"context"
"fmt"
"regexp"
"strings"
"reflect"
errs "errors"
"github.com/1Password/connect-sdk-go/onepassword"
"github.com/1Password/onepassword-operator/pkg/utils"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta... |
package querier
import (
"context"
"fmt"
"github.com/jackc/pgconn"
"github.com/jackc/pgerrcode"
"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/promql/parser"
"github.com/prometheus/prometheus/storage"
"github.com/timescale/promscale/pkg/pgmodel/common/errors"
"github.com/ti... |
/*
Copyright The containerd 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... |
/*
Copyright 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, softw... |
/*
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 (c) 2015 Uber Technologies, Inc.
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, ... |
package clock
import (
"sync"
"sync/atomic"
"time"
)
const (
TimeFormat = "2006-01-02 15:04:05"
DateFormat = "2006-01-02"
UnixTimeUnitOffset = uint64(time.Millisecond / time.Nanosecond)
)
var (
_ Clock = &RealClock{}
_ Clock = &MockClock{}
_ Ticker = &RealTicker{}
_ Ticker = &MockTicker{}
... |
/*
Copyright 2016 The Kubernetes 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 applicable law or ag... |
// Copyright 2019 The Operator-SDK Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ... |
package http
import (
"errors"
"fmt"
"github.com/spiral/roadrunner"
"github.com/spiral/roadrunner/service"
"net"
"os"
"strings"
)
// Config configures RoadRunner HTTP server.
type Config struct {
// Port and port to handle as http server.
Address string
// SSL defines https server options.
SSL SSLConfig
... |
package proxy
import (
"bytes"
"context"
"crypto/x509"
"fmt"
"io/ioutil"
"net"
"net/http"
"net/http/httptest"
"os"
"testing"
"github.com/fabiolb/fabio/config"
"github.com/fabiolb/fabio/proxy/tcp"
"github.com/fabiolb/fabio/proxy/tcp/tcptest"
"github.com/fabiolb/fabio/route"
)
// to run this test, add th... |
/*******************************************************************************
* Copyright 2019 Dell 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/licen... |
// Copyright (c) 2021 Terminus, 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 agree... |
// Simple Moving Average (Sma)
package indicators
import (
"container/list"
"errors"
"github.com/thetruetrade/gotrade"
)
// A Simple Moving Average Indicator (Sma), no storage, for use in other indicators
type SmaWithoutStorage struct {
*baseIndicatorWithFloatBounds
// private variables
periodTotal float64
... |
// Copyright (C) 2019-2020 Zilliz. 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 l... |
// Copyright 2017 The nvim-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 command
import (
"bytes"
"context"
"fmt"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"strings"
"github.com/neovim/go-client/nvim"
"githu... |
// Copyright 2019 Yunion
//
// 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 writi... |
/*
Copyright 2013 The Camlistore 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 2013 <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, softw... |
package manager
import (
"fmt"
"os"
"sync"
"github.com/cilium/ebpf"
)
// MapCleanupType - The map clean up type defines how the maps of a manager should be cleaned up on exit.
//
// We call "external" a map that wasn't loaded by the current manager. Those maps can end up being used by the
// current manager thro... |
package trigger
import (
"context"
"sync"
"time"
"github.com/rancher/wrangler/pkg/objectset"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/dynamic"
... |
// 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... |
// Copyright 2017 Istio 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 i... |
/*
* Copyright 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the Licen... |
package topology
import (
"fmt"
"sync"
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
"github.com/chrislusf/seaweedfs/weed/storage/erasure_coding"
"github.com/chrislusf/seaweedfs/weed/storage/needle"
"strconv"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/storage"
)
ty... |
// Package router contains the URL router for the HTTP API.
package router
import (
"github.com/gorilla/mux"
"github.com/sourcegraph/sourcegraph/pkg/routevar"
)
const (
GraphQL = "graphql"
XLang = "xlang"
Registry = "registry"
RepoShield = "repo.shield"
RepoRefresh = "repo.refresh"
Telemetry = "telemet... |
/*
* Copyright (c) 2018 - present. Boling Consulting Solutions (bcsw.net)
*
* 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 require... |
/*
Package lmdb provides bindings to the lmdb C API. The package bindings are
fairly low level and are designed to provide a minimal interface that prevents
misuse to a reasonable extent. When in doubt refer to the C documentation as a
reference.
http://www.lmdb.tech/doc/
http://www.lmdb.tech/doc/starting.html
ht... |
//
// Copyright (C) 2019-2021 vdaas.org vald team <<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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by a... |
package main
import (
"crypto/sha1"
"github.com/xtaci/smux"
go_tuntap "github.com/yzslab/go-tuntap"
"github.com/yzslab/kcp-go"
"golang.org/x/crypto/pbkdf2"
"io"
"log"
"net"
"time"
"unsafe"
)
type VNIConfig struct {
Mode go_tuntap.VirtualNetworkInterfaceMode
Name string
MTU go_tun... |
package gophonenumbers
import (
"fmt"
"io"
"os"
"path"
"strconv"
"github.com/grokify/mogo/encoding/csvutil"
"github.com/grokify/mogo/sort/sortutil"
geo "github.com/kellydunn/golang-geo"
)
const (
A2gCsvRelPath = "github.com/grokify/mogo/strconv/phonenumber/us-area-code-geo.csv"
)
type AreaCodeInfo struct {... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.