text
stringlengths
3.08k
10.4k
// Copyright © 2015 The Go Authors. All rights reserved. // // 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, m...
package api import ( "crypto/md5" "fmt" "net/http" "github.com/Sirupsen/logrus" "github.com/eliothedeman/bangarang/config" "github.com/eliothedeman/bangarang/pipeline" "github.com/gorilla/mux" ) const ( SESSION_HEADER_NAME = "BANG_SESSION" EXPIRED_SESSION_TOKEN = 4000 INVALID_SESSION_TOKEN = 4001 ) type...
/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
package mixer import ( "container/heap" "fmt" "net/http" "time" almHttp "github.com/dinowernli/almanac/pkg/http" "github.com/dinowernli/almanac/pkg/service/discovery" "github.com/dinowernli/almanac/pkg/storage" pb_almanac "github.com/dinowernli/almanac/proto" "github.com/prometheus/client_golang/prometheus"...
/* * Copyright © 2015-2018 <NAME> <<EMAIL>> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law o...
package segments import ( "errors" "fmt" "oh-my-posh/environment" "oh-my-posh/properties" "oh-my-posh/regex" "oh-my-posh/template" ) const ( languageTemplate = " {{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} " ) type loadContext func() type inContext func() bool type getVersion func() (string, e...
package edsm import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" ) const ( pathJournal = "api-journal-v1" pathDiscard = "api-journal-v1/discard" ) func (srv *Service) Discard(events *[]string) error { rq, _ := http.NewRequest("GET", srv.url(pathDiscard), nil) q := rq.URL.Query() rq.URL.RawQuery =...
package arachne import ( "bytes" "fmt" "io" "io/ioutil" "net/http" "net/url" "golang.org/x/xerrors" ) // Request is a domain model that represents http request. type Request struct { URL string Method string Header http.Header Body []byte Priority int64 QueueName string Meta ...
// SPDX-License-Identifier: Unlicense OR MIT package gl type ( Attrib uint Enum uint ) const ( ACTIVE_TEXTURE = 0x84E0 ALL_BARRIER_BITS = 0xffffffff ARRAY_BUFFER = 0x8892 ARRAY_BUFFER_BINDING = 0x8894 BACK ...
/* * 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 t...
/* Copyright SecureKey Technologies Inc. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package service import ( "context" "fmt" "net/http" "net/url" "time" "github.com/ThreeDotsLabs/watermill/message" "github.com/trustbloc/sidetree-core-go/pkg/restapi/common" "github.com/trustbloc/orb/pkg/act...
package main import ( "context" "os" "path/filepath" "time" log "github.com/sirupsen/logrus" v1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" _ "k8s.io/client-go/plugin/pkg/client/auth/oidc" "github.com/Comcast/kuberhealthy/v2/pkg/kubeClient" ) // kubeCo...
/** * Copyright 2015 Comcast Cable Communications Management, LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required...
package main import ( "fmt" "image" "github.com/nsf/termbox-go" game "github.com/gitchander/go2048" ) type animationInfo struct { inProgress bool start float64 duration float64 // seconds current float64 } func (ai *animationInfo) done() bool { return !(ai.inProgress) } type Drawer struct { sc...
// pmm-agent // Copyright 2019 Percona LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agr...
// Copyright 2016 The Gosl 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 gm import ( "math" "github.com/cpmech/gosl/chk" "github.com/cpmech/gosl/num" ) // BezierQuad implements a quadratic Bezier curve // C(t) = (1-t...
package oauth2 import ( //"fmt" "encoding/json" //"log" "net/http" "time" mpo "github.com/chanxuehong/wechat.v2/mp/oauth2" o "github.com/chanxuehong/wechat.v2/oauth2" mu "github.com/jim3ma/tidy/models/user" mwu "github.com/jim3ma/tidy/models/wechat" svcuser "github.com/jim3ma/tidy/services/user" util "gith...
// Copyright 2017-2019, Square, Inc. package cmd import ( "fmt" "strings" "github.com/square/spincycle/proto" "github.com/square/spincycle/spinc/app" "github.com/square/spincycle/spinc/prompt" ) type Start struct { ctx app.Context // -- reqName string requiredArgs []prompt.Item optionalArgs []prompt....
// 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 obj import ( "bytes" "cmd/internal/goobj" "cmd/internal/sys" "internal/testenv" "io/ioutil" "os" "os/exec" "path/filepath" "testing" "unsafe"...
// Copyright <NAME> 2015 see licence file // Usage: go run tgotests.go package main import ( "fmt" "os/exec" "runtime" "sort" "strings" "sync" "sync/atomic" ) var parallelism = 1 + runtime.NumCPU()/2 // control resource usage here const groupAll = false // control grouping of tests here con...
// // Copyright (C) 2020 IBM Corporation. // // Authors: // <NAME> <<EMAIL>> // <NAME> <<EMAIL>> // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/L...
package main import ( "bufio" "bytes" "fmt" "io" "log" "os" "golang.org/x/sync/errgroup" "pault.ag/go/archive" "pault.ag/go/debian/control" ) type contentEntry struct { suite string arch string binarypkg string filename string } var manPrefix = []byte("usr/share/man/") func parseContentsEnt...
package gophervideo import ( "fmt" "time" "honnef.co/go/js/dom" "github.com/gopherjs/gopherjs/js" ) // Play the video func (p *Player) Play() { p.Video.Play() playpausePath := p.PlayPause.FirstChild().(dom.Element) playpausePath.SetAttribute("d", "M0 0v6h2v-6h-2zm4 0v6h2v-6h-2z") // if this if the first ti...
// Package rccd provides implementations to work with rccd files. package rccd // Example // rccd := rccd.Open(path) import ( "archive/zip" "crypto/x509" "io/ioutil" "bufio" "bytes" "fmt" yaml "gopkg.in/yaml.v2" "mime" "net/mail" ) // RCCD contains the data of the parsed rccd file type RCCD struct { SCA *...
package main import ( "net/http" log "github.com/sirupsen/logrus" "github.com/ARGOeu/argo-messaging/brokers" "github.com/ARGOeu/argo-messaging/config" oldPush "github.com/ARGOeu/argo-messaging/push" push "github.com/ARGOeu/argo-messaging/push/grpc/client" "github.com/ARGOeu/argo-messaging/stores" gorillaCont...
package immutc import ( "github.com/codenotary/immudb/cmd/docs/man" c "github.com/codenotary/immudb/cmd/helper" "github.com/codenotary/immudb/cmd/version" "github.com/codenotary/immudb/pkg/client" "github.com/codenotary/immudb/pkg/tc" "github.com/spf13/cobra" "github.com/spf13/cobra/doc" "github.com/spf13/pfla...
// Code generated by entc, DO NOT EDIT. package ent import ( "fmt" "strings" "time" "entgo.io/ent/dialect/sql" "github.com/willie-lin/kubeMonitor/pkg/nextserver/database/ent/k8sstatefulset" ) // K8sStatefulSet is the model entity for the K8sStatefulSet schema. type K8sStatefulSet struct { config `json:"-"` /...
package main import ( "fmt" "errors" "sync" "log" "os" "bytes" "golang.org/x/net/html" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/polly" ) const POLY = "aside" // tag used by revealjs for const DEFAULT_VOICE = "Raveena" func main() { v...
// Copyright (c) 2019 Cisco and/or its affiliates. // // 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 tunnel import ( "context" "fmt" "github.com/google/uuid" "github.com/loft-sh/devspace/helper/remote" "github.com/loft-sh/devspace/helper/util" "github.com/pkg/errors" "google.golang.org/grpc" "google.golang.org/grpc/reflection" "io" "net" "os" "strings" ) type tunnelServer struct{} var debugModeE...
package builder import ( "bytes" "crypto/md5" "encoding/base64" "github.com/cheggaaa/pb/v3" "github.com/develar/errors" "github.com/minio/minio-go/v6" "github.com/panjf2000/ants/v2" "go.uber.org/zap" "io" "os" "os/exec" "path" "path/filepath" "strings" "time" ) const bucketName = "gh-rou...
package enroll import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/service/autoscaling" "github.com/aws/aws-sdk-go/service/autoscaling/autoscalingiface" "github.com/aws/aws-sdk-go/service/iam" "github.com/aws/aws-sdk-go/service/iam/iamiface" "github.com/aws...
/* 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 not use ...
package fsdup import ( "fmt" "io" "sync" ) type fixedChunker struct { reader io.ReaderAt store ChunkStore start int64 sizeInBytes int64 chunkMaxSize int64 writeConcurrency int64 skip *manifest } func NewFixedChunker(reader io.ReaderAt, index ChunkStore, ...
package google import ( "bytes" "encoding/json" "net/http" "reflect" "regexp" "strings" "google.golang.org/api/googleapi" ) type serializableBody struct { body map[string]interface{} // ForceSendFields is a list of field names (e.g. "UtilizationTarget") // to unconditionally include in API requests. By de...
/** * Copyright (c) 2017 eBay 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 ...
// Copyright 2018 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 main import ( "context" "embed" "encoding/gob" "encoding/json" "errors" "fmt" "html/template" "image/color" "net/http" "os" "time" "github.com/apex/gateway/v2" "github.com/apex/log" jsonhandler "github.com/apex/log/handlers/json" "github.com/apex/log/handlers/text" "github.com/coreos/go-oidc/v...
package tavis import ( "context" "os" "os/signal" "time" "github.com/noriah/tavis/fftw" "github.com/noriah/tavis/portaudio" "github.com/pkg/errors" ) type Device struct { // Name is the name of the Device we want to listen to Name string // SampleRate is the rate at which samples are read SampleRate float...
package searching import ( "bytes" "context" "crypto/md5" "encoding/hex" "encoding/json" "fmt" "log" "net/http" "strings" "time" "github.com/elastic/go-elasticsearch/v8" "github.com/elastic/go-elasticsearch/v8/esapi" "github.com/sirupsen/logrus" ) // SearchRequest represents a search request on the POST...
package jwk import ( "context" "crypto" "crypto/rsa" "encoding/binary" "math/big" "github.com/lestrrat-go/blackmagic" "github.com/lestrrat-go/jwx/internal/base64" "github.com/lestrrat-go/jwx/internal/pool" "github.com/pkg/errors" ) func (k *rsaPrivateKey) FromRaw(rawKey *rsa.PrivateKey) error { k.mu.Lock()...
package main import ( "database/sql" "flag" "fmt" _ "github.com/go-sql-driver/mysql" "github.com/koding/logging" "gopkg.in/ini.v1" "net/http" "os" "time" ) var stateCache, debug bool var logger = logging.NewLogger("MySQL backend checker") type configuration struct { mysqlHost string mysqlUser stri...
// Copyright 2015-present, Cyrill @ <EMAIL> and the CoreStore contributors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unles...
package archives import ( "archive/zip" "bytes" "io/ioutil" "os" "syscall" "testing" "github.com/sirupsen/logrus" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) var testZipFileContent = []byte("test content") type charsetByte int const ( singleByte charsetByte = iota multiB...
/* Copyright 2017 Google LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software dist...
// Author - <NAME> // Student ID - G00330821 // References //----------- // https://golang.org/doc/articles/wiki/ // https://astaxie.gitbooks.io/build-web-application-with-golang/en/04.1.html //https://stackoverflow.com/questions/16841320/an-html-tag-other-than-a-textarea-where-n-is-correctly-interpreted //https:/...
package log2 import ( "bytes" "fmt" "io" "io/ioutil" "log" "runtime" "strings" "testing" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) func TestLog2(t *testing.T) { t.Parallel() cases := []struct { name string fun func(t testing.TB, l *Log) string }{ {"caller/debug...
/* Copyright © 2021 <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 acmewrapper import ( "crypto" "crypto/tls" "log" "os" "sync" "github.com/xenolf/lego/acme" ) // LoggerInterface represents anything that can Printf. type LoggerInterface interface { Printf(format string, v ...interface{}) } // Logger allows to use a custom logger for logging purposes var Logger Logge...
package scraper import ( "context" "time" horizonclient "github.com/stellar/go/clients/horizonclient" hProtocol "github.com/stellar/go/protocols/horizon" hlog "github.com/stellar/go/support/log" ) type ScraperConfig struct { Client *horizonclient.Client Logger *hlog.Entry Ctx *context.Context } // TOMLDo...
// *** 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 ecs import ( "github.com/pkg/errors" "github.com/pulumi/pulumi/sdk/go/pulumi" ) // Provides a custom Spotinst Ocean ECS Launch Spec reso...
package hcl import ( "fmt" hcl2 "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclsyntax" ) // MergeBodiesWithOverides merges several bodies into one. This is similar // implementation as the one in official library, but it overwrites attributes // that are already defined. func MergeBodiesWithOveride...
// Licensed to Elasticsearch B.V. under one or more contributor // license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright // ownership. Elasticsearch B.V. licenses this file to you under // the Apache License, Version 2.0 (the "License"); you may // not use ...
package redigo import ( "encoding/json" "errors" "fmt" "math/rand" "time" "github.com/garyburd/redigo/redis" "util" "util/loader" "util/logs" ) // type RedisConn struct { redis.Conn } // type RedisPool struct { *redis.Pool } func (this *RedisPool) Get() *RedisConn { return &RedisConn{Conn: this.Pool.G...
/* 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 i...
package base import ( "fmt" "os" "path" "path/filepath" "runtime" "strings" "sync/atomic" ) type ILogger interface { Write(msg string) } type ConsoleLogger struct { Pln bool } type FileLogger struct { FilePath string Pln bool MaxSize int size int writer *os.File filename string extname ...
package tabs import ( "errors" "path/filepath" "strings" "fyne.io/fyne/v2" "fyne.io/fyne/v2/container" "fyne.io/fyne/v2/dialog" "fyne.io/fyne/v2/theme" "fyne.io/fyne/v2/widget" nativeDialog "github.com/sqweek/dialog" backend "github.com/luciferchase/CBSE-Result-Converter/src/backend" ) // Logic behind th...
// Copyright © 2016 <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 testkeeper import ( "fmt" "github.com/arquillian/ike-prow-plugins/pkg/github" ghservice "github.com/arquillian/ike-prow-plugins/pkg/github/service" "github.com/arquillian/ike-prow-plugins/pkg/log" "github.com/arquillian/ike-prow-plugins/pkg/scm" "github.com/arquillian/ike-prow-plugins/pkg/status" "gith...
package main import ( "context" "flag" "fmt" "io/ioutil" "os" "os/signal" "strconv" "syscall" execute "github.com/asyrafduyshart/go-exec-engine/pkg/execute" "github.com/asyrafduyshart/go-exec-engine/pkg/pubsub" "github.com/go-playground/validator" log "github.com/asyrafduyshart/go-exec-engine/pkg/log" t...
package logisticregression import ( "fmt" "github.com/cdipaolo/goml/base" "github.com/cdipaolo/goml/linear" "github.com/gonum/plot" "github.com/gonum/plot/plotter" "github.com/gonum/plot/plotutil" "github.com/gonum/plot/vg" "io/ioutil" ) // ConfusionMatrix describes a confusion matrix type ConfusionMatrix str...
package header import ( "encoding/binary" "github.com/YaoZengzeng/yustack/checksum" "github.com/YaoZengzeng/yustack/types" ) const ( versIHL = 0 tos = 1 totalLen = 2 id = 4 flagsFO = 6 ttl = 8 protocol = 9 ipChecksum = 10 srcAddr = 12 dstAddr = 16 ) // IPv4Fields contains the fields of an ...
// Copyright 2021 Sylabs Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable ...
package mode import ( "context" "errors" "fmt" "regexp" "strings" "go.uber.org/zap" "github.com/migotom/mt-bulk/internal/clients" "github.com/migotom/mt-bulk/internal/entities" "github.com/migotom/mt-bulk/internal/vulnerabilities" ) // SecurityAudit is an operation performing security audit of device. func...
package main import ( "fmt" "image/color" "fyne.io/fyne" "fyne.io/fyne/app" "fyne.io/fyne/canvas" "fyne.io/fyne/widget" "github.com/notnil/chess" "github.com/notnil/chess-ui/stockfish" ) var ( boardRes fyne.Resource pieceResources map[chess.Piece]fyne.Resource pieces = []chess.Piece{ chess...
package conf import ( "flag" "os" "strconv" "time" "github.com/bilibili/discovery/naming" xtime "github.com/Terry-Mao/goim/pkg/time" "github.com/BurntSushi/toml" ) var ( confPath string region string zone string deployEnv string host string weight int64 // Conf config Conf *Config ...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: storage.proto package msgs import ( fmt "fmt" proto "github.com/golang/protobuf/proto" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf // This is a compile-t...
package realip import ( "errors" "net" "net/http" "strings" ) //Copied from https://github.com/Ferluci/fasthttp-realip/ // Should use canonical format of the header key s // https://golang.org/pkg/net/http/#CanonicalHeaderKey // Header may return multiple IP addresses in the format: "client IP, proxy 1 IP...
/* * Copyright 2020 The Knative Authors * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agree...
package oa import ( "encoding/json" "github.com/shenghui0779/gochat/urls" "github.com/shenghui0779/gochat/wx" ) type TemplateContent struct { Controls []*TemplateControl `json:"controls"` } type TemplateControl struct { Property *ControlProperty `json:"property"` Config *ControlConfig `json:"config"` } t...
/* 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 not use this fi...
/* Copyright SecureKey Technologies Inc. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 */ package couchdbstore import ( "encoding/json" "fmt" "time" "github.com/hyperledger/fabric/common/flogging" "github.com/hyperledger/fabric/core/ledger/util/couchdb" "github.com/pkg/errors" "github.com/trustbloc...
// +k8s:deepcopy-gen=package package v1 import ( "net/http" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // +genclient // +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object // +kubebuilder:object:root=true // +k8s:deepcopy-gen=true // +kubebuilder:resource:categories="all",shortName=rg;rgs //...
package goladok3 import ( "context" "fmt" "github.com/masv3971/goladok3/ladoktypes" ) // CheckPermission compare ladok permissions with ps func (c *Client) CheckPermission(ctx context.Context, myPermissions Permissions) error { ctx, span := c.tp.Start(ctx, "goladok3.CheckPermission") defer span.End() var ( ...
/* Copyright 2019 <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 server import ( "context" "io/ioutil" "net/http" "sync" "time" "github.com/gorilla/websocket" "github.com/keys-pub/keys" "github.com/labstack/echo/v4" "github.com/pkg/errors" ) // PubSub ... type PubSub interface { Publish(ctx context.Context, name string, b []byte) error Subscribe(ctx context.Con...
package main import ( "bufio" "fmt" "io/ioutil" "os" "sort" "strings" "github.com/macroblock/imed/pkg/cli" "github.com/macroblock/imed/pkg/misc" "github.com/macroblock/imed/pkg/tagname" "github.com/macroblock/imed/pkg/zlog/loglevel" "github.com/macroblock/imed/pkg/zlog/zlog" ) var ( log = zlog.Inst...
/* Copyright 2021 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 types import ( "bytes" "math/big" "github.com/minio/blake2b-simd" "github.com/filecoin-project/specs-actors/actors/abi" "github.com/filecoin-project/specs-actors/actors/crypto" block "github.com/ipfs/go-block-format" "github.com/ipfs/go-cid" "github.com/multiformats/go-multihash" xerrors "golang.or...
package providers import ( "context" "crypto/tls" "net/http" "time" "github.com/flanksource/commons/logger" "github.com/flanksource/karina-ui/pkg/api" "github.com/pkg/errors" prometheusapi "github.com/prometheus/client_golang/api" v1 "github.com/prometheus/client_golang/api/prometheus/v1" "github.com/promet...
package main import ( "crypto/hmac" "crypto/sha512" "encoding/hex" "encoding/json" "errors" "fmt" "net/http" "reflect" "strings" "sync" "time" "github.com/go-redis/redis" metrics "github.com/rcrowley/go-metrics" log "github.com/sirupsen/logrus" ) // credentials are used by basic auth and include the ha...
// Copyright (c) 2022 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 publicdns contains mapping and helpers for working with // public DNS providers. package publicdns import ( "sync" "inet.af/netaddr" ...
package main import ( "context" "flag" "fmt" "log" "net" "net/http" "os" "os/signal" "runtime" "strings" "sync" "github.com/mattn/go-colorable" "github.com/mdp/qrterminal" ) var zipFlag = flag.Bool("zip", false, "zip the contents to be transfered") var forceFlag = flag.Bool("force", false, "ignore saved...
package qemu import ( "bufio" "bytes" "fmt" "io" "log" "os/exec" "regexp" "strings" "sync" "syscall" "time" "unicode" "github.com/mitchellh/multistep" ) type DriverCancelCallback func(state multistep.StateBag) bool // A driver is able to talk to qemu-system-x86_64 and perform certain // operations with...
package nutanix import ( "context" "fmt" "log" "strings" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" v3 "github.com/terraform-providers/terraform-provider-nutanix/client/v3" "github.com/terraform-providers/terraform-provider-nutanix/utils" )...
// Package app provides the command line applications commands. package app // Imports import ( "bytes" "crypto/tls" "encoding/json" "fmt" "net/http" "os" "path" "time" "github.com/mattrmiller/go-mana-test/console" "github.com/mattrmiller/go-mana-test/manatest" "gopkg.in/resty.v1" ) // AppTest structure h...
package internal import ( "bytes" "text/template" "github.com/atotto/clipboard" "github.com/gizak/termui" "github.com/shopspring/iblameyou/widgets" "github.com/toqueteos/webbrowser" ) type UI struct { format *Format widgets struct { commit *termui.Par stackTrace *widgets.ScrollableList messages ...
package project import ( "fmt" "strings" "github.com/bazelbuild/bazel-gazelle/rule" bzl "github.com/bazelbuild/buildtools/build" "github.com/samhowes/rules_msbuild/gazelle/dotnet/util" ) func (p *Project) GenerateRule(f *rule.File) *rule.Rule { var kind string if p.IsTest { kind = "msbuild_test" } else if ...
// // import RPi.GPIO as GPIO // // import time // // GPIO.setmode(GPIO.BCM) // // TRIG = 23 // // ECHO = 24 // // print "Distance Measurement In Progress" // // GPIO.setup(TRIG,GPIO.OUT) // // GPIO.output(TRIG,0) // // GPIO.setup(ECHO,GPIO.IN) // // time.sleep(0.1) // // print "Stargin measurement" // // GPIO....
package config import ( "os" "errors" "fmt" "path/filepath" "strings" "os/exec" "io/ioutil" "regexp" "github.com/vaughan0/go-ini" ) // FileParser 文件解析 type FileParser struct { Path string Debug bool Version string } var ( // 文件没有找到的错误 ErrFileNotExist = errors.New("file not exist") ) const (...
package kauth import ( "context" "crypto/rand" "crypto/sha256" "encoding/base64" "encoding/hex" "encoding/json" "errors" "fmt" "net/http" "net/url" "strings" "github.com/gotomicro/ego/core/elog" "github.com/jmespath/go-jmespath" "github.com/spf13/cast" "golang.org/x/oauth2" "github.com/gotomicro/cetu...
package bid_action import ( "encoding/json" "time" "github.com/Oneledger/protocol/action/helpers" "github.com/Oneledger/protocol/external_apps/bid/bid_data" "github.com/pkg/errors" "github.com/tendermint/tendermint/libs/kv" "github.com/Oneledger/protocol/action" "github.com/Oneledger/protocol/data/keys" ) ...
//Implementation of a simple peer to peer chat application using //the net/http package for communication. package main import ( "bufio" "bytes" "encoding/json" "flag" "fmt" "log" "net" "net/http" "strings" "os" ) // Instances of Msg store the transmited message and its source peer data type Msg st...
// Unless explicitly stated otherwise all files in this repository are licensed // under the Apache License Version 2.0. // This product includes software developed at Datadog (https://www.datadoghq.com/). // Copyright 2017 Datadog, Inc. package processor import ( "math" "regexp" "strings" "testing" "time" "gi...
// Copyright (c) 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 jsrouter implements the router.Provider interface and wraps the julienschmidt.httprouter. // // All router params are getting set to the reques...
package main import ( "encoding/json" "flag" "fmt" "net/http" "os" "regexp" "strconv" "strings" "golang.org/x/net/html" ) const ( // the max font size used for format-pretty spaces maxFontSize = 12 // the base url for knights baseURL = "http://www.knightsrestaurants.com/specials/" ) // regex to calcul...
package echologrus import ( "bytes" echo "github.com/labstack/echo/v4" "github.com/labstack/gommon/log" "github.com/sirupsen/logrus" "io" "io/ioutil" "strconv" "time" ) //Make new EchoLogger struct with new logrus struct. func New() EchoLogger { return EchoLogger{logrus.New()} } //Make and attach it to echo...
package fastlimiter import ( "errors" "sync" "time" ) //Options ... type Options struct { Prefix string Max int CleanDuration time.Duration Duration time.Duration } type statusCacheItem struct { index int expire time.Time } // LimiterCacheItem of limiter type limi...
package client import ( "errors" "fmt" "sync" "sync/atomic" "time" "github.com/lindb/client_go/config" "github.com/lindb/lindb/pkg/logger" "github.com/lindb/lindb/pkg/stream" "github.com/lindb/lindb/pkg/timeutil" "github.com/lindb/lindb/rpc/proto/field" ) var ( // errClientClosed is the error returned whe...
package claimsstore_test import ( "encoding/json" "testing" "time" "github.com/jinzhu/gorm" "github.com/jinzhu/gorm/dialects/postgres" "github.com/joincivil/go-common/pkg/article" "github.com/joincivil/id-hub/pkg/claimsstore" "github.com/joincivil/id-hub/pkg/claimtypes" "github.com/joincivil/id-hub/pkg/did/e...