text stringlengths 3.08k 10.4k |
|---|
package gated
import (
"bufio"
"bytes"
"fmt"
"math/bits"
"net/http"
"reflect"
"sort"
"sync"
"time"
"github.com/hexian000/gated/proto"
"github.com/hexian000/gated/version"
)
func formatAgo(now, last time.Time) string {
if last == (time.Time{}) {
return "(never)"
}
return fmt.Sprintf("%v (%v ago)", las... |
package service
import (
"context"
"encoding/json"
"go-common/app/job/live/push-search/model"
"go-common/library/log"
"go-common/library/sync/errgroup"
"strconv"
)
const (
_retry = 3
)
func (s *Service) attentionNotifyConsumeProc() {
defer s.waiter.Done()
for {
msg, ok := <-s.dao.AttentionDataBus.Messages... |
package main
import (
"fmt"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
v1 "github.com/prometheus/client_golang/api/prometheus/v1"
"github.com/prometheus/common/promlog"
"github.com/prometheus/common/promlog/flag"
"github.com/prometheus/common/version"
"gopkg.in/alecthomas/kingpin.v2"
"math/... |
// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable... |
package ui
import (
"fmt"
"git.kirsle.net/go/render"
"git.kirsle.net/go/ui/theme"
)
// MenuButton is a button that opens a menu when clicked.
//
// After creating a MenuButton, call AddItem() to add options and callback
// functions to fill out the menu. When the MenuButton is clicked, its menu
// will be drawn a... |
/*
Package commons contains the common resources that are to be shared by other packages
in the application - in order to avoid a cyclic dependencies, these resources are moved
under this package.
*/
package commons
import (
"errors"
"os"
"regexp"
"strings"
log "github.com/sirupsen/logrus"
)
/*
UserInput is a s... |
package main
import (
"archive/zip"
"encoding/json"
"io"
"math/rand"
"net/http"
"os"
"strconv"
"strings"
"time"
)
type suffixMultiplier struct {
suffix string
multiplier float64
}
var sizeSuffixes []suffixMultiplier = []suffixMultiplier{
{"kib", 1024}, {"kb", 1024}, {"ki", 1024}, ... |
package main
import (
"fmt"
"os"
"strings"
wzd_runner "github.com/infra-whizz/wzd/runner"
"github.com/sirupsen/logrus"
wzlib_logger "github.com/infra-whizz/wzlib/logger"
wzlib_utils "github.com/infra-whizz/wzlib/utils"
"github.com/infra-whizz/wzd"
"github.com/isbm/go-nanoconf"
"github.com/urfave/cli/v2"
)... |
package sync
import (
"context"
"fmt"
"os"
"strconv"
"sync"
"time"
"github.com/testground/sdk-go/runtime"
"github.com/go-redis/redis/v7"
"go.uber.org/zap"
)
const (
RedisPayloadKey = "p"
EnvRedisHost = "REDIS_HOST"
EnvRedisPort = "REDIS_PORT"
)
// ErrNoRunParameters is returned by the generic client w... |
package goenv
import (
"net/url"
"reflect"
"testing"
"time"
)
type ts struct {
TestBool bool
TestInt int
TestInt64 int64
TestUint uint
TestUint64 uint64
TestString string
TestFloat64 float64
TestDuration time.Duration
TestURL url.URL
TestStrings []string
}
func TestDefault(t ... |
package drbuffer
import (
"bufio"
"bytes"
"fmt"
"reflect"
"runtime"
"strings"
"testing"
"unicode"
"unicode/utf8"
)
type Assert func(left interface{}, op string, right interface{})
func NewAssert(t *testing.T) Assert {
return func(left interface{}, op string, right interface{}) {
switch op {
case "==":
... |
// Copyright 2016 Keybase Inc. All rights reserved.
// Use of this source code is governed by a BSD
// license that can be found in the LICENSE file.
package client
import (
"crypto/sha256"
"encoding/json"
"errors"
"io"
"io/ioutil"
"os"
"os/exec"
"path"
"search/prototype/indexer"
"search/prototype/server"
... |
package main
import (
"bufio"
"container/list"
"fmt"
"io"
"strings"
)
type Parser struct {
state stateFunc
seenPackage bool
inComment bool
parseSubs map[string]string
patStack *list.List
scNext int
res *LexFile
curRule LexRule
curAction string
appendNextAction bool
... |
package main
import (
"bufio"
"bytes"
"encoding/json"
"flag"
"fmt"
"log"
"net"
"net/http"
"os"
)
// DOMAIN MODEL
// ChatMsg represents a message
type ChatMsg struct {
Message string
From Peer
}
// Peer represents a other chat user and machine
type Peer struct {
Name string
Address string
}
// Pe... |
package registry
import (
"fmt"
"runtime/debug"
"sync"
"github.com/moleculer-go/moleculer"
"github.com/moleculer-go/moleculer/service"
"github.com/moleculer-go/moleculer/strategy"
log "github.com/sirupsen/logrus"
)
type EventEntry struct {
targetNodeID string
service *service.Service
event *ser... |
package syncer
import (
"github.com/DSiSc/craft/log"
"github.com/DSiSc/craft/types"
"github.com/DSiSc/p2p"
"github.com/DSiSc/p2p/message"
"github.com/DSiSc/repository"
"github.com/DSiSc/syncer/common"
"sync"
"time"
)
// BlockSyncer block synchronize program
type BlockSyncer struct {
blockSyncChan chan interf... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: saas.proto
/*
Package saas is a generated protocol buffer package.
It is generated from these files:
saas.proto
It has these top-level messages:
Empty
GenerateResponse
*/
package saas
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
impo... |
// Copyright 2016 fatedier, <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 or agreed ... |
package parser
import (
"fmt"
"unicode"
"unicode/utf8"
)
type token struct {
typ tokenType
val string
}
func (t token) String() string {
switch {
case t.typ == tokenEOF:
return "EOF"
case t.typ == tokenError:
return t.val
case t.typ > tokenKeyword:
return fmt.Sprintf("<%s>", t.val)
// case len(t.val... |
package completion
import (
"bytes"
"context"
"fmt"
"os"
"path/filepath"
"strings"
"unicode"
"github.com/zetamatta/go-box"
"github.com/zetamatta/nyagos/readline"
)
type Element struct {
InsertStr string
ListupStr string
}
type List struct {
AllLine string
List []Element
RawWord string // have quot... |
package main
import (
"encoding/hex"
"encoding/json"
"io/ioutil"
"log"
"math/rand"
"net"
"net/http"
"os"
"os/exec"
"regexp"
"strconv"
"strings"
"time"
"github.com/gorilla/mux"
)
const (
serverPort = 1337
version = 00000000
)
// Server structure
type Server struct {
IP string `json:"ip"`
Por... |
package rv
import (
"fmt"
"reflect"
"strconv"
"strings"
)
type FieldHandlerCreator func(args []string) (FieldHandler, error)
type FieldHandler interface {
Run(Request, *Field)
}
type PrecidenceFieldHandler interface {
FieldHandler
Precidence() int
}
type Field struct {
Value interface{}
Errors []error
}
... |
package main
import (
"bytes"
"encoding/base64"
"encoding/json"
"fmt"
"net/http"
"net/mail"
"net/smtp"
"os"
"sort"
"time"
owm "github.com/briandowns/openweathermap"
"github.com/gincorp/gin/taskmanager"
)
type financeitem struct {
Name, Price string
}
type newsitem struct {
Timestamp time.Time
Title ... |
package devsim
import (
log "github.com/Sirupsen/logrus"
"github.com/nu7hatch/gouuid"
"sync"
)
// Simulator goroutine waitgroup
var swg sync.WaitGroup
// Wait for all simulator to be done, only if simulator are running
func WaitSimulators() {
swg.Wait()
}
func InitSimulator(r Reader, w Writer, s Simulation, op... |
// Copyright 2017 longXboy, <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 or agreed ... |
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX - License - Identifier: Apache - 2.0
// snippet-start:[s3.go-v2.ListBuckets]
package main
import (
"context"
"errors"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/... |
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net"
"net/http"
"strings"
)
// Lookup hosts for "spec" from mesos leader "mesos". Write any output to msgs.
func GetHosts(mesos, spec string, msgs *log.Logger) ([]string, error) {
if spec == "masters" {
return getMasters()
}
if spec ... |
// Copyright (c) 2013 Couchbase, Inc.
// parsec also supplies a basic set of token parsers
// that can be used to create higher order parser using
// one of the many combinators.
package parsec
import "fmt"
import "strings"
import "strconv"
import "unicode"
import "unicode/utf8"
import "unicode/utf16"
var _ = fmt.... |
package core
import (
"database/sql"
"log"
"net/url"
"sync"
"time"
"github.com/cavaliergopher/grab/v3"
_ "github.com/lib/pq"
"github.com/pkg/errors"
"github.com/Bnei-Baruch/mdb-fs/common"
"github.com/Bnei-Baruch/mdb-fs/fetch"
)
type Syncer interface {
GetFS() *Sha1FS
DoSync()
AugmentMDBToIndex(idx map[... |
package main
import (
"bytes"
"crypto/hmac"
"crypto/rand"
"crypto/sha1"
"encoding/base64"
"fmt"
"net/url"
"regexp"
"sort"
"strings"
"time"
_ "github.com/go-sql-driver/mysql"
)
var HeaderKeys = [8]string{"oauth_consumer_key", "oauth_callback", "oauth_nonce", "oauth_signature", "oauth_sig... |
package paystack
import (
"encoding/json"
"time"
)
type WebhookObject struct {
Event string `json:"event"`
Data json.RawMessage `json:"data"`
}
type WHCustomerIdentification struct {
CustomerId int `json:"customer_id"`
CustomerCode string `json:"customer_code"`
Email string `json:"e... |
package web
import (
"context"
"fmt"
"net/http"
"time"
"go.charczuk.com/sdk/errutil"
"go.charczuk.com/sdk/logutil"
"go.charczuk.com/sdk/viewfuncs"
)
// New returns a new app with defaults configured and applies
// a given set of options to it.
//
// You can alternately use the `app := new(App)` form but it's
... |
/*
MIDI messages are comprised of two components: commands and data bytes.
The command byte tells the MIDI instrument what type of message is being
sent and the subsequent data byte(s) store the actual data. For example
a command byte might tell a MIDI instrument that it going to send information
about pitchbend, and ... |
package cli
import (
"archive/tar"
"archive/zip"
"bytes"
"compress/gzip"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"runtime"
"strings"
"github.com/blang/semver"
update "github.com/inconshreveable/go-update"
"github.com/lpmatos/loli/api"
"github.com/lpmatos/loli/internal/constants"
"github.com/lpmatos/loli... |
package lib
import (
"encoding/json"
"fmt"
"github.com/deweysasser/locksmith/data"
"os"
"reflect"
"testing"
"time"
)
type entry struct {
Id, Content string
}
func (e *entry) IdString() string {
return e.Id
}
func createEntry(id string, bytes []byte) (interface{}, error) {
e := new(entry)
err := json.Unma... |
// Copyright 2015 PingCAP, 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 i... |
// Create a simulator to test out big money strategy.
package main
import (
"container/heap"
"flag"
"fmt"
"log"
"math/rand"
"os"
"runtime/pprof"
"sort"
"strings"
)
var cpuprofile = flag.String("cpuprofile", "", "Path to profile file")
var numiter = flag.Int("numiter", 10, "Number of iterations to run")
type... |
/*
read all addresses
for all addresses:
get 1 address
until the end of transactions:
get 1k addresses
for all addresses:
get 1 transaction
check if it has swaps
get input info
get output info
get transaction info from etherscan
... |
package testcase
import (
"fmt"
"math/rand"
"testing"
"time"
"github.com/adamluzsi/testcase/assert"
"github.com/adamluzsi/testcase/random"
"github.com/adamluzsi/testcase/internal"
)
// NewT returns a *testcase.T prepared for the given testing.TB
func NewT(tb testing.TB, spec *Spec) *T {
if tb == nil {
ret... |
package main
import (
"FlamingoV2/flamingolog"
"FlamingoV2/flamingoservice"
"flag"
"log"
"os"
"os/signal"
"strings"
"syscall"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/cloudwatch"
"github.... |
package services
import (
"crypto/tls"
"errors"
"strings"
"time"
log "github.com/Sirupsen/logrus"
"github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/pkg/transport"
"golang.org/x/net/context"
)
func NewWithOutTLS(endpoints string) (*Store, error) {
client, err := clientv3.New(clientv3.Config{
Endpoi... |
package dispatcher
import (
"errors"
"fmt"
"time"
"github.com/sergiorra/drone-simulation/internal/models/command"
"github.com/sergiorra/drone-simulation/internal/models/report"
"github.com/sergiorra/drone-simulation/internal/models/route"
"github.com/sergiorra/drone-simulation/internal/models/station"
"github... |
// Copyright 2018 The MATRIX Authors as well as Copyright 2014-2017 The go-ethereum Authors
// This file is consisted of the MATRIX library and part of the go-ethereum library.
//
// The MATRIX-ethereum library is free software: you can redistribute it and/or modify it under the terms of the MIT License.
//
// Permissi... |
package main
import (
"bufio"
"bytes"
"encoding/json"
"flag"
"fmt"
"log"
"math"
"math/rand"
"net/http"
"regexp"
"strings"
"time"
)
var internalURL = flag.String("internal-timberlake-url", "http://localhost:8000", "The internal HTTP URL the bot should use to access timberlake.")
var timberlakeURL = flag.St... |
// +build windows
package serial
import (
"fmt"
"os"
"sync"
"syscall"
"time"
"unsafe"
)
type Port struct {
f *os.File
fd syscall.Handle
rl sync.Mutex
wl sync.Mutex
ro *syscall.Overlapped
wo *syscall.Overlapped
}
type structDCB struct {
DCBlength, BaudRate uint32
flags ... |
// 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 wri... |
package magic
import (
"reflect"
"strconv"
)
// Read tries to magically return a fully populated objet of the same type as
// you whished. It does this by allocating a new object, taking input src from
// the current cursor position and writing it to the object's memory address.
// This works for primitive types, s... |
package main
import (
"context"
"encoding/json"
"fmt"
cloudevents "github.com/cloudevents/sdk-go/v2"
"github.com/google/uuid"
"github.com/gorilla/mux"
"github.com/robfig/cron/v3"
"log"
"net/http"
"os"
"strconv"
)
var SINK = getEnv("SINK", "http://localhost:8080/events")
var SERVER_PORT = getEnv("SERVER_PO... |
package syslogtls
import (
"bytes"
"crypto/ecdsa"
"crypto/ed25519"
"crypto/rand"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"crypto/x509/pkix"
"encoding/base64"
"encoding/pem"
. "github.com/smartystreets/goconvey/convey"
syslog2 "github.com/trevorlinton/remote_syslog2/syslog"
"io"
"log"
"math/big"
"net"
... |
package reader
import (
"errors"
"fmt"
"github.com/jotitan/music_server/logger"
"net/http"
"time"
)
type Playlist struct{
musics []musicLink
currentMusic int
}
type musicLink struct {
idMusic int
path string
}
func NewPlaylist()*Playlist {
return &Playlist{make([]musicLink,0),-1}
}
func (pl * Playlist)Ha... |
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package integration
import (
"bytes"
"io/ioutil"
"os"
"testing"
"github.com/golang/protobuf/proto"
cb "github.com/mcc-github/blockchain-protos-go/common"
"github.com/mcc-github/blockchain-protos-go/msp"
pb "github.com/mcc-git... |
/*
Copyright 2022.
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 un... |
// Code generated by the Pulumi Terraform Bridge (tfgen) Tool DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package harvester
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// ## Example Usage
//
// ```go
// package main
//
// ... |
package charts
import (
"context"
"fmt"
"io"
"log"
"strings"
"time"
"github.com/wzshiming/profile_stats"
"github.com/wzshiming/profile_stats/generator/charts/render"
placeholder_render "github.com/wzshiming/profile_stats/generator/placeholder/render"
"github.com/wzshiming/profile_stats/source"
"github.com/... |
// Copyright 2019 Samaritan Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... |
package main
// The imports
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/smtp"
"net/url"
"os"
"strings"
)
// Constants
const (
// The URL to validate reCAPTCHA
recaptchaURL = "https://www.google.com/recaptcha/api/siteverify"
)
// Variables
var (
// The reCAPTCHA Secret Token
recapt... |
package caddyvault
import (
"encoding/json"
"errors"
"fmt"
"os"
"strings"
"time"
"github.com/caddyserver/caddy/caddytls"
"github.com/mholt/certmagic"
"github.com/siva-chegondi/caddyvault/utils"
)
const (
defaultPrefix = "caddycerts"
loadURL = "/v1/" + defaultPrefix + "/data/"
listURL = "/v1/"... |
/**
* 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... |
package ipmi
import (
"fmt"
)
// 13.22 RAKP Message 3
type RAKPMessage3 struct {
// Selected by remote console. Used by remote console to help match
// responses up with requests.
MessageTag uint8
// Identifies the status of the previous message.
RmcpStatusCode uint8
// The Managed System's Session ID for th... |
package hashtree
import (
"fmt"
"io"
"reflect"
"sync"
"github.com/hashicorp/golang-lru/simplelru"
"github.com/pachyderm/pachyderm/src/server/pkg/localcache"
"github.com/sirupsen/logrus"
)
type seedling struct {
cond *sync.Cond
err error
}
// Cache is an LRU cache for hashtrees.
type Cache struct {
lruCac... |
/*
Implements the solution to assignment 1 for UBC CS 416 2017 W2.
Usage:
$ go run client.go [local UDP ip:port] [local TCP ip:port] [aserver UDP ip:port]
Example:
$ go run client.go 127.0.0.1:2020 127.0.0.1:3030 127.0.0.1:7070
*/
package main
import (
"crypto/md5"
"encoding/hex"
"encoding/json"
"fmt"
"math"
... |
package zap
import (
"bytes"
"io"
"log"
"net/http"
"strings"
"sync"
"time"
"github.com/moomerman/zap/adapter"
"github.com/moomerman/zap/adapter/proxy"
"github.com/moomerman/zap/ngrok"
"github.com/vektra/errors"
)
var appsMu sync.Mutex
var apps map[string]*app
// app holds the state of a running Applicati... |
package wmanager
import (
"context"
"errors"
"fmt"
"os"
"runtime"
"sync"
"time"
)
var (
ErrTimeoutExit = errors.New("raise timeout exit")
errRaisePanic = errors.New("raise panic")
panicDelay = time.Duration(3 * time.Second)
deferLogger Logger = new(loggerImpl)
)
const (
StatusPending = iota
StatusRun... |
package app
import (
"fmt"
"io"
"io/ioutil"
"os"
"strings"
"time"
"github.com/IPA-CyberLab/kmgm/action"
"github.com/IPA-CyberLab/kmgm/cmd/kmgm/issue"
"github.com/IPA-CyberLab/kmgm/cmd/kmgm/list"
"github.com/IPA-CyberLab/kmgm/cmd/kmgm/remote"
"github.com/IPA-CyberLab/kmgm/cmd/kmgm/serve"
"github.com/IPA-Cy... |
package archive
import (
"errors"
"io"
"os"
"path/filepath"
"strings"
)
//a common interface to tar/zip/gzip/rar
type Writer interface {
AddEmptyDir(relPath string, perm os.FileMode) error
AddReader(info os.FileInfo, r io.Reader, relPath string) error
Close() error
}
type Reader interface {
ExtractTo(dest s... |
/*
* MinIO Cloud Storage, (C) 2015, 2016, 2017, 2018 MinIO, 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 require... |
package rpch
import (
"errors"
"io"
"io/ioutil"
"log"
"net"
"reflect"
"sync"
"time"
)
type Server struct {
ReadTimeOut time.Duration
WriteTimeOut time.Duration
services sync.Map
}
var DefaultServer = NewServer()
func NewServer() *Server {
return &Server{
ReadTimeOut: 10 * time.Second,
WriteTim... |
package hoverfly
import (
"encoding/json"
"fmt"
"net/url"
"os"
"path"
"regexp"
"strings"
"io/ioutil"
"net/http"
log "github.com/Sirupsen/logrus"
"github.com/SpectoLabs/hoverfly/core/handlers/v2"
"github.com/SpectoLabs/hoverfly/core/models"
)
// Import is a function that based on input decides whether it... |
// +build ignore
package main
import (
"bytes"
"errors"
"fmt"
"go/format"
"io/ioutil"
"log"
"os"
"path/filepath"
"regexp"
"strconv"
"strings"
)
var (
rxpHashName = regexp.MustCompile(`static const char \*HASH_NAME\s+=\s+\"(.*?)\";`)
rxpKernelType = regexp.MustCompile(`static const u64\s+KERN_TYPE\s+... |
// Copyright 2016 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... |
// Copyright 2022 xgfone
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writi... |
package commands
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strconv"
"testing"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
cfg "github.com/Alex-duzhichao/tendermint/config"
"github.com/Alex-duzhichao/te... |
/*
Copyright 2020. Huawei Technologies Co., Ltd. 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... |
/*
* Copyright 2018, Automatic Inc.
* All rights reserved.
*
* Author: <NAME>
*/
package taskhawk
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/satori/go.uuid"
)
// ITaskRegistry is an interface for the task registry to manage tasks
type ITaskRegistry interface {
// DispatchWithPriority... |
package v1
import (
"fmt"
"math"
"time"
flow "github.com/mydexchain/tendermint0/libs/flowrate"
"github.com/mydexchain/tendermint0/libs/log"
"github.com/mydexchain/tendermint0/p2p"
"github.com/mydexchain/tendermint0/types"
)
//--------
// Peer
// BpPeerParams stores the peer parameters that are used when crea... |
// Copyright (c) 2012-2015 <NAME>. All rights reserved.
// Use of this source code is governed by a MIT license found in the LICENSE file.
package codec
import (
"bufio"
"errors"
"io"
"net/rpc"
"sync"
)
// Rpc provides a rpc Server or Client Codec for rpc communication.
type Rpc interface {
ServerCodec(conn io... |
// Copyright 2015 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 healer
import (
"encoding/json"
"fmt"
"time"
"github.com/pkg/errors"
"github.com/tsuru/config"
"github.com/tsuru/tsuru/app"
"github.com/tsuru/ts... |
package eagle
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 (
celiaBirthday = nook.Birthday{
Day: 25,
Month... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package cloudwatchlogs
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type StartQueryInput struct {
_ struct{} `type:"structure"`
// The end of the time range to query. The range is in... |
// Contains the implementation of a LSP server.
package lsp
import (
"encoding/json"
"errors"
"fmt"
"lspnet"
"strconv"
"sync"
"time"
)
const MAXN=1000
type server struct {
Clis map[int]*client
Conn_Cnt int
Seqs []int
ConnMap map[string]int
close_converge chan int
close_read chan int
LiveMsg chan *Messa... |
package client
import (
"context"
"crypto"
"crypto/tls"
"crypto/x509"
"fmt"
"time"
"github.com/plgd-dev/device/client/core"
"github.com/plgd-dev/device/client/core/otm"
justworks "github.com/plgd-dev/device/client/core/otm/just-works"
"github.com/plgd-dev/device/client/core/otm/manufacturer"
pkgError "gith... |
// Copyright 2016 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, ... |
// Copyright (c) 2016 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge... |
//
// Author:: <NAME> <<EMAIL>>
// Copyright:: Copyright 2017, Chef Software Inc.
//
package mock
import (
"context"
"time"
"github.com/chef/automate/components/config-mgmt-service/backend"
)
// This Mock backend is a very simple model of how a backend client should look
// like when implementing the `backend.... |
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package describe
import (
"bytes"
"encoding/json"
"fmt"
"github.com/aws/copilot-cli/internal/pkg/docker/dockerengine"
"text/tabwriter"
cfnstack "github.com/aws/copilot-cli/internal/pkg/deploy/cloudforma... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: flow/entities/event.proto
package entities
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
// Thi... |
package dnsserver
import (
"context"
"crypto/tls"
"fmt"
"net"
"net/http"
"strconv"
"time"
"github.com/coredns/caddy"
"github.com/coredns/coredns/plugin/pkg/dnsutil"
"github.com/coredns/coredns/plugin/pkg/doh"
"github.com/coredns/coredns/plugin/pkg/response"
"github.com/coredns/coredns/plugin/pkg/reuseport... |
package kind
import (
"fmt"
"regexp"
"github.com/hashicorp/terraform/states/statefile"
"github.com/kyma-incubator/hydroform/provision/internal/errs"
"github.com/kyma-incubator/hydroform/provision/internal/operator"
terraform_operator "github.com/kyma-incubator/hydroform/provision/internal/operator/terraform"
"... |
// Copyright 2015, Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package topoproto contains utility functions to deal with the proto3
// structures defined in proto/topodata.
package topoproto
import (
"fmt"
"sort"
"strco... |
/*
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 (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"os"
"strings"
"time"
log "github.com/sirupsen/logrus"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/version"
"github.com/trustp... |
package cmd
import (
"context"
"fmt"
"os"
"os/signal"
"strings"
"syscall"
"time"
"github.com/danesparza/cloudjournal/cloudwatch"
"github.com/danesparza/cloudjournal/data"
"github.com/danesparza/cloudjournal/journal"
"github.com/danesparza/cloudjournal/system"
"github.com/danesparza/cloudjournal/token"
lo... |
package business
import (
"fmt"
"strings"
"sync"
"github.com/kiali/kiali/config"
"github.com/kiali/kiali/kubernetes"
"github.com/kiali/kiali/log"
"github.com/kiali/kiali/models"
"github.com/kiali/kiali/prometheus"
)
// DashboardsService deals with fetching dashboards from k8s client
type DashboardsService st... |
// Command testserver spins up a test GRPC server.
package main
import (
"flag"
"fmt"
"net"
"os"
"sync/atomic"
"time"
"golang.org/x/net/context"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/reflection"
"... |
// Copyright 2018 The Operator-SDK Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ... |
package logger
import (
"fmt"
"time"
"github.com/terhitormanen/config"
)
// The LogHandler defines the interface to handle the log records.
type (
// The Multilogger reduces the number of exposed defined logging variables,
// and allows the output to be easily refined.
MultiLogger interface {
// New returns ... |
package mci
import (
"fmt"
"os"
"strings"
"github.com/bingoohuang/gou/str"
"github.com/bingoohuang/sqlx"
"github.com/elliotchance/pie/pie"
"github.com/sirupsen/logrus"
)
// SlaveStatus contains the slave status information for `show slave status\G`.
type SlaveStatus struct {
Address string
Slav... |
/*
MIT License
Copyright (c) 2021 Software Authors
Software Authors are:
<NAME>, email: <EMAIL>,<EMAIL>
<NAME>, email: <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 res... |
package parser
import (
"fmt"
"github.com/porter-dev/porter/internal/helm"
"github.com/porter-dev/porter/internal/models"
"github.com/porter-dev/porter/internal/templater"
"github.com/porter-dev/porter/internal/templater/utils"
"helm.sh/helm/v3/pkg/chart"
"helm.sh/helm/v3/pkg/release"
"k8s.io/client-go/dynami... |
/*
Copyright 2011 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 writing, software
di... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.