text
stringlengths
3.08k
10.4k
// Copyright 2017 Xiaomi, 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...
package common import ( "bufio" "errors" "fmt" "io" "strings" ) const ( // MaxLineLen is a maximum length of line in Assuan protocol, including // space after command and LF. MaxLineLen = 1000 ) // ReadWriter ties arbitrary io.Reader and io.Writer to get a struct that // satisfies io.ReadWriter requirements....
// Copyright 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 in wri...
package frank import ( "code.google.com/p/go.net/html" frankconf "github.com/breunigs/frank/config" irc "github.com/fluffle/goirc/client" rss "github.com/jteeuwen/go-pkg-rss" "log" "strconv" "time" ) // how often to check the feeds (in minutes) const checkEvery = 3 // ignore all posts that are older than X mi...
package driver import ( "fmt" "io" "os" ) var ErrNotSupported = fmt.Errorf("not supported") // Driver provides all of the system-level functions in a common interface. // The context should call these with full paths and should never use the `os` // package or any other package to access resources on the filesyst...
package collectors import ( "context" "math" "github.com/lightningnetwork/lnd/lnrpc" "github.com/prometheus/client_golang/prometheus" ) // WalletCollector is a collector that will export metrics related to lnd's // on-chain wallet. . type WalletCollector struct { lnd lnrpc.LightningClient // We'll use two gau...
// roshi-walker walks the keyspace and performs repairing Selects. package main import ( "flag" "fmt" "log" "math/rand" "net/http" _ "net/http/pprof" "strings" "time" "github.com/peterbourgon/g2s" "github.com/soundcloud/roshi/cluster" "github.com/soundcloud/roshi/farm" "github.com/soundcloud/roshi/instrum...
// 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...
package cmd import ( "context" "fmt" "regexp" "strings" "testing" "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured" "k8s.io/apimachinery/pkg/runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/kustomize/kstatus/status" ) type TableOutput struct { Frames []TableOutputFrame UnknownRows ...
package main import ( "log" "math/rand" "sync" "time" "github.com/gorilla/websocket" ) var minDeadline int var deadlineOffset int // DIRECTIONS contains all possible directions var DIRECTIONS = []string{"up", "right", "left", "down"} // GameStatus c type GameStatus struct { Width int `jso...
package main import ( "fmt" "strings" "regexp" "strconv" "io/ioutil" ) var regex = regexp.MustCompile(`position=<\s*(-?\d+),\s*(-?\d+)> velocity=<\s*(-?\d+),\s*(-?\d+)>`) //node type node struct{ x, y int vx, vy int } func parseNode(line string) node{ parts := regex.FindStringSubmatch(line) x , _ := strc...
// Package goexpress /router returns instance for express Router // Functions defined here are extended by express.go itself // // Express Router takes the url regex as similar to the js one // Router.Get("/:param") will return the param in Response.Params["param"] package goexpress import ( "regexp" ) // NextFunc ...
/* Copyright 2020 Gravitational, 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, soft...
package main import ( "bufio" "context" "flag" "fmt" "log" "os" "path" "time" "github.com/asticode/go-astikit" "github.com/asticode/go-astits" ) const ( ioBufSize = 10 * 1024 * 1024 ) type muxerOut struct { f *os.File w *bufio.Writer } func main() { flag.Usage = func() { fmt.Fprintf(flag.CommandLin...
package dnscrypt import ( "bytes" crypto_rand "crypto/rand" "crypto/sha512" "errors" "math/rand" "github.com/jedisct1/dlog" "github.com/jedisct1/xsecretbox" "golang.org/x/crypto/curve25519" "golang.org/x/crypto/nacl/box" "golang.org/x/crypto/nacl/secretbox" ) const ( NonceSize = xsecretbox.NonceSiz...
package httpbakery import ( "fmt" "net/http" "net/url" "os" "github.com/juju/webbrowser" "golang.org/x/net/context" "golang.org/x/net/context/ctxhttp" "gopkg.in/errgo.v1" "gopkg.in/httprequest.v1" "gopkg.in/macaroon-bakery.v2/bakery" ) const WebBrowserInteractionKind = "browser-window" // WaitTokenRespon...
// Copyright 2019 dfuse Platform 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 agre...
package edge import ( "github.com/michaelquigley/pfxlog" "github.com/openziti/foundation/channel2" "github.com/openziti/foundation/util/concurrenz" "github.com/pkg/errors" "math" "sync/atomic" "time" ) func NewChMsgMux() *ChMsgMux { mux := &ChMsgMux{ eventC: make(chan MuxEvent), chanMap: make(map[uint32]...
package models import ( "encoding/json" "fmt" "log" "os" "strings" "time" "github.com/toolkits/pkg/runner" "github.com/toolkits/pkg/str" ) type Configs struct { Id int64 Ckey string Cval string } // InitSalt generate random salt func InitSalt() { val, err := ConfigsGet("salt") if err != nil { log.F...
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may ...
package multiclusterapp import ( "context" "fmt" "strings" "github.com/rancher/norman/httperror" "github.com/rancher/norman/store/transform" "github.com/rancher/norman/types" "github.com/rancher/norman/types/convert" "github.com/rancher/norman/types/values" gaccess "github.com/rancher/rancher/pkg/api/customi...
package zapGL import ( "context" "errors" "fmt" // "log" "os" "strconv" "time" log "github.com/kr/pretty" "github.com/Broadroad/gpool" "github.com/json-iterator/go" "go.uber.org/atomic" "go.uber.org/zap/zapcore" ) // Core returned for use with zap type Core struct { zapcore.LevelEnabler ...
package main import ( "fmt" "log" "os" "os/exec" "path/filepath" "testing" "archive/zip" "github.com/akbarnes/dupver/src/fancyprint" "github.com/akbarnes/dupver/src/dupver" ) func TestWorkRepoInit(t *testing.T) { opts := dupver.Options{} debug := false verbose := true quiet := false monochrome := false...
package api import ( "bytes" "context" "encoding/json" "fmt" "net/http" "net/url" "path" "strings" "time" "github.com/go-chi/chi/v5" "github.com/go-chi/chi/v5/middleware" "github.com/gofrs/uuid" "github.com/ismrmrd/mrd-storage-server/core" ) // use a dedicated type to avoid context key collisions type ...
package graphql import ( "context" "encoding/json" "fmt" "github.com/datastax/cassandra-data-apis/config" "github.com/datastax/cassandra-data-apis/db" "github.com/datastax/cassandra-data-apis/log" "github.com/datastax/cassandra-data-apis/types" "github.com/graphql-go/graphql" "net/http" "path" "regexp" "st...
// The RHMAP System Dump Tool. package main import ( "bufio" "bytes" "errors" "flag" "fmt" "io" "io/ioutil" "log" "os" "os/exec" "path/filepath" "runtime" "time" ) const ( // dumpDir is a path to the base directory where the output of the tool // goes. dumpDir = "rhmap-dumps" // dumpTimestampFormat i...
package c_frontend import ( "bytes" "github.com/buexplain/go-blog/app/http/boot/code" "github.com/buexplain/go-blog/dao" m_category "github.com/buexplain/go-blog/models/category" m_content "github.com/buexplain/go-blog/models/content" s_category "github.com/buexplain/go-blog/services/category" s_configItem "git...
package magictheshouter import ( "appengine" "encoding/json" "fmt" "io/ioutil" "net/http" "regexp" "strconv" "time" ) func init() { http.HandleFunc("/ready", ready) http.HandleFunc("/cancel", cancel) http.HandleFunc("/regist", regist) http.HandleFunc("/magic", magic) http.HandleFunc("/testdata", testda...
/* Copyright 2022 The open-podcasts 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 o...
// Copyright 2021 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. package ingestion import ( "regexp" "sort" cpb "infra/appengine/weetbix/internal/clustering/proto" "infra/appengine/weetbix/pbutil" pb "infra/appen...
package lintcmd import ( "bufio" "errors" "fmt" "io" "strings" "unicode" ) func parseBuildConfigs(r io.Reader) ([]BuildConfig, error) { var builds []BuildConfig br := bufio.NewReader(r) i := 0 for { line, err := br.ReadString('\n') if err != nil { if err == io.EOF { break } else { return n...
package datagen import ( "encoding/json" "fmt" "github.com/flipkart-incubator/diligent/pkg/charset" "github.com/flipkart-incubator/diligent/pkg/keygen" "github.com/flipkart-incubator/diligent/pkg/strgen" "github.com/flipkart-incubator/diligent/pkg/strtr" "io/ioutil" "log" "os" ) const ( specTypeString = "di...
package commands import ( "fmt" "io" "log" "os" "os/exec" "path/filepath" "strings" "sync" "text/template" "github.com/harrybrwn/config" "github.com/harrybrwn/errs" "github.com/spf13/cobra" ) const serviceTemplate = `[Unit] Description=Watch a list of CRNs StartLimitIntervalSec=0 After=network.target [S...
package main import ( "context" "flag" "fmt" "os" "path/filepath" "strings" "sync" "time" "github.com/ghodss/yaml" "github.com/sirupsen/logrus" utilerrors "k8s.io/apimachinery/pkg/util/errors" prowconfig "k8s.io/test-infra/prow/config" "k8s.io/test-infra/prow/config/secret" prowflagutil "k8s.io/test-in...
package types import ( "bytes" "fmt" "math/big" "github.com/ethereum/go-ethereum/common" ethbridge "github.com/Sifchain/sifnode/x/ethbridge/types" sdk "github.com/cosmos/cosmos-sdk/types" ) // Event enum containing supported chain events type Event byte const ( // Unsupported is an invalid Cosmos or Ethereu...
// Copyright 2020 The Prometheus 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...
package postlite import ( "fmt" "github.com/mattn/go-sqlite3" ) type pgClassModule struct{} func (m *pgClassModule) Create(c *sqlite3.SQLiteConn, args []string) (sqlite3.VTab, error) { err := c.DeclareVTab(fmt.Sprintf(` CREATE TABLE %s ( oid INTEGER, relname TEXT, relnamesp...
package wholesaler import ( "errors" "github.com/jsix/gof/util" "go2o/core/domain/interface/enum" "go2o/core/domain/interface/item" "go2o/core/domain/interface/merchant/wholesaler" "log" ) var _ wholesaler.IWholesaler = new(wholesalerImpl) type wholesalerImpl struct { mchId int32 value *wholesaler.WsWh...
// Copyright (c) 2017-present Mattermost, Inc. All Rights Reserved. // See License for license information. package main import ( "io/ioutil" "os" "strings" "testing" jira "github.com/andygrunwald/go-jira" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestMarkdown(t *testi...
package areas /* BuildCache - queries all Residential Property listings, grabs their (locations) community, municipality and area columns and puts all unique values in a slice called Slice. OneLetterMap - every unique letter (made lower case) from all locations are added to this map as keys, the value of each key is...
package cvbot import ( "bytes" "context" "io" "log" "net/http" "os" "github.com/clsung/cvbot/cv/aws" "github.com/clsung/cvbot/cv/gcp" "github.com/line/line-bot-sdk-go/linebot" "github.com/pkg/errors" "go.opencensus.io/trace" ) // CVApp app type CVApp struct { bot *linebot.Client } // NewCVApp returns a ...
package module import ( "errors" "fmt" "io" "strings" "sync" "time" "github.com/warthog618/modem/at" "github.com/warthog618/modem/serial" "github.com/warthog618/modem/trace" ) type sim7000e struct { modem *at.AT port io.ReadWriter mutex sync.Mutex } // NewSIM7000 returns a ready to use Module func NewS...
// Code generated by the Pulumi SDK Generator DO NOT EDIT. // *** WARNING: Do not edit by hand unless you're certain you know what you are doing! *** package mediaconnect import ( "context" "reflect" "github.com/pkg/errors" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // Resource schema for AWS::MediaConnect::...
package env // Copyright (c) Microsoft Corporation. // Licensed under the Apache License 2.0. import ( "context" "os" mgmtauthorization "github.com/Azure/azure-sdk-for-go/services/preview/authorization/mgmt/2018-09-01-preview/authorization" "github.com/Azure/go-autorest/autorest" "github.com/Azure/go-autorest/a...
package main import ( "io" "net/http" "encoding/xml" "os/exec" "log" "os" "regexp" ) const LISTEN_ADDRESS = ":9202" const NVIDIA_SMI_PATH = "/usr/bin/nvidia-smi" var testMode string; type NvidiaSmiLog struct { DriverVersion string `xml:"driver_version"` AttachedGPUs string `xml:"...
package exporter import ( "fmt" "github.com/prometheus/common/log" "gopkg.in/yaml.v3" "io/ioutil" "os" "path" "strings" ) // GetConfig will try load config from target path func GetConfig() (res string) { // priority: cli-args > env > default settings (check exist) if res = *configPath; res != "" { log.In...
package version import ( "fmt" "strconv" "testing" ) func TestIsVersionLike(t *testing.T) { for _, test := range []struct { text string versionLike bool }{ {"0.15.0-9-g1a96a59", true}, {"0.15", true}, {"0.3.2", true}, {"cannonball", false}, } { t.Run(fmt.Sprintf("IsVersionLike(%#v)==%#v", t...
package helpers import ( _ "container/list" "errors" . "four-key/models" "gopkg.in/src-d/go-git.v4" "gopkg.in/src-d/go-git.v4/plumbing" "gopkg.in/src-d/go-git.v4/plumbing/object" "regexp" _ "sort" "strings" "time" ) type tagCommit struct { commit object.Commit tag *plumbing.Reference tagDate...
// Copyright (c) 2016 Pani Networks // 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 app...
package dotgen import ( "fmt" "io" "log" "reflect" "strings" "github.com/lovoo/goka" ) // Topic represents a kafka topic (stream or table) type Topic struct { ID string Name string Codec string IsTable bool } func (t *Topic) renderNode() string { color := "lavender" if t.IsTable { color = "p...
package main import ( "bytes" "embed" "encoding/json" "flag" "fmt" "io" "io/fs" "io/ioutil" "log" "net/http" "net/http/httputil" "net/url" "os" "regexp" "strings" "github.com/gorilla/mux" ) const consumerKey = "51813-9210c4b043da8404cede46e2" //go:embed dist var embededFiles embed.FS type AuthReque...
package v1alpha1 import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) type StatusPhase string type InstallationType string type ProductName string type ProductVersion string type OperatorVersion string type PreflightStatus string type StageName string var ( PhaseNone StatusPhase = "" PhaseAcce...
// Copyright 2013 tsuru 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 docker import ( "github.com/dotcloud/docker" "github.com/globocom/config" "github.com/globocom/docker-cluster/cluster" "github.com/globocom/tsuru/ap...
package cmd import ( "fmt" "io/ioutil" "path/filepath" "strconv" "strings" "github.com/flanksource/commons/console" "github.com/flanksource/commons/is" "github.com/flanksource/commons/logger" "github.com/flanksource/commons/lookup" "github.com/flanksource/commons/text" "github.com/flanksource/karina/pkg/ph...
package pig 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 ( sporkBirthday = nook.Birthday{ Day: 3, Month: t...
/* Copyright 2021 The tKeel 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 © Microsoft Corporation // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or...
package frontends import ( "crypto/tls" "crypto/x509" "fmt" "github.com/mailgun/oxy/forward" "github.com/mailgun/oxy/testutils" "github.com/rpheuts/routery/router" "io/ioutil" "log" "net/http" "strings" "github.com/rpheuts/routery/authentication" "github.com/rpheuts/routery/config" "encoding/base64" ) ty...
// +build linux package endpoint import ( "fmt" "io/ioutil" "path/filepath" "sync" "time" "github.com/armon/go-metrics" log "github.com/sirupsen/logrus" "github.com/typetypetype/conntrack" ) const ( // From https://www.kernel.org/doc/Documentation/networking/nf_conntrack-sysctl.txt eventsPath = "sys/net/n...
package encoding import ( "io/ioutil" "os" "path/filepath" "strconv" "testing" "time" "github.com/Azure/go-amqp/internal/buffer" ) func fuzzUnmarshal(data []byte) int { types := []interface{}{ new(Error), new(*Error), new(StateReceived), new(*StateReceived), new(StateAccepted), new(*StateAccepted...
/* Copyright (c) 2019 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 redis import ( "errors" "fmt" "gin-web/pkg/global" "gin-web/pkg/utils" "github.com/go-redis/redis" "github.com/thedevsaddam/gojsonq/v2" "gorm.io/gorm" "gorm.io/gorm/schema" "reflect" "strings" "sync" ) // 以redis client为基础, 加入一些类似gorm的查询方法(目前语法为gorm v2.0) // 核心是将Preload方法同步过来, 使查询更方便 // 自定义redis查询结...
package main import ( "fmt" "html/template" "io" "log" "net/http" "os" "strconv" "strings" ) var ( GBYTE int64 = 1073741824 // 1GB in bytes APP_NAME string MAXGB_FILESIZE string DIR_SEPARATOR string HTTP_ENDPOINT string SECRET_LINK string UPLOAD_DIRECTORY string TMPDIR ...
// Copyright (c) Microsoft Corporation. // Licensed under the MIT License. // +build all adlsgen2 package controllers import ( "context" "testing" azurev1alpha1 "github.com/Azure/azure-service-operator/api/v1alpha1" "github.com/Azure/azure-service-operator/pkg/helpers" "github.com/stretchr/testify/assert" ap...
package debiaser import ( "fmt" "log" "math" "sort" "gonum.org/v1/gonum/floats" "gonum.org/v1/gonum/mat" "github.com/JaderDias/movingmedian" ) // Debiaser implements inplace removal of bias from a mat64 of (scaled) values. type Debiaser interface { Debias(*mat.Dense) } // Sorter provides method to sort and...
package voting import ( "appengine" "appengine/datastore" "appengine/memcache" "encoding/csv" "errors" "fmt" "strconv" "strings" ) type Election struct { Candidates []Candidate `json:"candidates"` MyVote []string `json:"myvote" datastore:"-"` IsAdmin bool `json:"isadmin" datastore:"-"` ...
package compiler import "golang.org/x/sys/unix" type shift int func (c *compilerContext) isLongJump(jumpSize int) bool { return jumpSize > c.maxJumpSize } func hasLongJump(index int, jts, jfs map[int]int) bool { // Using the unshifted index to look up positions in jts and jfs is // only safe if we're iterating b...
// Copyright 2018 The ClientSDK Team Authors. All rights reserved. // Use of this source code is governed by a Apache 2.0-style // license that can be found in the LICENSE file. // Author: ClientSDK Team (muharihar) package sjwsdk111 import ( "bytes" "encoding/xml" "io" "io/ioutil" "net/http" "os" "strings" ...
// Copyright 2021 The Mellium Contributors. // Use of this source code is governed by the BSD 2-clause // license that can be found in the LICENSE file. package delay_test import ( "encoding/xml" "strconv" "strings" "testing" "time" "mellium.im/xmlstream" "mellium.im/xmpp/delay" "mellium.im/xmpp/jid" ) var ...
package tests import ( "context" "fmt" "path" "time" "github.com/onsi/ginkgo" gconfig "github.com/onsi/ginkgo/config" greporters "github.com/onsi/ginkgo/reporters" "github.com/onsi/gomega" "github.com/scylladb/scylla-operator/pkg/cmdutil" "github.com/scylladb/scylla-operator/pkg/genericclioptions" "github....
package scan import ( "context" "crypto/md5" "crypto/tls" "fmt" "io" "io/ioutil" "net" "net/http" "sync" "time" "github.com/avast/retry-go" "github.com/sirupsen/logrus" ) type VHOSTScanner struct { client *http.Client options *VHOSTOptions badCode int badHash string } func NewVHOSTScanner(opt *VHOS...
package backlog import ( "fmt" "github.com/mreider/agilemarkdown/markdown" "github.com/mreider/agilemarkdown/utils" "io/ioutil" "math" "os" "path/filepath" "regexp" "strings" ) var ( overviewItemRe = regexp.MustCompile(`\[[^]]*]\(([^)]+)\)`) OverviewFooterRe = regexp.MustCompile(`^\[Archived stories]\([^...
package cmd import ( "bufio" "bytes" "crypto/tls" "encoding/xml" "fmt" "go/format" "io" "net" "net/http" "os" "path/filepath" "time" "github.com/cavaliercoder/grab" "github.com/k0kubun/pp" "github.com/miku/zek" "github.com/spf13/cobra" ) var ( withComments bool withJSONTags bool ma...
package aggregaterange import ( "errors" "github.com/incognitochain/incognito-chain/privacy" "math" ) const ( maxExp = 64 numOutputParam = 32 maxOutputNumber = 32 numCommitValue = 5 maxOutputNumberParam = 256 ) // bulletproofParams includes all generator for aggregated range pr...
// Copyright 2017 The kubecfg 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 applica...
package main import ( "crypto/md5" "encoding/json" "fmt" "net/http" "sync" "time" uuid "github.com/satori/go.uuid" captcha "github.com/widaT/go-captcha/puzzle_captcha" ) type RespJson struct { RepCode string `json:"repCode"` RepData interface{} `json:"repData"` RepMsg string `json:"repMsg"` } ...
// Code generated by go-swagger; DO NOT EDIT. package severity_matrix // 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 "git...
package cmd import ( "crypto/tls" "encoding/json" "fmt" "io/ioutil" "log" "net/http" "os" "github.com/spf13/cobra" admissionv1 "k8s.io/api/admission/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/serializer"...
package web import ( fmt "fmt" "io/ioutil" "log" "net/http" "strings" "time" "github.com/golang/protobuf/ptypes" "github.com/vsekhar/protoweb/internal/naming" ) // Req2Proto converts an http.Request into a Request protobuffer or // returns an error. func Req2Proto(req *http.Request) (*Request, error) { ret ...
package v2 import ( "bytes" "context" "fmt" "io" "github.com/Azure/azure-kusto-go/kusto/data/errors" "github.com/Azure/azure-kusto-go/kusto/data/table" "github.com/Azure/azure-kusto-go/kusto/internal/frames" "github.com/Azure/azure-kusto-go/kusto/internal/frames/unmarshal/json" ) // Decoder implements frames...
package main import ( "crypto" _ "crypto/md5" _ "crypto/sha1" _ "crypto/sha256" _ "crypto/sha512" "encoding/hex" "errors" "io" "strings" _ "golang.org/x/crypto/blake2b" _ "golang.org/x/crypto/blake2s" _ "golang.org/x/crypto/ripemd160" _ "golang.org/x/crypto/sha3" "lukechampine.com/blake3" ) // Where ea...
package blockchain import ( "encoding/json" "errors" "os" "sync" ) const ( // CoinValue is the transaction amount that represents one Cumulus coin CoinValue uint64 = 1 << 32 // StartingBlockReward is the mining reward that the blockchain will begin // with. StartingBlockReward uint64 = 25 * CoinValue // Blo...
/* 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, ...
// _ _ // __ _____ __ ___ ___ __ _| |_ ___ // \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \ // \ V V / __/ (_| |\ V /| | (_| | || __/ // \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___| // // Copyright © 2016 - 2019 SeMI Holding B.V. (registered @ Dutch Chamber of Commerce no 752216...
package beehive import ( "encoding/gob" "fmt" "reflect" "runtime" ) // Message is a generic interface for messages emitted in the system. Messages // are defined for each type. type Msg interface { // Type of the data in this message. Type() string // Data stored in the message. Data() interface{} // From re...
package masscan import ( "bufio" "bytes" "context" "fmt" "os/exec" "strings" "github.com/zan8in/masscan/errors" "github.com/zan8in/masscan/tools" ) type ( // Scanner ... Scanner struct { cmd *exec.Cmd args []string binaryPath string ctx context.Context pid int // os.getpid() deb...
package drpc import ( "context" "crypto/tls" "net" "net/http" "sync" srvmw "go.bryk.io/pkg/net/drpc/middleware/server" "go.bryk.io/pkg/net/drpc/ws" "golang.org/x/sync/errgroup" "storj.io/drpc" "storj.io/drpc/drpchttp" "storj.io/drpc/drpcmigrate" "storj.io/drpc/drpcmux" "storj.io/drpc/drpcserver" ) // Se...
package commands import ( "bytes" "fmt" "io/ioutil" "os" "strings" "testing" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/spf13/cobra" "github.com/theochva/go-misc/pkg/osext" "github.com/theochva/goyaml/internal/commands/cli" ) var ( _SampleYAMLExistingKey = "xmas-fifth-day.callin...
package calendar import ( _ "embed" "fmt" "sort" "strings" "time" "github.com/byxorna/jot/pkg/text" "github.com/byxorna/jot/pkg/types" "google.golang.org/api/calendar/v3" ) type Event struct { gevent *calendar.Event body string created time.Time start time.Time duration time.Duration a...
/* Statsd client Supports counting, sampling, timing, gauges, sets and multi-metrics packet. Using the client to increment a counter: client, err := statsdclient.Dial("127.0.0.1:8125") if err != nil { // handle error } defer client.Close() err = client.Increment("buckets", 1, 1) */ package statsdclient impo...
package probe import ( "encoding/json" "strconv" "github.com/juju/errors" "github.com/yext/revere/db" "github.com/yext/revere/resource" "github.com/yext/revere/util" ) type GraphiteThresholdType struct{} type GraphiteThresholdProbe struct { GraphiteThresholdType URL string ResourceID ...
package golinkedmin import ( "github.com/tamboto2000/golinkedin" ) // Profile contains people/user profile type Profile struct { ID string `json:"id,omitempty"` Username string `json:"username,omitempty"` ProfilePicture *Image `json:"profilePicture,omitempty"`...
package social import ( "encoding/json" "fmt" "strconv" "strings" "github.com/grafana/grafana/pkg/models" "github.com/grafana/grafana/pkg/setting" "golang.org/x/net/context" "golang.org/x/oauth2" ) type BasicUserInfo struct { Identity string Name string Email string Login string Company stri...
package main import ( "fmt" "os" "strings" "github.com/iancoleman/strcase" log "github.com/sirupsen/logrus" omh "github.com/ukautz/obsidian-meets-hugo/pkg" "github.com/urfave/cli/v2" ) func main() { app := cli.NewApp() app.Name = "omh" app.Flags = []cli.Flag{ &cli.StringFlag{ Name: "obsidian-root"...
package kuznechik import ( "fmt" "github.com/DmitriiTrifonov/gost-ciphers/util" "io/ioutil" "log" "os" "runtime" "time" ) const parts = 10 const filesize = 12500000 const block = 64 var key = [0x20]byte{ 0x88, 0x99, 0xAA, 0xBB, 0xCC, 0xDD, 0xEE, 0xFF, // 00..07 0x00, 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0...
package gotalk import ( "sync/atomic" "math/rand" "time" ) type Limits interface { // Maximum amount of time allowed to read a buffer request. 0 = no timeout. // Defaults to 30 seconds. ReadTimeout() time.Duration SetReadTimeout(time.Duration) incBufferReq() bool decBufferReq() streamReqEnabled() ...
package main import ( "fmt" "os" "github.com/Tarick/naca-items/pkg/itempublisher" "github.com/Tarick/naca-rss-feeds/internal/application/worker" "github.com/Tarick/naca-rss-feeds/internal/logger/zaplogger" "github.com/Tarick/naca-rss-feeds/internal/messaging/nsqclient/consumer" "github.com/Tarick/naca-rss-feed...
// Copyright 2020 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 source import ( "context" "fmt" "go/ast" "go/types" "path/filepath" "strings" "golang.org/x/tools/internal/lsp/fuzzy" "golang.org/x/tools/inte...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: grpc/ready.proto /* Package grpc is a generated protocol buffer package. It is generated from these files: grpc/ready.proto It has these top-level messages: ReadyRequest ReadyResponse */ package grpc import proto "github.com/golang/protobuf/proto" impor...
// 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...