text stringlengths 3.08k 10.4k |
|---|
/*
* Copyright (C) 2019 Intel Corporation
* SPDX-License-Identifier: BSD-3-Clause
*/
package tasks
import (
"crypto"
"crypto/rand"
"crypto/x509"
"crypto/x509/pkix"
"fmt"
"github.com/intel-secl/intel-secl/v3/pkg/cms/constants"
"github.com/intel-secl/intel-secl/v3/pkg/cms/utils"
"github.com/intel-secl/intel-s... |
// Copyright (C) 2015 The Syncthing Authors.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// You can obtain one at https://mozilla.org/MPL/2.0/.
package model
import (
"time"
"github.com/syncthing/syncthing/li... |
package gitlab
import (
"context"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/require"
"gitlab.com/gitlab-org/gitlab-pages/internal/source/gitlab/api"
"gitlab.com/gitlab-org/gitlab-pages/internal/source/gitlab/client"
)
func TestGetDomain(t *testing.T) {
t.Run("when the response if correct", f... |
package main
import (
"encoding/json"
"flag"
"fmt"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"github.com/tarm/serial"
"github.com/virtcanhead/mohead/jy901"
"io"
"net"
"os"
"sync"
"sync/atomic"
"time"
)
var (
optDevice string
optBaud int
optSetup bool
optBind string
angles Angles
... |
package v1
import (
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"time"
"github.com/asecurityteam/vpcflow-diffd/pkg/domain"
"github.com/asecurityteam/vpcflow-diffd/pkg/logs"
"github.com/google/uuid"
)
var diffNamespace = uuid.NewSHA1(uuid.Nil, []byte("diff"))
// DiffHandler handles incoming HTTP requests... |
package httpbakery
import (
"crypto/rand"
"encoding/base64"
"encoding/json"
"fmt"
"net/http"
"path"
"github.com/rogpeppe/macaroon"
"github.com/rogpeppe/macaroon/bakery"
)
// TODO(rog) perhaps rename this file to "thirdparty.go" ?
type dischargeHandler struct {
key *KeyPair
svc *bakery.Service
che... |
// Copyright 2021 The PipeCD 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 train
import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"os"
"path"
"regexp"
"strconv"
"strings"
"github.com/shaoshing/train/interpreter"
)
func ReadAsset(assetUrl string) (result string, err error) {
filePath := ResolvePath(assetUrl)
fileExt := path.Ext(filePath)
switch fileExt {
case ".js", ".css"... |
package filesystem
import (
"bufio"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"os"
"path/filepath"
"regexp"
"strconv"
"strings"
"time"
"github.com/motemen/go-loghttp"
)
var nginxLine = regexp.MustCompile(`^<a\s.*>(.*)</a>\s+(\d+-\w+-\d{4}\s\d{2}:\d{2})\s+(-|[\d]+)$`)
const (
nginxTimeFormat ... |
package league
import (
"FootballProject/domain/club"
"FootballProject/domain/club/repository"
"FootballProject/domain/league"
"FootballProject/domain/match"
matchRepo "FootballProject/domain/match/repository"
"FootballProject/infrastructure/parsers"
"context"
"fmt"
//"github.com/google/uuid"
eh "github.com... |
package genproto
import "fmt"
type runestate int
const (
runestateCode runestate = 0
runestateRune runestate = 1
runestateStringQuote runestate = 2
runestateStringBacktick runestate = 3
)
type scanner struct {
str string
rnz []rune
idx int
runestate
curly int
round int
square int... |
package main
import (
"github.com/faiface/pixel"
"github.com/faiface/pixel/pixelgl"
"github.com/zergon321/cirno"
)
type player struct {
speed float64
jumpAcceleration float64
verticalSpeed float64
terminalSpeed float64
aim cirno.Vector
bulletSpeed float64
bulletSprite ... |
package mdb
import (
"context"
"errors"
"fmt"
"time"
"go.mongodb.org/mongo-driver/bson/bsoncodec"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"go.mongodb.org/mongo-driver/mongo/readpref"
)
// Access encapsulates database connection.
type Access struct {
client *mongo.Cl... |
package main
import (
"context"
"time"
"golang.org/x/sync/semaphore"
"github.com/gravitational/teleport-plugins/lib"
"github.com/gravitational/teleport-plugins/lib/backoff"
"github.com/gravitational/teleport-plugins/lib/logger"
"github.com/gravitational/trace"
"github.com/jonboulle/clockwork"
log "github.co... |
package main
import (
"fmt"
"math/big"
"os"
"strings"
"syscall"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/accounts/abi/bind"
"github.com/ethereum/go-ethereum/accounts/usbwallet"
"github.com/ethereum/go-ethereum/common"
ethcmn "github.com/ethereum/go-ethereum/common"
ethtyp... |
// arkadiko
// https://github.com/topfreegames/arkadiko
// Licensed under the MIT license:
// http://www.opensource.org/licenses/mit-license
// Copyright © 2016 Top Free Games <<EMAIL>>
package mqttclient
import (
"context"
"crypto/tls"
"crypto/x509"
"errors"
"fmt"
"io/ioutil"
"strings"
"sync"
"time"
log "... |
package controller
import (
"fmt"
"time"
log "github.com/sirupsen/logrus"
)
type executorTaskState struct {
task *transition
fromStatus Status
err error
}
type executorState struct {
running []Thing
activeTransitions []transition
constraints []Target
done chan exe... |
// Copyright 2018 flowq Author. 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 applica... |
package v1alpha1
import (
"fmt"
"github.com/tliron/kutil/ard"
"github.com/tliron/kutil/kubernetes"
group "github.com/tliron/reposure/resources/reposure.puccini.cloud"
apiextensions "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1"
meta "k8s.io/apimachinery/pkg/apis/meta/v1"
)
var RegistryGVK = SchemeG... |
package stela
import (
"bytes"
"crypto/rand"
"encoding/gob"
"fmt"
"net"
"sync"
"time"
"github.com/miekg/dns"
)
const (
// Version of stela
Version = "0.11.0"
// DefaultStelaAddress by default stela assumes there is a local instance running
DefaultStelaAddress = "127.0.0.1:31000"
// DefaultStelaPort by... |
package job
import (
"bytes"
"context"
"encoding/json"
"fmt"
"regexp"
"github.com/suchimauz/walg-k8s-cron-backup/internal/config"
"github.com/suchimauz/walg-k8s-cron-backup/pkg/kube"
"github.com/suchimauz/walg-k8s-cron-backup/pkg/storage"
"github.com/suchimauz/walg-k8s-cron-backup/pkg/utils"
tgbotapi "gith... |
package leb128
import (
"math/big"
"reflect"
"testing"
"github.com/stretchr/testify/assert"
)
func TestFromUInt64(t *testing.T) {
tests := []struct {
n uint64
want []byte
}{
{0, []byte{0x00}},
{1, []byte{0x01}},
{2, []byte{0x02}},
{3, []byte{0x03}},
{4, []byte{0x04}},
{5, []byte{0x05}},
{6... |
/**
*
* @author nghiatc
* @since Jan 2, 2020
*/
package sss
import (
"bytes"
"crypto/rand"
"encoding/base64"
"encoding/hex"
"fmt"
"math"
"math/big"
"strings"
)
// The largest PRIME 256-bit big.Int
// https://primes.utm.edu/lists/2small/200bit.html
// PRIME = 2^n - k = 2^256 - 189
const (
DefaultPrimeStr ... |
//go:build (adalnk && cgo) || windows
// +build adalnk,cgo windows
/*
* Copyright © 2018-2021 Software AG, Darmstadt, Germany and/or its licensors
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the Li... |
package v1alpha1
import (
"fmt"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// ManagementCenterSpec defines the desired state of ManagementCenter.
type ManagementCenterSpec struct {
// Repository to pull the Management Center image from.
//... |
// Package boltdb provides an implementation of DeploymentStore that uses
// boltdb. It can deal with multiple versions of how deployments are serialized
// to disk. Only the lastest version needs to provide an interface to write a
// deployment.
//
// Versions:
// - v0: This version used gob to serialize most of the... |
package xmppclient
import "fmt"
const (
AffiliationNone int = 1
AffiliationOutcast int = 2
AffiliationMember int = 3
AffiliationOwner int = 4
AffiliationAdmin int = 5
AffiliationInvalid int = 6
RoleNone int = 1
RoleVisitor int = 2
RoleParticipant int = 3
RoleModerator int = ... |
package collection
import (
"context"
"fmt"
"github.com/e2u/gp-scraper/internal/util"
"github.com/e2u/gp-scraper/play"
"github.com/e2u/gp-scraper/play/age"
"github.com/e2u/gp-scraper/play/category"
"github.com/e2u/gp-scraper/play/price"
"github.com/e2u/gp-scraper/play/sort"
"github.com/sirupsen/logrus"
"gith... |
package parse_test
import (
"bytes"
"encoding/hex"
"github.com/jchavannes/jgo/jerr"
"github.com/jchavannes/jgo/jlog"
"github.com/memocash/index/ref/bitcoin/memo"
"github.com/memocash/index/ref/bitcoin/tx/parse"
"github.com/memocash/index/ref/bitcoin/tx/script"
"github.com/memocash/index/ref/bitcoin/util/testin... |
package node
import (
"context"
"fmt"
logging "github.com/ipfs/go-log/v2"
"github.com/libp2p/go-libp2p"
"github.com/libp2p/go-libp2p-core/host"
"github.com/libp2p/go-libp2p-core/routing"
libp2pquic "github.com/libp2p/go-libp2p-quic-transport"
"github.com/pkg/errors"
"happystoic/p2pnetwork/pkg/config"
connmg... |
package api
import (
"strings"
"sync"
"time"
"github.com/prometheus/client_golang/prometheus"
)
type metricFacade interface{}
type MetricDescriptions map[string]string
type MetricOpts struct {
Registry prometheus.Registerer
MetricNamePrefix string
PrefixSeparator string
Des... |
package goq
import (
"fmt"
"strconv"
)
type queryExpr struct {
exps []Selectable
distinct bool
froms []TableLike
joins []*joinDef
where Where
groups []Expr
havings []PredExpr
orders []Orderer
limit int
offset int
ctx DBContext
ops
}
func (qe *queryExpr) init() *queryExpr {
... |
package main
import (
"context"
"encoding/json"
"flag"
"fmt"
"log"
"os"
"os/signal"
"sync"
"time"
"github.com/chop-dbhi/eda"
)
type Store struct {
records map[string]*Patient
// Multiple handlers can update the same record.
mux sync.Mutex
}
func (s *Store) AddTestRecord(t time.Time, patient, test stri... |
//go:generate go run ./gen
package dagspliter
import (
"context"
"fmt"
"os"
"github.com/docker/go-units"
"github.com/ipfs/go-cid"
ipld "github.com/ipfs/go-ipld-format"
mdag "github.com/ipfs/go-merkledag"
"github.com/ipfs/go-unixfs"
uio "github.com/ipfs/go-unixfs/io"
"golang.org/x/xerrors"
)
/// Box is a w... |
package nfa2regex
import (
"errors"
"fmt"
"regexp"
"sort"
"strings"
"testing"
"github.com/stretchr/testify/assert"
)
func MakeNFAManyMany() *NFA {
nfa := NewNFA()
nfa.AddEdge("1", "2", "a")
nfa.AddEdge("2", "3", "b")
nfa.AddEdge("2", "2", "l")
nfa.AddEdge("4", "2", "x")
nfa.AddEdge("2", "5", "y")
nfa.N... |
// Copyright 2014 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.
// +build darwin linux windows
// An app that draws a green triangle on a red background.
//
// Note: This demo is an early preview of Go 1.5. In order to buil... |
package downloadGroup
import (
"Simserver/Libs"
"archive/zip"
"embed"
"encoding/json"
"fmt"
"html/template"
"io"
"io/ioutil"
"os"
"path/filepath"
"sort"
"strings"
"time"
"github.com/gin-gonic/gin"
)
var (
Ls_open = false
Dls_open = false
Zip_open = false
DownloadCode_ope... |
/*
Copyright 2019 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, ... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: stream.proto
package types
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import 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 co... |
package types
import (
"fmt"
"time"
sdk "github.com/cosmos/cosmos-sdk/types"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
"github.com/certikfoundation/shentu/v2/common"
)
// default parameter values
var (
// default values for Shield pool's parameters
DefaultProtectionPeriod = time.Hour * 24 * 2... |
package app
import (
"bytes"
"fmt"
"os"
"os/exec"
"strings"
"text/template"
"github.com/zainul/gan/internal/app/io"
"github.com/zainul/gan/internal/app/constant"
)
// Migration is type for creating thing that related with migration database
type MigrationCommand interface {
CreateFile(name string, extentio... |
package main
import (
"context"
"flag"
"fmt"
"log"
"math/rand"
"net/http"
"os"
"sort"
"strconv"
"strings"
"syscall"
"time"
"github.com/AnaisUrlichs/observe-argo-rollout/app/exthttp"
"github.com/AnaisUrlichs/observe-argo-rollout/app/tracing"
"github.com/efficientgo/tools/core/pkg/errcapture"
"github.co... |
// Copyright (c) 2017 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 applicabl... |
package standard
import (
"archive/zip"
"bytes"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"os"
"path"
"strings"
"time"
"github.com/g-harel/npmfs/internal/registry"
"github.com/g-harel/npmfs/internal/util"
"golang.org/x/xerrors"
)
// Client implements the registry.Client interface for sta... |
// Adopt the RESTful API design principle,
// and the returned status code can be found at:
// https://developer.amazon.com/zh/docs/amazon-drive/ad-restful-api-response-codes.html
package main
import (
"errors"
"net/http"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/render"
"github.com/gorilla/schema"
)... |
package main
import (
"context"
"flag"
"fmt"
"github.com/fixje/deflux/deconz/sensor"
"github.com/fixje/deflux/sink"
"os"
"os/signal"
"syscall"
"time"
"github.com/fixje/deflux/config"
"github.com/fixje/deflux/deconz"
log "github.com/sirupsen/logrus"
)
func main() {
flagLoglevel := flag.String("loglevel",... |
// Copyright 2020 The Chromium OS 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 policy
import (
"context"
"time"
"chromiumos/tast/common/policy"
"chromiumos/tast/local/chrome/ui"
"chromiumos/tast/local/chrome/ui/fail... |
package reports
import (
"fmt"
"log"
"os"
"sort"
"strings"
"github.com/mrcook/time_warrior/reports/period"
"github.com/mrcook/time_warrior/timeslip"
"github.com/mrcook/time_warrior/timeslip/worked"
)
type Report struct {
PendingTimeslip timeslip.Slip
timePeriod *period.Period
totalTimeWorked int
pr... |
package main
import (
"bufio"
"bytes"
"fmt"
"io"
"regexp"
"strconv"
"strings"
"github.com/mkobetic/coin"
"github.com/mkobetic/coin/check"
"github.com/mkobetic/coin/rex"
)
var separator = []byte("---")
type Field struct {
idx int
out string
re *rex.Exp
}
func (f *Field) Value(row []string, fields map[... |
package main
import (
"errors"
"fmt"
"strconv"
"github.com/hyperledger/fabric/core/chaincode/shim"
"github.com/hyperledger/fabric/core/util"
)
var account = make(map[string]int)
var logger = shim.NewLogger("ftLogger")
// SampleChaincode struct required to implement the shim.Chaincode interface
type SampleChai... |
package create
import (
"context"
"errors"
"io"
"os"
"path/filepath"
"strings"
"github.com/docker/distribution/reference"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
)
// Runtime is identifier for Metro activity runtime.
type Runtime int
const (
// Auto is an identifi... |
package labelsync
import (
"errors"
"fmt"
"github.com/Azure/go-autorest/autorest/to"
"github.com/go-logr/logr"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
"k8s.io/client-go/tools/record"
azrsrc "github.com/Azure/node-label-operator/azure/computeresource"
"github.com/Azure/node-label-operator... |
/*
Copyright © 2020 NAME HERE <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writi... |
package lanhttp
import (
"context"
"encoding/json"
"fmt"
"math/rand"
"net"
"net/http"
"net/url"
"sort"
"strings"
"sync"
"time"
"github.com/hashicorp/go-cleanhttp"
)
type Client struct {
client HTTPClient
log *logger
stop chan struct{}
// backends that are currently live
backends Routes
// mu... |
package main
import (
"bufio"
"fmt"
"log"
"os"
"strconv"
"strings"
)
type TicketSituation struct {
FieldDefinitions []FieldDefinition
MyTicket Ticket
NearbyTickets []Ticket
}
type FieldDefinition struct {
name string
validity []Condition
}
type Condition struct {
min int
max int
}
func ... |
package messagebroker
import (
"encoding/json"
"strings"
"time"
kafkapkg "github.com/confluentinc/confluent-kafka-go/kafka"
"github.com/rs/xid"
)
const (
// below are the kafka header keys
messageIDHeader = "messageID"
publishTimeHeader = "publishTime"
sourceTopicHeader = "sourc... |
// Copyright 2015 <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 writi... |
package api
import (
"context"
"encoding/json"
"errors"
"net/http"
"net/url"
"strconv"
"time"
"github.com/zbiljic/authzy/pkg/database"
"github.com/zbiljic/authzy/pkg/domain/user"
xhttp "github.com/zbiljic/authzy/pkg/http"
"github.com/zbiljic/authzy/pkg/logger"
)
var (
// used below to specify need to ret... |
package algorithms
import (
"github.com/bionoren/mazes/grid"
"github.com/faiface/pixel"
"github.com/faiface/pixel/imdraw"
"github.com/faiface/pixel/text"
"golang.org/x/image/font/basicfont"
"image/color"
"math"
"strconv"
)
type Dijkstra struct {
reference grid.Cell
distances []int
grid grid.Grid
}
fu... |
/*
Copyright 2019 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 main
import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"net/http"
"net/http/httputil"
"net/url"
"time"
"github.com/comhttp/jorm/pkg/utl"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
)
type (
JORM struct {
WWW *http.Server
config map[string]string
}
)
func main() {
// Get cmd li... |
// 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 ... |
// Copyright 2021 Matrix Origin
//
// 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 lift
import (
"bytes"
"fmt"
"html/template"
"io/ioutil"
"math/rand"
"net"
"os/exec"
"github.com/gobuffalo/packr"
)
// Lift ...
type liftSim struct {
simConfig
txWithResp, txWithoutResp, rx chan []byte
}
type simConfig struct {
TravelTimeBetweenFloors int
TravelTimePassingFloors int
BtnDepressedT... |
package main
import (
"context"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"net"
"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"
... |
package rabinkarp
import (
"math"
)
const defaultBase = 26
// exponent get the value(base^exponent) and store the value in the result,
// e.g., result[2]=base^2, result[1]=base^1, result[0]=base^0
func exponent(base, exponent int) (result []int) {
result = make([]int, exponent+1)
for i := range result {
result[... |
package test
import (
"github.com/equinor/radix-cost-allocation-api/models"
)
// ResourceBuilder construct RequiredResources
type ResourceBuilder interface {
WithID(id int64) ResourceBuilder
WithWBS(string string) ResourceBuilder
WithApplication(application string) ResourceBuilder
WithEnvironment(environment str... |
package tbin
import (
"fmt"
"sort"
"strconv"
"unicode"
)
const TD_1_ms int64 = 1
const TD_1_sec int64 = 1000 * TD_1_ms
const TD_1_min int64 = 60 * TD_1_sec
const TD_1_hr int64 = 60 * TD_1_min
const TD_1_day int64 = 24 * TD_1_hr
const TD_1_week int64 = 7 * TD_1_day
var TIMEDELTA_ABBREVS map[string]string = map[st... |
package s3gof3r
import (
"context"
"encoding/xml"
"math"
"net/http"
"strconv"
"time"
"github.com/github/s3gof3r/internal/s3client"
"golang.org/x/sync/errgroup"
)
func newObjectLister(c *Config, b *Bucket, prefixes []string, maxKeys int) (*ObjectLister, error) {
cCopy := *c
cCopy.NTry = max(c.NTry, 1)
cCop... |
package tcp
import (
"errors"
"log"
"net"
"sync"
"github.com/macadrich/dmnet/model"
"github.com/macadrich/dmnet/util"
)
// Server -
type Server struct {
sAddr *net.TCPAddr
p2paddr string
p2pc net.Listener
conns model.Conns
isP2P bool
wg *sync.... |
// Copyright (c) 2014 <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distri... |
package main
import (
"bufio"
"flag"
"fmt"
"log"
"net/http"
"os"
"strings"
"time"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/prometheus/client_golang/prometheus/promhttp"
"gorm.io/driver/postgres"
"gorm.io/gorm"
)
var (
contact... |
// Copyright 2020 SEQSENSE, 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 ... |
package main
import (
"bufio"
"encoding/json"
"flag"
"fmt"
"io"
"log"
"net/http"
"net/url"
"os"
"regexp"
"strconv"
"strings"
"sync/atomic"
"time"
"github.com/beefsack/go-rate"
)
var concurrentMax uint = 200
var inputPath = flag.String("f", "./url_list.txt", "Input File Path,first row is the url")
var... |
/*
* Copyright (c) 2018 Works Applications Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... |
/*
pghoard - archive_command and restore_command for postgresql
Copyright (c) 2017 Aiven
See LICENSE for details
*/
package main
import (
"errors"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"path"
"time"
)
const PGHOARD_HOST = "127.0.0.1"
const PGHOARD_PORT = 16000
// When running restore_command Post... |
package logwriter
import (
"bytes"
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"encoding/json"
"fmt"
"hash"
"net/http"
"os"
"strconv"
"strings"
"time"
)
// AzureMonitor log writer
type azureMonitor struct {
azWorkspaceID string
azKey string
azLogType string
azDomain string
azURL ... |
// Copyright 2019 Intel Corporation. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by app... |
package controllers
import (
"context"
"fmt"
"time"
"github.com/go-logr/logr"
core "k8s.io/api/core/v1"
apierrs "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/runtime"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k... |
package eudore_test
import (
"fmt"
"strings"
"testing"
"github.com/eudore/eudore"
)
type Context struct {
eudore.Context
httpParams eudore.Params
}
func (ctx *Context) Params() *eudore.Params {
return &ctx.httpParams
}
func (ctx *Context) GetParam(key string) string {
return ctx.httpParams.Get(key)
}
func ... |
/**
* Created: 2019/4/23 0023
* @author: Jason
*/
package network
import (
"context"
"sync/atomic"
"github.com/gorilla/websocket"
"github.com/lightning-go/lightning/defs"
"github.com/lightning-go/lightning/logger"
"github.com/lightning-go/lightning/module"
"github.com/lightning-go/lightning/utils"
uuid "g... |
/*
http://www.apache.org/licenses/LICENSE-2.0.txt
Copyright 2016 Intel 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 ... |
// pcb.go
// go-ansi
//
// Copyright (C) 2017 ActiveState Software Inc.
// Written by <NAME> (@rawktron)
//
// Based on ansilove/C
// Copyright (C) 2011-2017 <NAME>, <NAME>, and <NAME>.
// All rights reserved.
// ansilove/C is licensed under the BSD-2 License.
//
// go-ansi is licensed under the BSD 3-Clause Lic... |
// Copyright (c) 2015 Mute Communications Ltd.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package encdb
import (
"crypto/rand"
"crypto/sha256"
"fmt"
"io"
"os"
"github.com/mutecomm/mute/cipher/aes256"
"github.com/mutecomm/mute/encode"
"golang.org/x/... |
// Copyright 2016-2018 <NAME>. 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 applicabl... |
//go:build integ
// +build integ
// 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 ... |
// Definition of CLI commands for 1Pass.
//
// @author TSS
package cli
import (
"fmt"
"github.com/mashmb/1pass/1pass-app/gui"
"github.com/mashmb/1pass/1pass-core/port/in"
"github.com/spf13/cobra"
)
type cobraCli struct {
category string
name string
trashed bool
vault string
version strin... |
package main
import (
"bytes"
"flag"
"fmt"
"io"
"math/rand"
"net"
"os/exec"
"strconv"
"sync"
"sync/atomic"
"time"
"github.com/funny/link"
_ "github.com/funny/unitest"
)
var (
serverAddr = flag.String("addr", "127.0.0.1:10010", "echo server address")
clientNum = flag.Int("num", 1, "client number")
... |
// Copyright 2021 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.orglicensesLICENSE-2.0
//
// Unless required by applicable law or agreed to in w... |
// Copyright 2019 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 w... |
package multiplexer
// Copyright (c) 2018 Bhojpur Consulting Private Limited, India. 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 w... |
/*
This file is part of go-palletone.
go-palletone is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
go-palletone is distribu... |
// Code generated by go-swagger; DO NOT EDIT.
package node_pools
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.c... |
package virtualdisk
import (
"context"
"fmt"
"log"
"path"
"github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/provider"
"github.com/hashicorp/terraform-provider-vsphere/vsphere/internal/helper/structure"
"github.com/vmware/govmomi"
"github.com/vmware/govmomi/object"
"github.com/vmware/go... |
package proposals
import (
"bytes"
"context"
"fmt"
"path/filepath"
"sync"
"github.com/spacemeshos/go-spacemesh/codec"
"github.com/spacemeshos/go-spacemesh/common/types"
"github.com/spacemeshos/go-spacemesh/database"
"github.com/spacemeshos/go-spacemesh/events"
"github.com/spacemeshos/go-spacemesh/log"
"git... |
package main
import (
"errors"
"fmt"
"os"
"github.com/aws/aws-sdk-go/aws"
"encoding/json"
"github.com/ghodss/yaml"
"io/ioutil"
"strings"
"strconv"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/ssm"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
... |
package dummy
import (
"bytes"
"encoding/hex"
"strconv"
"strings"
"github.com/tendermint/abci/types"
crypto "github.com/tendermint/go-crypto"
"github.com/tendermint/iavl"
cmn "github.com/tendermint/tmlibs/common"
dbm "github.com/tendermint/tmlibs/db"
"github.com/tendermint/tmlibs/log"
)
const (
ValidatorS... |
package main
import (
"context"
"errors"
"fmt"
"net/http"
"os"
"os/signal"
"syscall"
"time"
"github.com/gorilla/mux"
cli "github.com/jawher/mow.cli"
metrics "github.com/rcrowley/go-metrics"
cmneo4j "github.com/Financial-Times/cm-neo4j-driver"
logger "github.com/Financial-Times/go-logger/v2"
"github.com... |
package dilithium
//The first block of constants define internal parameters.
//SEEDBYTES holds the lenght in byte of the random number to give as input, if wanted.
//The remaining constants are exported to allow for fixed-lenght array instantiation. For a given security level, the consts are the same as the output of ... |
// Copyright Splunk 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 writi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.