text
stringlengths
3.08k
10.4k
package main import ( "context" "fmt" "github.com/rakshasa/ethereum-watcher" "github.com/rakshasa/ethereum-watcher/blockchain" "github.com/rakshasa/ethereum-watcher/plugin" "github.com/rakshasa/ethereum-watcher/rpc" "github.com/sirupsen/logrus" "github.com/spf13/cobra" "os" "os/signal" ) const ( api = "htt...
package pkg import ( "context" "fmt" "time" "github.com/docker/docker/api/types" "github.com/docker/docker/api/types/container" "github.com/docker/docker/api/types/filters" "github.com/docker/docker/client" ) // type DockerVolume struct { // Source string // Destination string // } type iDockerClient ...
/* Copyright © 2022 NAME HERE <EMAIL ADDRESS> 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 clitest import ( "encoding/json" "fmt" "io/ioutil" "os" "path" "github.com/hashgard/hashgard/x/box/client/types" "github.com/cosmos/cosmos-sdk/tests" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/hashgard/hashgard/app" "github.com/hashgard/hashgard/x/box/params" boxutils "github.com/hashgar...
// Package template_util contains template functions from prometheus_bot package template_util import ( "fmt" "log" "math" "strconv" "strings" "time" ) /** * Subdivideb by 1024 */ const ( Kb = iota Mb Gb Tb Pb Eb Zb Yb Information_Size_MAX ) /** * Subdivided by 10000 */ const ( K = iota M G T ...
// *** 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 cloudscheduler import ( "github.com/pulumi/pulumi/sdk/go/pulumi" ) // > This content is derived from https://github.com/terraform-provide...
package main import ( "bufio" "crypto/sha1" "encoding/hex" "encoding/json" "fmt" lc "kademlia/labCode" "log" "net" "os" "strings" "time" "github.com/pkg/errors" ) type CLIApp struct { IP string Port int } // Message body is used to store any information that we want to send in an RPC type CLIMsgBody...
package main import ( "bytes" "context" "encoding/json" "flag" "io/ioutil" "log" "net/http" "net/url" "os" "path/filepath" "strings" "sync" "time" "github.com/distr1/distri" "github.com/distr1/distri/pb" ) func errHandlerFunc(h func(w http.ResponseWriter, r *http.Request) error) http.Handler { return...
// Copyright 2021 Pinterest // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in wr...
package main import ( "container/ring" "context" "fmt" "math/rand" "time" rpchttp "github.com/tendermint/tendermint/rpc/client/http" e2e "github.com/tendermint/tendermint/test/e2e/pkg" "github.com/tendermint/tendermint/types" ) // Load generates transactions against the network until the given context is // ...
package gas import ( "math/big" "github.com/Ankr-network/wagon/exec/internal/compile" ops "github.com/Ankr-network/wagon/wasm/operators" ) const ( GasQuickStep uint64 = 2 GasFastestStep uint64 = 3 GasFastStep uint64 = 5 GasMidStep uint64 = 8 GasSlowStep uint64 = 10 GasExtStep ...
package client import ( "context" "fmt" "io" "time" "github.com/hyperledger/fabric-protos-go/common" fabricOrderer "github.com/hyperledger/fabric-protos-go/orderer" "github.com/hyperledger/fabric/msp" "github.com/hyperledger/fabric/protoutil" "go.uber.org/zap" "google.golang.org/grpc" "github.com/vitiko/h...
package natsconsumer import ( "fmt" "log" "sync" "github.com/influxdata/telegraf" "github.com/influxdata/telegraf/plugins/inputs" "github.com/influxdata/telegraf/plugins/parsers" "github.com/nats-io/nats" ) type natsError struct { conn *nats.Conn sub *nats.Subscription err error } func (e natsError) Err...
package backend import ( "crypto/subtle" "encoding/json" "fmt" "net/http" "time" ) func init() { http.HandleFunc("/", Index) http.HandleFunc("/action", Auth(Action)) } const indexTmpl = `<!DOCTYPE html> <html> <head> <title>Magic Mirror</title> <link rel='stylesheet' href='/static/style.css'/> </head> <body> ...
package myetcd import ( "context" "errors" "go-snake/akmessage" "go-snake/common" "go-snake/common/rpcBase" "os" "reflect" //"sync" "time" "go.etcd.io/etcd/clientv3" //"github.com/coreos/etcd/clientv3" "google.golang.org/protobuf/proto" //"github.com/coreos/etcd/mvcc/mvccpb" //"go.etcd.io/etcd/mvcc/mvcc...
package evaluations import ( "encoding/json" "os" "os/signal" "strconv" "time" consul "github.com/hashicorp/consul/api" nomad "github.com/hashicorp/nomad/api" "github.com/seatgeek/nomad-firehose/helper" "github.com/seatgeek/nomad-firehose/sink" log "github.com/sirupsen/logrus" ) const ( consulLockKey = ...
package cmd import ( "bytes" "context" "fmt" "io" "os" "path/filepath" "testing" "time" "github.com/spf13/cobra" "github.com/ory/x/cmdx" "github.com/ory/x/configx" "github.com/sirupsen/logrus" "github.com/sirupsen/logrus/hooks/test" "github.com/spf13/pflag" "github.com/stretchr/testify/require" "git...
package auth import ( "github.com/ActiveState/cli/internal/constants" "github.com/ActiveState/cli/internal/errs" "github.com/ActiveState/cli/internal/keypairs" "github.com/ActiveState/cli/internal/locale" "github.com/ActiveState/cli/internal/output" "github.com/ActiveState/cli/internal/prompt" secretsapi "githu...
// Copyright © 2019 Alibaba Co. Ltd. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed...
// Package api provides implementation of aptly REST API package api import ( "fmt" "log" "net/http" "sort" "strconv" "strings" "github.com/aptly-dev/aptly/aptly" "github.com/aptly-dev/aptly/deb" "github.com/aptly-dev/aptly/query" "github.com/aptly-dev/aptly/task" "github.com/gin-gonic/gin" ) // Lock orde...
/* Copyright 2020 The Tekton 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, software...
/* * Copyright 2014 <NAME> * All rights reserved * * Redistribution and use in source and binary forms, with or without * modification, are permitted providing that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and th...
// SPDX-FileCopyrightText: 2020 SAP SE or an SAP affiliate company and Gardener contributors. // // SPDX-License-Identifier: Apache-2.0 package config import ( cdv2 "github.com/gardener/component-spec/bindings-go/apis/v2" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" lscore "github.com/gardener/landscaper/apis/co...
package mpesa import ( "bytes" "crypto/rand" "crypto/rsa" "crypto/x509" "elephant/config" "elephant/payments" "encoding/base64" "encoding/json" "encoding/pem" "fmt" "io/ioutil" "log" "net/http" "strings" "github.com/buger/jsonparser" "github.com/spf13/viper" ) var ( conf = config.GetConfig() bas...
/* MIT License Copyright (c) 2020 <NAME> 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, distrib...
// Copyright (c) 2017-2018 Uber Technologies, Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicabl...
package values import ( "fmt" "regexp" "strings" "github.com/influxdata/flux/semantic" ) type Object interface { Value Get(name string) (Value, bool) Set(name string, v Value) Len() int Range(func(name string, v Value)) } type object struct { labels semantic.LabelSet values []Value ptyp map[string]sem...
package beacon import ( "fmt" "github.com/lightningnetwork/lnd/tlv" "github.com/xplorfin/moneysocket-go/moneysocket/beacon/location" "github.com/xplorfin/moneysocket-go/moneysocket/beacon/util" "github.com/xplorfin/moneysocket-go/moneysocket/beacon/util/bigsize" encodeUtils "github.com/xplorfin/moneysocket-go/m...
package main import ( "fmt" "strconv" "strings" "github.com/AlecAivazis/survey/v2" "github.com/ymarcus93/gallisto/protocol/client" "github.com/ymarcus93/gallisto/types" ) func submitEntry() error { // User picks which client to use err := clientSelection() if err != nil { return err } // User inputs da...
package lang import ( "bufio" "fmt" "os" "path/filepath" "strings" "unicode" "github.com/hitzhangjie/gorpc-cli/descriptor" ) // PBSimplifyGoType determine whether to use fullyQualifiedPackageName or not, // if the `fullTypeName` occur in code of `package goPackageName`, `package` part // should be removed. fu...
// Copyright (c) 2021 Doc.ai and/or its affiliates. // // 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/LIC...
package secrets import ( "encoding/json" "fmt" "io/ioutil" "os" "path/filepath" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/ssm" "github.com/hazelops/ize/internal/config" "github.com/pterm/pterm" "github.com/spf13/cobra" "github.com/spf13/viper...
// Code generated by go-swagger; DO NOT EDIT. package users // 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/go...
package component import ( "fmt" "github.com/tsundata/assistant/internal/pkg/version" "html/template" ) type Html struct { Name string Title string UseIcon bool UseCodeEditor bool Page Component css template.CSS js template.JS } func (c *Html) SetCss(css...
package parser import ( "fmt" "reflect" "sort" "github.com/elliotchance/ok/ast" "github.com/elliotchance/ok/lexer" "github.com/elliotchance/ok/types" "github.com/pkg/errors" ) type Parser struct { errors []error funcs map[string]*ast.Func tests []*ast.Test finalizers map[string][...
package nebula import ( "fmt" "net" "testing" "github.com/stretchr/testify/assert" "golang.org/x/net/ipv4" ) func Test_newPacket(t *testing.T) { p := &FirewallPacket{} // length fail err := newPacket([]byte{0, 1}, true, p) assert.EqualError(t, err, "packet is less than 20 bytes") // length fail with ip o...
package hunter import ( "testing" "github.com/eaglerock1337/gobat/pkg/board" ) var testData = [10][10]int{ {4, 2, 5, 23, 18, 90, 2, 0, 14, 3}, {3, 48, 29, 2, 0, 23, 4, 8, 3, 12}, {45, 23, 2, 0, 0, 0, 43, 23, 1, 4}, {3, 45, 29, 2, 0, 23, 4, 8, 3, 12}, {3, 48, 45, 2, 0, 2, 23, 8, 3, 45}, {3, 2, 23, 2, 0, 45, 4...
package trade import ( "encoding/json" "errors" "fmt" "log" "net/http" "time" ) type cryptoTrade struct { EventType string `json:"ev"` // Event type Pair string `json:"pair"` // Crypto pair Price float64 `json:"p"` // Trade price Volume float64 `json:"s"` // Trade volum...
package client import ( "bufio" "fmt" "levi.ori/p2p-chat/common" "net" "os" "strings" "sync" ) var commands = map[string]func(*Client, []string){ "/pm": pmCommand, "/connect": connectCommand, "/shell": shellCommand, } type Client struct { common.Client Connections map[string]*common.Client reader...
/* 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 distrib...
package main import ( "Neo-Rank/block" "Neo-Rank/config" "Neo-Rank/db/mgo" "Neo-Rank/services" "Neo-Rank/utils" "Neo-Rank/utils/redis" "fmt" "math" "math/rand" "time" "github.com/pkg/errors" ) const ( configPath = "./config" env = "development" ) var rd *redis.RedisCon const maxRoutineNum int =...
// Code generated by msgraph.go/gen DO NOT EDIT. package msgraph import "time" // MobileApp An abstract class containing the base properties for Intune mobile apps. type MobileApp struct { // Entity is the base model of MobileApp Entity // CreatedDateTime The date and time the app was created. CreatedDateTime *t...
/* * Copyright 2021 <NAME> <<EMAIL>>. All rights reserved. * Use of this source code is governed by a MIT style * license that can be found in the LICENSE file. */ package v1 import ( "context" "regexp" "sync" "cooool-blog-api/internal/apiserver/store" "cooool-blog-api/internal/pkg/code" "cooool-blog-api/i...
package models import ( "bytes" "encoding/binary" "encoding/json" "errors" "fmt" "strconv" "time" "github.com/grafana/grafana/pkg/components/simplejson" "github.com/grafana/grafana/pkg/infra/log" "github.com/twpayne/go-geom" "github.com/twpayne/go-geom/encoding/wkb" ) type MyPoint struct { Point wkb....
package paxos import ( "context" "errors" pb "github.com/nvanbenschoten/paxos/paxos/paxospb" ) var ( // ErrStopped is returned by methods on Nodes that have been stopped. ErrStopped = errors.New("paxos: stopped") ) // Ready encapsulates the entries and messages that are ready to read, // be saved to stable sto...
package slackbot import ( "bytes" "crypto/hmac" "crypto/sha256" "encoding/hex" "fmt" "io/ioutil" "net/http" "net/http/httptest" "testing" jxv1 "github.com/jenkins-x/jx/v2/pkg/apis/jenkins.io/v1" "github.com/jenkins-x/jx/v2/pkg/cmd/opts" "github.com/jenkins-x/jx/v2/pkg/cmd/testhelpers" "github.com/jenkins...
// Copyright 2018 The LUCI Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed...
// // Author:: <NAME> (<<EMAIL>>) // Copyright:: Copyright 2021, Lacework Inc. // License:: Apache License, Version 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://ww...
// Copyright © 2018 <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...
package universe import ( "time" "github.com/influxdata/flux" "github.com/influxdata/flux/codes" "github.com/influxdata/flux/execute" "github.com/influxdata/flux/internal/errors" "github.com/influxdata/flux/plan" "github.com/influxdata/flux/runtime" "github.com/influxdata/flux/values" ) const ElapsedKind = "...
package util import ( "time" ) const ( // AllDaysMask is a bitmask of all the days of the week. AllDaysMask = 1<<uint(time.Sunday) | 1<<uint(time.Monday) | 1<<uint(time.Tuesday) | 1<<uint(time.Wednesday) | 1<<uint(time.Thursday) | 1<<uint(time.Friday) | 1<<uint(time.Saturday) // WeekDaysMask is a bitmask of all t...
package sharedobj import ( "errors" "fmt" "testing" log_api "github.com/cyberark/secretless-broker/pkg/secretless/log" loggerMock "github.com/cyberark/secretless-broker/pkg/secretless/log/mock" "github.com/cyberark/secretless-broker/pkg/secretless/plugin" "github.com/cyberark/secretless-broker/pkg/secretless/p...
package chatops import ( "context" "encoding/json" "fmt" "io" "os" "strconv" "strings" "github.com/dictyBase-docker/github-actions/internal/logger" "github.com/google/go-github/v32/github" "github.com/sethvargo/go-githubactions" "github.com/urfave/cli" ) type pullRequestGetter interface { Get(ctx context...
// +build linux package auditrd import ( "bytes" "encoding/binary" "errors" "fmt" "sync/atomic" "syscall" "time" "github.com/golang/glog" "github.com/josharian/native" ) var endianness = native.Endian const ( // MAX_AUDIT_MESSAGE_LENGTH see https://github.com/torvalds/linux/blob/v5.6/include/uapi/linux/a...
/* * Tencent is pleased to support the open source community by making 蓝鲸 available. * Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved. * Licensed under the MIT License (the "License"); you may not use this file except * in compliance with the License. You may obtain a copy of the Li...
package namecoin import ( "fmt" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/iov-one/weave" coin "github.com/iov-one/weave/coin" "github.com/iov-one/weave/orm" "github.com/iov-one/weave/store" "github.com/iov-one/weave/x/cash" ) // BadBucket contains obje...
package tblstore import ( "strings" "github.com/lindb/lindb/kv/table" "github.com/lindb/lindb/pkg/stream" "github.com/lindb/lindb/series/field" "github.com/lindb/lindb/series/tag" ) //go:generate mockgen -source ./metrics_meta_reader.go -destination=./metrics_meta_reader_mock.go -package tblstore // MetricsMet...
/* 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 distributed under the Li...
package straddling import ( "bytes" "crypto/cipher" "fmt" "github.com/keltia/cipher" ) const ( alphabetTxt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ/-" ) var ( allcipher = []byte{'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} freq = []byte{'E', 'S', 'A', 'N', 'T', 'I', 'R', 'U'} ) type straddlingcheckerboard str...
// Copyright © 2021 Kaleido, Inc. // // 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 // // Unle...
/** * Copyright 2021 The IcecaneDB 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 * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless requi...
package s3 import ( "fmt" "log" "net/http" "os" "path/filepath" "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" ) type S3Bucket struct { Name string Region string session *session.Session ...
package gbt19056 import ( "encoding/binary" "fmt" ) // ExportRecord ... type ExportRecord struct { NumberBlock uint16 `json:"number_block"` StandardVersion StandardVersion `json:"standard_version"` DriverInfo DriverInfo `json:"driver_info"` RealTime RealTime ...
package buildpackage_test import ( "testing" "github.com/buildpack/imgutil/fakes" "github.com/golang/mock/gomock" "github.com/heroku/color" "github.com/sclevine/spec" "github.com/sclevine/spec/report" "github.com/buildpack/pack/internal/api" "github.com/buildpack/pack/internal/buildpackage" "github.com/buil...
// // Copyright Coinbase, Inc. All Rights Reserved. // // SPDX-License-Identifier: Apache-2.0 // package bbs import ( "fmt" "io" "github.com/gtank/merlin" "github.com/coinbase/kryptology/pkg/core/curves" "github.com/coinbase/kryptology/pkg/signatures/common" ) // PokSignature a.k.a. Proof of Knowledge of a Si...
/* Copyright 2016 caicloud 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 agreed ...
package app import ( "encoding/json" "errors" "fmt" "net/url" "path/filepath" "strings" "gopkg.in/yaml.v2" "github.com/Masterminds/semver" "github.com/Praqma/helmsman/internal/gcs" ) type helmRepo struct { Name string `json:"name"` URL string `json:"url"` } type chartInfo struct { Name string `yaml...
package schema import ( "context" "time" "gin-casbin/internal/app/config" "gin-casbin/pkg/util" ) // GetRootUser 获取root用户 func GetRootUser() *User { user := config.C.Root return &User{ ID: user.UserName, UserName: user.UserName, RealName: user.RealName, Password: util.MD5HashString(user.Password)...
/* 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 the License ...
package main import ( "context" "encoding/json" "io/ioutil" "log" "net/http" "net/http/httptest" "strings" "testing" "time" "go.mongodb.org/mongo-driver/bson" "go.mongodb.org/mongo-driver/mongo" "go.mongodb.org/mongo-driver/mongo/options" "go.mongodb.org/mongo-driver/mongo/readpref" "...
/* Copyright (c) 2018 Red Hat, 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 tvxwidgets import ( "strings" "github.com/gdamore/tcell/v2" "github.com/rivo/tview" ) // represents dialog type const ( InfoDialog = 0 + iota ErrorDailog ) // MessageDialog represents message dialog primitive. type MessageDialog struct { *tview.Box // layout message dialog layout layout *tview.Flex ...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: envoy/config/filter/listener/tls_inspector/v2/tls_inspector.proto package envoy_config_filter_listener_tls_inspector_v2 import ( fmt "fmt" _ "github.com/cncf/udpa/go/udpa/annotations" proto "github.com/golang/protobuf/proto" math "math" ) // Reference i...
package configdir_test import ( "encoding/json" "fmt" "os" "path/filepath" "github.com/hugefiver/qush/configdir" ) // Quick start example for a common use case of this module. func Example() { // A common use case is to get a private config folder for your app to // place its settings files into, that are spe...
// Copyright (C) 2020 <NAME>. All Rights Reserved. package types import ( "encoding/json" "time" ) // A Tweet is the decoded form of a single tweet. The fields marked "default" // will always be populated by the API; other fields are filled in based on the // parameters in the request. type Tweet struct { ID s...
package elgamal import ( "crypto/sha512" "fmt" "github.com/lavode/secret-sharing/gf" "github.com/lavode/secret-sharing/secretshare" "math/big" ) // hashByteSize is the size - in bytes - of the hash algorithm used by this // implementation of hashed ElGamal. // In our case we use SHA512, hence 64 bytes. // All me...
// 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. package os_ import ( "os" "github.com/hacdias/webdav/v3/internal_/syscall_/windows_" "syscall" "github.com/hacdias/webdav/v3/syscall_" "unsafe" ) // Stat...
// Copyright 2020 New Relic Corporation. All rights reserved. // SPDX-License-Identifier: Apache-2.0 package service import ( "context" "sync" "time" "github.com/newrelic/infrastructure-agent/internal/agent/cmdchannel" "github.com/newrelic/infrastructure-agent/internal/agent/id" "github.com/newrelic/infrastruct...
// Copyright 2010 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 cmplx import "math" // The original C code, the long comment, and the constants // below are from http://netlib.sandia.gov/cephes/c9x-complex/clog.c. ...
package kafkabp import ( "context" "io" "sync" "sync/atomic" "github.com/Shopify/sarama" "github.com/reddit/baseplate.go/metricsbp" "github.com/reddit/baseplate.go/tracing" ) // ConsumeMessageFunc is a function type for consuming consumer messages. type ConsumeMessageFunc func(ctx context.Context, msg *saram...
package main import ( "context" "flag" "os" "os/signal" "path/filepath" "runtime/pprof" "strings" "syscall" "time" "github.com/gogo/protobuf/proto" "github.com/pkg/errors" log "github.com/sirupsen/logrus" "github.com/tritonmedia/downloader-go/internal/downloader" "github.com/tritonmedia/downloader-go/in...
//go:generate scribblec-param.sh Downloader.scr -d . -param Downloader github.com/nickng/httpget/Downloader -param-api Master -param-api Fetcher -param-api Server package main import ( "encoding/gob" "flag" "fmt" "log" "net/url" "os" "strconv" "sync" "github.com/nickng/httpget/Downloader/Downloader/Master_1...
package web3 import ( "bytes" "context" "encoding/json" "errors" "fmt" "os" "os/exec" "regexp" "strconv" "strings" ) var versionRegexp = regexp.MustCompile(`([0-9]+)\.([0-9]+)\.([0-9]+)`) // Contract contains information about a compiled contract, alongside its code and runtime code. type Contract struct {...
package commands import ( "encoding/xml" "strings" "time" "github.com/inconshreveable/log15" "github.com/spf13/cobra" "github.com/spf13/viper" "golang.org/x/xerrors" c "github.com/vulsio/goval-dictionary/config" "github.com/vulsio/goval-dictionary/db" fetcher "github.com/vulsio/goval-dictionary/fetcher/sus...
package compose import ( "context" "fmt" "net/http" "testing" "github.com/cortezaproject/corteza-server/compose/types" "github.com/cortezaproject/corteza-server/store" "github.com/cortezaproject/corteza-server/tests/helpers" "github.com/spf13/cast" ) func fetchEntireNamespace(ctx context.Context, s store.Sto...
package accountview import ( "encoding/json" "fmt" "os" "testing" "time" "github.com/Jaskaranbir/es-bank-account/domain/account" "github.com/Jaskaranbir/es-bank-account/eventutil" "github.com/Jaskaranbir/es-bank-account/logger" "github.com/Jaskaranbir/es-bank-account/model" "github.com/google/uuid" . "gith...
package main import ( "encoding/json" "fmt" "log" "os" "path" "strconv" "strings" ) const ( // envSwarmGPU = "DOCKER_RESOURCE_GPU" envNVRequirePrefix = "NVIDIA_REQUIRE_" envLegacyCUDAVersion = "CUDA_VERSION" envNVRequireCUDA = envNVRequirePrefix + "CUDA" envNVGPU = "NVID...
package rpc import ( "encoding/json" "fmt" "io" "io/ioutil" "net/http" "os" "strings" "sync" "github.com/testground/testground/pkg/logging" "github.com/docker/docker/pkg/ioutils" "go.uber.org/zap" "go.uber.org/zap/zapcore" ) type OutputWriter struct { sync.Mutex *zap.SugaredLogger pw *progressWriter ...
package mgr import ( "bytes" "context" "errors" "fmt" "gokins/comm" "gokins/model" "gokins/service/dbService" "os" "os/exec" "path/filepath" "runtime" "strings" "sync" "time" ruisIo "github.com/mgr9525/go-ruisutil/ruisio" ruisUtil "github.com/mgr9525/go-ruisutil" ) type RunTask struct { Md *mode...
package dnac import ( "fmt" "github.com/go-resty/resty/v2" "github.com/google/go-querystring/query" ) type IssuesService service type GetIssueEnrichmentDetailsHeaderParams struct { EntityType string `url:"entity_type,omitempty"` //Expects type string. Issue enrichment details can be fetched based on either Is...
/* * Copyright 2014 <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 wr...
// 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 unde...
package synchronization import ( "errors" "fmt" ) // Description returns a human-readable description of the session status. func (s Status) Description() string { switch s { case Status_Disconnected: return "Waiting to connect" case Status_HaltedOnRootEmptied: return "Halted due to one-sided root emptying" ...
//go:generate ../../../tools/readme_config_includer/generator package elasticsearch_query import ( "context" _ "embed" "fmt" "net/http" "strconv" "strings" "sync" "time" elastic5 "gopkg.in/olivere/elastic.v5" "github.com/influxdata/telegraf" "github.com/influxdata/telegraf/config" "github.com/influxdata/...
package l import ( "errors" "fmt" "github.com/matryer/resync" "github.com/rjansen/migi" "io" "io/ioutil" "os" "time" ) var ( //ErrInvalidProvider is the err raised when an invalid provider was select ErrInvalidProvider = errors.New("logger.InvalidProvider Message='Avaible providers are: LOGRUS and ZAP'") /...
package portscanner import ( "fmt" "net" "regexp" "sort" "strconv" "strings" "sync" "time" ) // IPv4 is the type used for IP addresses. type IPv4 [4]int /*struct IPPortList{ ip IPv4 ports []string }*/ // Check checks if an error is nil or a significant error. func Check(err error) { if err != nil { p...
package main import ( "fmt" "net" "net/http" "net/url" "os" "runtime" "strings" "time" "github.com/fukata/golang-stats-api-handler" "github.com/jessevdk/go-flags" "github.com/kazeburo/chocon/proxy" "github.com/lestrrat/go-apache-logformat" "github.com/lestrrat/go-file-rotatelogs" "github.com/lestrrat/go...
package main import ( "Golang/Athenaeum/src/backend/models" "bytes" "encoding/json" "net/http" "net/http/httptest" "testing" "github.com/gin-gonic/gin" "github.com/stretchr/testify/assert" ) // Referencing https://medium.com/@craigchilds94/testing-gin-json-responses-1f258ce3b0b1 func performRequest(r http.Ha...
//main package has examples shown // in Hands-On Data Structures and algorithms with Go book package main // importing bytes,fmt,rand and time packages import ( "bytes" "fmt" "math/rand" "time" ) // MutliCursalMaze class type MultiCursalMaze struct { cells []byte hor []byte vert ...
package rpc import ( "fmt" ) type rpcFuncCacheGenerator struct{} func (p *rpcFuncCacheGenerator) getParamName(idx int) string { if idx < 6 { return []string{ "a", "b", "c", "d", "e", "f", }[idx] } return fmt.Sprintf("pa%d", idx) } func (p *rpcFuncCacheGenerator) getOKName(idx int) string { if idx < 6 { ...