text
stringlengths
3.08k
10.4k
package persistence import ( "crypto/aes" "crypto/cipher" "crypto/rand" "encoding/base64" "errors" "fmt" "io" "testing" "time" "github.com/oauth2-proxy/oauth2-proxy/v7/pkg/apis/options" "github.com/oauth2-proxy/oauth2-proxy/v7/pkg/apis/sessions" . "github.com/onsi/ginkgo" . "github.com/onsi/ginkgo/extens...
// Copyright Nitric Pty Ltd. // // SPDX-License-Identifier: Apache-2.0 // // 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 r...
package main import ( "flag" "fmt" "os" "strconv" "strings" "time" "github.com/BurntSushi/toml" "github.com/vwdsrc/wrench" "github.com/vwdsrc/wrench/config" "github.com/vwdsrc/wrench/connector" ) func checkErr(e error) { if e != nil { panic(e) } } func getConnectorFactory(o *config.Options) wrench.Co...
package mr import "fmt" import "log" import "net/rpc" import "hash/fnv" import "encoding/json" import "io/ioutil" import "strconv" import "os" import "errors" import "time" import "sort" type KeyValue struct { Key string Value string } type ByKey []KeyValue func (a ByKey) Len() int { return len(a) } func (a...
package websocketserver import ( "golang.org/x/net/websocket" "log" "net/http" "time" "fmt" "os" "bufio" "io" ) //数据库配置信息 var( hostdbinfo = "%s:%s@tcp(%s:%s)/%s?charset=%s" //数据库地址 // 用户名 密码 IP地址 端口 数据库名称 数据库编码方式 ) //log文件信息 var( log_name = "websocketserver.log" normal_log *log.Logger warning_log *log...
package keys import ( "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" cmn "github.com/tendermint/tmlibs/common" ) func TestLengthCalc(t *testing.T) { assert := assert.New(t) cases := []struct { bytes, words int flexible bool }{ {1, 1, false}, {2, 2, false}, ...
package connection import ( "bytes" "crypto/tls" "encoding/json" "errors" "fmt" "io" "net" "reflect" "github.com/netsec-ethz/rains/internal/pkg/cbor" "github.com/netsec-ethz/rains/internal/pkg/connection/scion" "github.com/netsec-ethz/rains/internal/pkg/message" "github.com/netsec-ethz/rains/internal/pkg/...
package jwt import ( "crypto/rsa" "errors" gojwt "github.com/dgrijalva/jwt-go" "github.com/gorilla/sessions" "github.com/gorilla/securecookie" "io/ioutil" "net/http" "time" ) type JwtConf struct { privateKeyFile string publicKeyFile string privateKey *rsa.Privat...
package ui import ( "fmt" "os" "github.com/gdamore/tcell" "github.com/mattn/go-runewidth" "github.com/TemirkhanN/rpg/internal/game/data" ) type Drawer interface { Icon() rune Style() tcell.Style Position() data.Position } type Pos struct { x int y int } func NewPosition(x int, y int) Pos { return Pos{ ...
package reflect_ import ( "fmt" "reflect" "testing" ) type Student struct { Name string Age int } func TestReflect1(t *testing.T) { // 1. 先定义一个 int var num int = 100 // 通过反射获取传入的变量的 type // 1. 先获取到 reflect.Type rType := reflect.TypeOf(num) fmt.Printf("rType=(%T)%v\n", rType, rType) // rType=(*reflect.rt...
package osu import ( "github.com/go-gl/mathgl/mgl32" "github.com/wieku/danser-go/beatmap/objects" "github.com/wieku/danser-go/render/batches" "math" ) const FrameTime = 1000.0 / 60 type spinnerstate struct { lastAngle float64 requirement int64 rotationCount int64 lastRotationCount ...
package config import ( "encoding/binary" "fmt" "io" "log" "math" "sort" "golang.org/x/crypto/sha3" ) // just some random bytes. picking a seed in advance to repeat // experiments deterministically var seed = []byte{ 196, 90, 111, 1, 181, 197, 66, 167, 74, 39, 198, 144, 4, 179, 62, 115, 192, 144, 122, 196, ...
// Copyright 2021 Canonical Ltd. // Licensed under the AGPLv3, see LICENCE file for details. package network import ( "io/ioutil" "net" "path/filepath" "strings" "github.com/juju/collections/set" ) // SysClassNetPath is the full Linux SYSFS path containing // information about each network interface on the sys...
// Copyright 2015 <NAME> <<EMAIL>>. All rights reserved. // license that can be found in the LICENSE file. // This file is part of the application source code leveldb-cli // This software provides a console interface to leveldb. package cliutil import ( "encoding/base64" "encoding/binary" "fmt" "math" "github....
// Package size provides functionality for handling bytes and the conversion // between various representations such as kilobytes and mebibytes and all the // other alternatives. package size import "fmt" // Size represents a number of bytes as an int64. The largest size that can be // representated is math.Int64Max ...
package wolf 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 ( chiefBirthday = nook.Birthday{ Day: 19, Month:...
// Copyright 2015 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 cloudtail import ( "time" "github.com/luci/luci-go/common/clock" "github.com/luci/luci-go/common/logging" "golang.org/x/net/context" ) // D...
/* Copyright © 2020 <NAME> <<EMAIL>> 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, publish, distribute, ...
package calcium import ( "bytes" "context" "sync" enginetypes "github.com/projecteru2/core/engine/types" "github.com/projecteru2/core/lock" "github.com/projecteru2/core/types" "github.com/projecteru2/core/utils" log "github.com/sirupsen/logrus" ) // ReplaceContainer replace containers with same resource func...
// This Source Code Form is subject to the terms of the MIT License. // If a copy of the MIT License was not distributed with this // file, you can obtain one at https://opensource.org/licenses/MIT. // // Copyright (c) DUSK NETWORK. All rights reserved. package wallet import ( "bytes" "crypto/rand" "encoding/json"...
// 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 miniweb import ( "fmt" "net/http" "os" "path" "path/filepath" "strings" "github.com/armon/go-socks5" toml "github.com/pelletier/go-toml" ) type handlerConfig struct { Name string // name of handler to use (from global map of handler types) Options map[string]interface...
// Copyright (c) 2021 by library 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 sedlockctl import ( "flag" "fmt" "log" "os" "github.com/bluecmd/go-tcg-storage/pkg/drive" "github.com/bluecmd/go-tcg-storage/pkg/locking...
package main import ( "flag" "log" "os" "time" "bottle/debug" "bottle/shutil" ) // TODO: Better panic error output (maybe defer shutil.RescueExit()?) func init() { // TODO: Add as a "main" command-line flag? (possibly secret...) debug.ShouldTimeFunctions = false } func main() { defer debug.TimedFunction(t...
/* * 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 under...
package servers import ( "strings" "github.com/agnivade/levenshtein" "github.com/jxsl13/TeeworldsEconVPNDetectionGo/config" "golang.org/x/text/unicode/norm" ) type HttpMasterServerList struct { Servers []Server `json:"servers"` } func (h *HttpMasterServerList) ServerIPs() []string { m := make(map[string]bool,...
// Package api implements GraphQL API for any number of locally running // macrocosms. package api import ( "encoding/json" "fmt" "path/filepath" "time" "github.com/boltdb/bolt" "github.com/gin-gonic/gin" "github.com/dowlandaiello/eve/common" "github.com/dowlandaiello/eve/macrocosm" ) // rootAPIPath is the ...
package traversal import ( . "github.com/tfbrother/Data-Structures-and-Algorithms/data-structures/graph" ) // BFS does breadth-first search, and returns the list of vertices. // (https://en.wikipedia.org/wiki/Breadth-first_search) // Breadth first traversal is accomplished by enqueueing each level of a tree sequenti...
// Copyright 2021 xgfone // // 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...
package db import ( "errors" "math" "sort" "time" "github.com/jinzhu/gorm" ) func GetOngoingEntry(projectID uint) (bool, *ProjectEntry, error) { hasEntries := ProjectHasEntries(projectID) if !hasEntries { return false, nil, nil } noOngoingEntry := DB.Where("project_id = ? AND close_time IS NULL", projectI...
package main import ( "fmt" "net/url" "regexp" "strconv" "time" "github.com/joho/godotenv" apiresource "github.com/pingcap/test-infra/common/model/resource" "github.com/pingcap/test-infra/sdk/core" "github.com/pingcap/test-infra/sdk/resource" "go.uber.org/zap" _ "github.com/pingcap/test-infra/sdk/resource...
package multitenantoperator import ( "context" "net" "strings" "github.com/Azure/azure-container-networking/cns" "github.com/Azure/azure-container-networking/cns/cnsclient" "github.com/Azure/azure-container-networking/cns/logger" ncapi "github.com/Azure/azure-container-networking/crds/multitenantnetworkcontain...
package main import ( "fmt" "strings" "sync" "github.com/gorilla/websocket" "github.com/pavel/PSR/pkg/domain" "github.com/pavel/PSR/pkg/room" "github.com/pavel/PSR/pkg/subscribe" winner_definer "github.com/pavel/PSR/pkg/winner-definer" "github.com/rs/zerolog/log" ) type WebRoom struct { name ...
package main import ( "flag" "fmt" "io/ioutil" "log" "os" "path/filepath" "sync" "github.com/mb0/glob" "github.com/tonyvugithub/GoURLsCheckerCLI/helpers" "github.com/tonyvugithub/GoURLsCheckerCLI/models" "github.com/tonyvugithub/GoURLsCheckerCLI/outputs" ) var ( summary models.CheckSummary wg s...
// Copyright 2016, <NAME>. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE.md file. // +build cgo // Package flate implements the DEFLATE compressed data format, // described in RFC 1951, using C wrappers. package flate /* #cgo LDFLAGS: -lz #inc...
package jira import ( "bufio" "errors" "fmt" "os" "strconv" "strings" jira "gopkg.in/andygrunwald/go-jira.v1" ) // GetScrumBoardID gets the jira ID of the given board name or if empty, interactively lets you choose func (c *Client) GetScrumBoardID(board string, interact bool) (int, error) { r,...
package modules import ( "context" "crypto/rand" "errors" "io" "io/ioutil" "os" "time" "github.com/gbrlsnchs/jwt/v3" logging "github.com/ipfs/go-log/v2" "github.com/libp2p/go-libp2p-core/peer" "github.com/libp2p/go-libp2p-core/peerstore" record "github.com/libp2p/go-libp2p-record" "go.uber.org/fx" "gola...
// SPDX-FileCopyrightText: 2020-present Open Networking Foundation <<EMAIL>> // // SPDX-License-Identifier: Apache-2.0 package subscription import ( "context" "fmt" "time" subapi "github.com/onosproject/onos-api/go/onos/e2sub/subscription" taskapi "github.com/onosproject/onos-api/go/onos/e2sub/task" "github.co...
// SPDX-License-Identifier: Apache-2.0 package tee import ( "bytes" "encoding/gob" "encoding/hex" "encoding/json" "errors" "fmt" "math/big" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/core/types" "github.com/ethereum/go-ethereum/rlp" "github.com/perun-network/erdstall/contra...
// Package axt provides the struct and functions that operate on alignments in Axt format. package axt import ( "fmt" "github.com/vertgenlab/gonomics/common" "github.com/vertgenlab/gonomics/dna" "github.com/vertgenlab/gonomics/exception" "github.com/vertgenlab/gonomics/fileio" "io" "log" "strings" ) // Axt st...
package client import ( "context" "fmt" "io/ioutil" "math/rand" "net" "net/http" "os" "path/filepath" "strings" "sync" "time" "github.com/andybrewer/mack" "github.com/gorilla/websocket" "google.golang.org/protobuf/proto" "marwan.io/iterm2/api" ) // New returns a new websocket connection // that talks ...
// 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. package packet import ( "crypto/cipher" "crypto/openpgp/error" "crypto/sha1" "crypto/subtle" "hash" "io" "os" "strconv" ) // SymmetricallyEncrypted re...
package parser import ( "fmt" "go/ast" "go/parser" "go/token" "io/ioutil" ) func ParseFile(path string) (*GoFile, error) { source, err := ioutil.ReadFile(path) if err != nil { return nil, err } file, err := parser.ParseFile(token.NewFileSet(), path, nil, 0) if err != nil { return nil, err } goFile :...
// Copyright 2018 <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 slip implements a codec for the Serial Line Internet Protocol (SLIP). See https://en.wikipedia.org/wiki/Serial_Line_Internet_Protocol. */ package slip impo...
package mqbridge import ( "context" "errors" "os" "strings" "sync" "github.com/LeKovr/mqbridge/types" "github.com/go-logr/logr" ) // ----------------------------------------------------------------------------- // Config holds all package config vars type Config struct { BridgeDelimiter string `long:"deli...
// Copyright 2017 luoji // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // Unless required by applicable law or agreed to in writing, soft...
// // Copyright © 2020 Uncharted Software 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 ap...
package main import ( "context" "fmt" "time" "github.com/go-openapi/strfmt" "github.com/urfave/cli" "github.com/manifoldco/go-manifold" "github.com/manifoldco/go-manifold/idtype" "github.com/manifoldco/manifold-cli/api" "github.com/manifoldco/manifold-cli/clients" catalogcache "github.com/manifoldco/manifo...
package mcworld import ( "compress/zlib" "encoding/binary" "errors" "fmt" "io" "os" "path/filepath" "strconv" "strings" ) var ( ChunkNotFoundError = errors.New("Chunk Missing") ) type BetaWorld struct { worldDir string } type McrFile struct { *os.File } func (w *BetaWorld) OpenChunk(x, z int) (io.ReadC...
package healthcheck import ( "net/http" "strconv" "sync" "time" "github.com/cloudnativelabs/kube-router/pkg/options" "github.com/golang/glog" "golang.org/x/net/context" ) //ControllerHeartbeat is the structure to hold the heartbeats sent by controllers type ControllerHeartbeat struct { Component string ...
package main import ( "flag" "log" "strings" "time" ) // command line arguments var flagVars struct { configFilename string inputFilename string referenceFilename string outputFilename string country string month int year int now bool verbose ...
/* Copyright (c) 2019 VMware, Inc. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package api import ( "context" "fmt" "net/http" "path" "strconv" "strings" "time" "github.com/gorilla/mux" "k8s.io/apimachinery/pkg/labels" "github.com/vmware/octant/internal/cluster" "github.com/vmware/octant/...
package ingester import ( "context" "github.com/airdeploy/flagger-go/v3/core" "github.com/airdeploy/flagger-go/v3/json" "github.com/airdeploy/flagger-go/v3/log" "github.com/google/uuid" "sync" "time" ) func newGroupStrategy(sdkInfo *core.SDKInfo, httpRequest httpRequestType, firstExposuresIngestThreshold int) ...
// Copyright (c) arkade author(s) 2020. All rights reserved. // Licensed under the MIT license. See LICENSE file in the project root for full license information. package apps import ( "fmt" "strconv" "strings" "github.com/alexellis/arkade/pkg/apps" "github.com/alexellis/arkade/pkg/config" "github.com/alexelli...
package v1 import ( v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "knative.dev/pkg/apis" duckv1 "knative.dev/pkg/apis/duck/v1" ) type DeploymentStatus struct { Name string `json:"name,omitempty" protobuf:"string,1,opt,name=name"` Status string `json:"status,omitem...
package main import ( "flag" "github.com/knq/snaker" "github.com/reddec/liana" "github.com/reddec/liana/types" "gopkg.in/yaml.v2" "io/ioutil" "log" "net/http" "path/filepath" "strings" ) var ( inPackageImport = flag.String("import", "", "Import path (default is no import)") imports = flag.St...
package main import ( "crypto" "crypto/rsa" "fmt" "github.com/binhgo/go-sdk/sdk" "github.com/binhgo/message/action" "github.com/binhgo/message/api" "github.com/binhgo/message/cip" "github.com/binhgo/message/model" ) func TEST() { // test_firebase_send_msg() // test01() // testEncrypt3() // testEncrypt2(...
package pt import ( "math" "math/rand" ) type Vector struct { X, Y, Z float64 } func V(x, y, z float64) Vector { return Vector{x, y, z} } func RandomUnitVector(rnd *rand.Rand) Vector { for { var x, y, z float64 if rnd == nil { x = rand.Float64()*2 - 1 y = rand.Float64()*2 - 1 z = rand.Float64()*2 ...
package server import ( "context" "errors" "fmt" "net" "net/http" "os" "os/signal" "sync/atomic" "syscall" "time" "github.com/arttet/rock-paper-scissors-lizard-spock/internal/app/game-service/api" "github.com/arttet/rock-paper-scissors-lizard-spock/internal/app/game-service/service/random" "github.com/ar...
package login import ( _ "embed" "fmt" "log" "github.com/chanbakjsd/gotrix" "github.com/chanbakjsd/gotrix/api" "github.com/chanbakjsd/gotrix/matrix" "github.com/gotk3/gotk3/glib" "github.com/gotk3/gotk3/gtk" ) //go:embed login.xml var loginXML string type Login struct { Done func(*gotrix.Client) builder ...
// Copyright 2014-2017 Spectra Logic 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. A copy of the License is located at // // http://www.apache.org/licenses/LICENSE-2.0 // // or in the "license" fil...
// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved. // This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei...
/* Copyright 2020 The KubeCarrier 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,...
// *** 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 apimanagement import ( "context" "reflect" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // Use this data source to access information...
// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: subscribe_info.proto package notify import ( fmt "fmt" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fm...
/* * This file is subject to the terms and conditions defined in * file 'LICENSE.md', which is part of this source code package. */ package model import ( "bytes" "fmt" "io" "github.com/pzduniak/unipdf/common" "github.com/pzduniak/unipdf/core" ) // Hasher is the interface that wraps the basic Write method. ...
package custommetrics import ( "context" "fmt" "log" "math/rand" "net/http" "os" "sync" "time" meta "cloud.google.com/go/compute/metadata" monitoring "cloud.google.com/go/monitoring/apiv3" googlepb "github.com/golang/protobuf/ptypes/timestamp" metricpb "google.golang.org/genproto/googleapis/api/metric" m...
package main import ( "bufio" "context" "flag" "fmt" "io" "log" "os" "strings" "time" "github.com/mattn/go-isatty" "github.com/wsxiaoys/terminal/color" "google.golang.org/grpc" "github.com/keftcha/chaton/grpc/chaton" ) func join(c chaton.ChatonClient) { ctx, cancel := context.WithCancel(context.Backgr...
package database import ( "encoding/csv" "fmt" "io" "time" "github.com/Suburbia-io/dashboard/pkg/helpers/qb" "github.com/Suburbia-io/dashboard/pkg/errors" "github.com/Suburbia-io/dashboard/pkg/helpers/crypto" "github.com/Suburbia-io/dashboard/pkg/helpers/validators" ) type BrandCategory struct { CategoryID...
package Handlers import ( "encoding/json" "errors" "fmt" "gourlshortener/src/Database" "gourlshortener/src/Models" "gourlshortener/src/Models/DTOs" "gourlshortener/src/Utilities" "net/http" "reflect" "runtime/debug" "strings" "github.com/jackc/pgx/v4/pgxpool" "github.com/labstack/echo/v4" log "github.co...
package frog 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 ( frobertBirthday = nook.Birthday{ Day: 8, Month...
package main import ( "fmt" "os" "io" "log" "encoding/binary" "time" "hash/crc32" "compress/gzip" "errors" "github.com/goossaert/compression/gzip/deflate" ) // Gzip constants const ( FlagAscii = 1 HeaderCrc16Present = 2 ExtraFieldPresent = 4 OriginalFileNamePres...
// Code generated from Mql.g4 by ANTLR 4.7.1. DO NOT EDIT. package parser // Mql import "github.com/antlr/antlr4/runtime/Go/antlr" // BaseMqlListener is a complete listener for a parse tree produced by MqlParser. type BaseMqlListener struct{} var _ MqlListener = &BaseMqlListener{} // VisitTerminal is called when a...
package cmd import ( "bytes" "context" "encoding/hex" "encoding/json" "fmt" "github.com/filecoin-project/go-address" "github.com/filecoin-project/go-state-types/abi" "github.com/ipfs/go-cid" cmds "github.com/ipfs/go-ipfs-cmds" "github.com/pkg/errors" cbg "github.com/whyrusleeping/cbor-gen" "reflect" "git...
package internal import ( "fmt" "reflect" "sync" "github.com/kataras/iris/v12/context" ) // newServicePool create a ServiceElementPool func newServicePool() *servicePool { result := new(servicePool) result.pool = make(map[reflect.Type]*sync.Pool) return result } // servicePool is domain service pool,a domain...
// *** 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 organizations import ( "context" "reflect" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // Use this data source to get information ab...
package javascript import ( "errors" "fmt" "strings" "github.com/webrpc/webrpc/gen" "github.com/webrpc/webrpc/schema" ) var fieldTypeMap = map[schema.DataType]string{ schema.T_Uint: "number", schema.T_Uint8: "number", schema.T_Uint16: "number", schema.T_Uint32: "number", schema.T_Uint64: ...
package dht import ( "encoding/hex" "github.com/spacemeshos/go-spacemesh/assert" "math/big" "testing" ) func TestIds(t *testing.T) { id1 := NewIDFromBase58String("28Ru2rajv7ZQZ63mHLAcGrZgtG2kEAhKYP53Fp6fFs3At") s := id1.Pretty() assert.True(t, len(s) > 0, "expected dht id") _, err := NewIDFromHexString("xxxx...
package igdl import ( "fmt" "time" "github.com/fatih/color" "github.com/siongui/instago" ) var cc = color.New(color.FgCyan) var rc = color.New(color.FgRed) func CyanPrint(a ...interface{}) { cc.Print(a...) } func RedPrint(a ...interface{}) { rc.Print(a...) } func CyanPrintln(a ...interface{}) { cc.Println(...
/* * This file is part of the KubeVirt 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 required by applicable la...
package utils import ( "fmt" "log" "os" "os/exec" "path/filepath" "testing" "time" "github.com/anatol/vmtest" "golang.org/x/crypto/ssh" ) func StartOVMF(conf TestConfig) *vmtest.Qemu { params := []string{ "-machine", "type=q35,smm=on,accel=kvm", "-boot", "order=c,menu=on,strict=on", "-net", "none", ...
package main import ( "fmt" "strings" "unsafe" "github.com/cppis/elio" ) // EventOpen event open type EventOpen struct { session *elio.Session host *elio.IoHost } // String string func (e *EventOpen) String() string { return fmt.Sprintf("EventOpen::%p", e) } // Handle handle func (e *EventOpen) Handle() ...
// +build windows package cpu import ( "context" "fmt" "unsafe" "github.com/StackExchange/wmi" "github.com/shirou/gopsutil/internal/common" "golang.org/x/sys/windows" ) type Win32_Processor struct { LoadPercentage *uint16 Family uint16 Manufacturer string Name ...
package canary import ( "context" "fmt" "strings" "sync" "time" "github.com/opentracing/opentracing-go" "github.com/traefik/traefik/v2/pkg/config/dynamic" "github.com/traefik/traefik/v2/pkg/log" ) var storesMu sync.Mutex var stores = make(map[string]*Store) // LabelStore ... type LabelStore struct { s ...
// Copyright 2018 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 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 agreed...
package btcc // Response is the generalized response type type Response struct { Ticker Ticker `json:"ticker"` BtcCny Ticker `json:"ticker_btccny"` LtcCny Ticker `json:"ticker_ltccny"` LtcBtc Ticker `json:"ticker_ltcbtc"` } // Ticker holds basic ticker information type Ticker struct { High float64 `json:"hi...
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package medialive 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" ) type CreateMultiplexInput struct { _ struct{} `type:"structure"` // Av...
package sas import ( "math" "sort" "magma/dp/cloud/go/active_mode_controller/internal/ranges" "magma/dp/cloud/go/active_mode_controller/protos/active_mode" ) type grantRequestGenerator struct { rng RNG } type RNG interface { Int() int } func NewGrantRequestGenerator(rng RNG) *grantRequestGenerator { return ...
// SPDX-License-Identifier: Apache-2.0 // Copyright 2018-2019 Authors of Cilium package ipcache import ( "context" "fmt" "net" "strings" "github.com/sirupsen/logrus" "github.com/cilium/cilium/pkg/identity" "github.com/cilium/cilium/pkg/identity/cache" "github.com/cilium/cilium/pkg/ip" "github.com/cilium/ci...
/******************************************************************************* * Copyright 2022 Intel Corp. * * 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/lic...
// Copyright 2016-2017 Amazon.com, Inc. or its affiliates. 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. A copy of the // License is located at // // http://aws.amazon.com/apache2.0/ // // or in the "lic...
package main import ( "html/template" "net/http" "time" "fmt" "strconv" "os" init2 "github.com/btasdoven/quickfixwebclient/broker/initiator" mux "github.com/gorilla/mux" "github.com/quickfixgo/quickfix/enum" ) var initiator init2.Initiator var orders []*Order type Order struct {...
package shake // Head is presnet the head of case of SHAKE type Head struct { Title string // ID string // IDNT string // IDMP string // IBlank string } const ( // PIW = 2Pi PIW = 6.28318530717958623199592693708837032318115234375 ) var ( // FORMAT stores standard output message format FORMAT = map[int...
/* Copyright IBM Corp. 2016, 2017 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 ...
// Package containerd implements the runtime interface for the ContainerD Dameon containerd.io package containerd import ( "context" "errors" "os" "os/signal" "sync" "github.com/containerd/containerd" ctrderr "github.com/containerd/containerd/errdefs" "github.com/containerd/containerd/images" "github.com/con...
// Copyright 2019 The grok_exporter 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...
// 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 crypto import ( "bytes" "encoding/binary" "golang.org/x/crypto/nacl/box" "golang.org/x/crypto/salsa20/salsa" "v.io/v23/verror" ) // cbox ...
package v1 import ( "fmt" sq "github.com/Masterminds/squirrel" argoprojv1alpha1 "github.com/argoproj/argo/pkg/client/clientset/versioned/typed/workflow/v1alpha1" "github.com/jmoiron/sqlx" "github.com/onepanelio/core/pkg/util/env" "github.com/onepanelio/core/pkg/util/gcs" "github.com/onepanelio/core/pkg/util/rou...
// Copyright (c) 2020 Tailscale Inc & 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 monitor import ( "context" "errors" "sync" "syscall" "time" "unsafe" "golang.org/x/sys/windows" "tailscale.com/net/interfaces" "t...