text stringlengths 3.08k 10.4k |
|---|
package main
import (
"flag"
"fmt"
"io"
"model/pkg/ds_admin"
"os"
"path/filepath"
"strconv"
"strings"
"time"
"github.com/chzyer/readline"
_ "model/pkg/ds_admin"
client "pkg-go/ds_client"
"util/log"
)
var token = flag.String("token", "", "auth token")
var addr = flag.String("addr", "127.0.0.1:16180", "d... |
package main
import (
"encoding/json"
"fmt"
"log"
"net"
"net/http"
"net/url"
"strconv"
"strings"
"sync"
)
type SafeCounter struct {
v map[string]uint64
mux sync.Mutex
}
var MaxAgeVal string
var Stats SafeCounter
const StatsVersion = 3
const TLSbufLen = 3
const TLStypeHandshake = 22
const TLSversionMajo... |
package schedule
import (
"bytes"
"crypto/tls"
"fmt"
"log"
"net"
"net/mail"
"net/smtp"
"strings"
"github.com/aerth/mbox"
)
func (w *watch) notifiyUsers(s *Schedule) {
s.sendMail(w)
}
type mailing struct {
email string
subject string
body string
}
func createMail(u *feuser, p *watch, s *Schedule) ... |
package cloudformation
import (
"encoding/json"
"errors"
"fmt"
)
// AWSApiGatewayRestApi AWS CloudFormation Resource (AWS::ApiGateway::RestApi)
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-restapi.html
type AWSApiGatewayRestApi struct {
// ApiKeySourceType AWS Clo... |
package field
import (
"reflect"
"errors"
. "github.com/emtabb/field/src/statistic/dynamic"
. "github.com/emtabb/field/src/calculation/space"
"github.com/emtabb/field/src/statistic"
"github.com/emtabb/field/interaction"
)
const (
STRING = "STRING"
DOUBLE = "DOUBLE"
FLOAT = "FLOAT"
INT = "INT"
BIGIN... |
package allocation
import (
"context"
"encoding/json"
"path/filepath"
"strings"
"0chain.net/blobbercore/filestore"
"0chain.net/blobbercore/reference"
"0chain.net/blobbercore/stats"
"0chain.net/core/common"
)
type NewFileChange struct {
ConnectionID string `json:"connection_id"`
Allocat... |
// *** 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 apimanagement
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Manages an OpenID Connect Provider within a... |
package main
import (
"fmt"
"io/ioutil"
"os"
"github.com/caarlos0/env"
"github.com/go-sql-driver/mysql"
"github.com/pkg/errors"
"gopkg.in/yaml.v2"
)
// Rule is part of `Config`, it's set of the routing path and the SQL query.
type Rule struct {
Befores []string
Queries []string
Afters []string... |
package extjson
import (
"bytes"
"encoding/base64"
"encoding/hex"
"fmt"
"math"
"sort"
"strconv"
"strings"
"time"
"unicode/utf8"
"github.com/10gen/mongo-go-driver/bson"
"github.com/10gen/mongo-go-driver/bson/internal/json"
)
// Special values for extended JSON.
var (
Decimal128NaN, _ = bson.ParseDecim... |
package commands
import (
"fmt"
"github.com/chen-keinan/beacon/internal/logger"
"github.com/chen-keinan/beacon/internal/models"
"github.com/chen-keinan/beacon/internal/reports"
"github.com/chen-keinan/beacon/internal/startup"
"github.com/chen-keinan/beacon/pkg/filters"
m2 "github.com/chen-keinan/beacon/pkg/mode... |
// Copyright ©2014 The gonum 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 concrete
import (
"fmt"
"github.com/gonum/graph"
)
// A simple int alias.
type Node int
func (n Node) ID() int {
return int(n)
}
// Just a c... |
package gateway
import (
"errors"
"net"
"sync"
"github.com/ConsenSys/fc-retrieval-gateway/internal/gateway/clients"
"github.com/ConsenSys/fc-retrieval-gateway/internal/offers"
"github.com/ConsenSys/fc-retrieval-gateway/internal/util/settings"
"github.com/ConsenSys/fc-retrieval-gateway/pkg/fcrcrypto"
"github.c... |
// 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 relay
import (
"bytes"
"encoding/binary"
"errors"
"io"
"net"
)
const (
featureHeaderLen = 3
)
const (
FeatureUserAuth = 0x01
FeatureTargetAddr = 0x02
)
const (
AddrIPv4 uint8 = 1
AddrDomain uint8 = 3
AddrIPv6 uint8 = 4
)
var (
ErrShortBuffer = errors.New("short buffer")
ErrBadAddrType = ... |
package forge
import (
"encoding/hex"
"fmt"
"strings"
"github.com/baking-bad/bcdhub/internal/bcd/consts"
"github.com/baking-bad/bcdhub/internal/bcd/encoding"
"github.com/pkg/errors"
)
// Address -
func Address(val string, tzOnly bool) ([]byte, error) {
prefix := val[:3]
address, err := encoding.DecodeBase58(... |
// Copyright 2019 The Go Cloud Development Kit 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by appli... |
package deploy
import (
"time"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
kubeclient "github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/golang/glog"
osclient "github.com/openshif... |
// Copyright 2021 The Kubeswitch 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 a... |
/*
Copyright 2021 The Hybridnet 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 writ... |
package main
import "fmt"
/* BNF for the language
* program = statement {statement} EOF.
* statement = printStatement | assignmentStatement
* printStatement = "print" expression ";"
* forStatement = "while" condition "{" {statement} "}"
* assignmentStatement = identifi... |
// Copyright (c) 2019 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... |
package cmd
import (
"fmt"
"net"
"runtime"
"strings"
"github.com/abiosoft/colima/cmd/root"
"github.com/abiosoft/colima/config"
"github.com/abiosoft/colima/environment"
"github.com/abiosoft/colima/environment/container/docker"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
// startCmd represent... |
package psdock
import (
"code.google.com/p/go.crypto/ssh/terminal"
"crypto/tls"
"errors"
"io"
"log"
"net"
"net/url"
"os"
)
type ioContext struct {
term *terminal.Terminal
oldTermState *terminal.State
stdinOutput io.WriteCloser
log *Logger
}
func newIOContext(stdinStr string, pty *os.Fil... |
package layer
import (
"bytes"
"context"
"fmt"
"strconv"
"strings"
"time"
"github.com/nspcc-dev/neofs-api-go/pkg/acl/eacl"
"github.com/nspcc-dev/neofs-api-go/pkg/container"
cid "github.com/nspcc-dev/neofs-api-go/pkg/container/id"
"github.com/nspcc-dev/neofs-s3-gw/api"
"github.com/nspcc-dev/neofs-s3-gw/api/... |
// Test service for regression testing of Cloud Endpoints support.
package server
import (
"fmt"
"github.com/rwl/go-endpoints/endpoints"
"github.com/stretchr/testify/assert"
"log"
"net/http"
"net/http/httptest"
"net/url"
"strconv"
"testing"
"time"
)
type VoidMessage struct{}
type TimeMessage struct {
Mill... |
/*
Copyright 2021.
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... |
// Copyright 2017, OpenCensus 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... |
/*
* Copyright 2020 <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in wr... |
package bit
import (
"math/rand"
"reflect"
"runtime"
"sort"
"strconv"
"testing"
)
func TestSparseBasics(t *testing.T) {
// TODO: t.Helper
check := func(b bool) {
if !b {
_, _, line, ok := runtime.Caller(1)
var ln string
if !ok {
ln = "???"
} else {
ln = strconv.Itoa(line)
}
t.Fatal... |
package cron
import (
"encoding/json"
"fmt"
"github.com/elves-project/agent/src/funcs"
"github.com/elves-project/agent/src/g"
"github.com/elves-project/agent/src/thrift/scheduler"
"github.com/gy-games-libs/cron"
"github.com/gy-games-libs/file"
"github.com/gy-games-libs/fsnotify"
"github.com/gy-games-libs/seel... |
package client
import (
"bytes"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"sync"
"time"
"github.com/yomorun/yomo/pkg/framing"
"github.com/yomorun/yomo/pkg/logger"
"github.com/yomorun/yomo/pkg/quic"
)
// NegotiationPayload represents the payload for negotiation.
type NegotiationPayload struct {
AppNam... |
package runtime
import (
"fmt"
"os/exec"
"path"
"sort"
"github.com/astaxie/beego/orm"
"github.com/ygqbasic/nuwa/models"
"github.com/ygqbasic/nuwa/playbook"
"github.com/golang/glog"
)
// Run - start command & runtime
func Run(w string) {
cps, err := playbook.GetOrderedComponents(w)
if err != nil {
glog.E... |
package validation
import (
"fmt"
"regexp"
"sort"
"strings"
"sync"
ut "github.com/go-playground/universal-translator"
"github.com/go-playground/validator/v10"
)
const (
CharTypeGT3 = "charTypeGT3"
CharTypeGT3TransErr = "必须同时包含三项(大写字母、小写字母、数字、 ()`~!@#$%^&*_-+=|{}[]:;'<>,.?/ 中的特殊符号)"
mustIn ... |
package detailed
import (
"bytes"
"fmt"
"net/url"
"strings"
"github.com/weaveworks/scope/probe/docker"
"github.com/weaveworks/scope/probe/kubernetes"
"github.com/weaveworks/scope/report"
"github.com/ugorji/go/codec"
)
const (
// Replacement variable name for the query in the metrics graph url
urlQueryVarN... |
package jenkins
import (
"bytes"
"fmt"
"github.com/rancher/rancher/pkg/controllers/user/pipeline/utils"
"github.com/rancher/types/apis/management.cattle.io/v3"
"regexp"
"strconv"
"strings"
)
func ConvertPipelineToJenkinsPipeline(pipeline *v3.Pipeline) PipelineJob {
parsedPipeline := parsePreservedEnvVar(*pipe... |
package server
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"strings"
)
func saveTestJsonData(w http.ResponseWriter) {
log.Printf("saveTestJsonData\n")
// Marshal array of struct
testEventFiltersJson, err := json.MarshalIndent(currentTestEventFilters, "", " ")
if err != nil {
http.Error(w,... |
package api
/**
* Panther is a scalable, powerful, cloud-native SIEM written in Golang/React.
* Copyright (C) 2020 Panther Labs Inc
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation... |
package gokeepasslib
import (
"crypto/aes"
"crypto/cipher"
"crypto/sha256"
"crypto/sha512"
"encoding/base64"
"fmt"
"io/ioutil"
"os"
"reflect"
"regexp"
"github.com/aead/argon2"
)
// DBCredentials holds the key used to lock and unlock the database
type DBCredentials struct {
Passphrase []byte // Passphrase... |
/*
Copyright 2020 The KubeSphere 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, ... |
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE.txt 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 ... |
package client
import (
"bufio"
"bytes"
"io"
"io/ioutil"
"net/http"
"net/url"
"strconv"
"time"
"github.com/laincloud/lainlet/api/v2"
"github.com/laincloud/lainlet/watcher/container"
"github.com/laincloud/lainlet/watcher/nodes"
"golang.org/x/net/context"
)
// all the kinds of event
const (
ERROR stri... |
package main
import (
"fmt"
"log"
"os/exec"
"strings"
ui "github.com/gizak/termui/v3"
"github.com/gizak/termui/v3/widgets"
)
// Render sets up and renders widgets to build the user interface
func Render(content *ParsedContent, theme string) {
if err := ui.Init(); err != nil {
log.Fatalf("failed to initializ... |
package commands
import (
h "../helpers"
t "../types"
"encoding/json"
"github.com/bwmarrin/discordgo"
"io/ioutil"
"net/http"
"strconv"
"strings"
)
const (
searchGitHubParams = "&fields=description&limit=25&search_fields=github.user"
)
// SearchGitHubCommand is a command which returns search results based on... |
/*
* Copyright (c) 2017, https://github.com/nebulaim
* 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
*
* Un... |
package lorca
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"encoding/hex"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
)
func generateRandomKey() (string, error) {
bytes := make([]byte, 32) //generate a random 32 byte key for AES-256
if _, err := rand.Read(bytes); err != nil {
return "",... |
package monchickey
import (
"errors"
)
// 点和多边形的位置关系计算, 使用射线和多边形的交点数判断点在多边形内部或者外部
// 计算都采用直线的一般式方程:Ax + By + C = 0
type Coordinate struct {
X int
Y int
}
// 方程一般式结构体
type GeneralParameter struct {
A int
B int
C int
}
// 给定一点斜率为1的点斜式方程
// (3, 6) => x - y + 3 = 0
func pointSlopeForm(point Coordinate) (int, int... |
// Limited support for parsing Go source.
package source
/*
Copyright 2013 <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
... |
// Copyright 2014 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License... |
// Copyright (c) 2013 The btcsuite developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package main
import (
"errors"
"fmt"
"os"
"path/filepath"
"strconv"
"github.com/conseweb/btclog"
"github.com/conseweb/coinutil"
flags "github.com/conseweb/go-flags"... |
// Copyright 2014 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package models
import (
"errors"
"strings"
"time"
"github.com/gogits/gogs/modules/base"
)
var (
ErrIssueNotExist = errors.New("Issue does not exist")
... |
// Copyright 2019 - 2021 The mharper-imaware Community
//
// 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 applic... |
package cmd
import (
"encoding/json"
"fmt"
"log"
"os"
"reflect"
"regexp"
"strings"
"github.com/fatih/color"
"github.com/kataras/tablewriter"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
homedir "github.com/mitchellh/go-homedir"
"github.com/spf13/viper"
apiclient "terrakube/client/client"
"net/ht... |
package runner
import (
"flag"
"fmt"
"go/ast"
"go/build"
"go/parser"
"go/token"
"io/ioutil"
"os"
"os/exec"
"path"
"path/filepath"
"regexp"
"sort"
"strings"
"testing"
"time"
)
var timeout = flag.Duration("sub.timeout", 5*time.Minute, "Specify the timeout for each sub test")
func TestIntegration(t *tes... |
package server
import (
"crypto/tls"
"crypto/x509"
"io/ioutil"
"net"
"net/http"
"strings"
"time"
"gomodules.xyz/x/log"
gwrt "github.com/grpc-ecosystem/grpc-gateway/runtime"
"github.com/soheilhy/cmux"
"gomodules.xyz/grpc-go-addons/cors"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
)
type... |
// Copyright (c) 2018 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... |
package lion
import (
"net/http"
"golang.org/x/net/context"
)
// Resource defines the minimum required methods
type Resource interface{}
// ResourceUses is an interface with the Uses() method which can be used to define global middlewares for the resource.
type ResourceUses interface {
Uses() Middlewares
}
// G... |
package searchutils
import (
"flag"
"fmt"
"math"
"net/http"
"strconv"
"strings"
"time"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/fasttime"
"github.com/VictoriaMetrics/metricsql"
)
var (
maxExportDuration = flag.Duration("search.maxExportDuration", time.Hour*24*30, "The maximum duration for /api/v1/ex... |
package mail
import (
"context"
"errors"
"fmt"
"time"
"github.com/asim/go-micro/v3/client"
"github.com/east-eden/server/define"
"github.com/east-eden/server/excel/auto"
pbGlobal "github.com/east-eden/server/proto/global"
pbGame "github.com/east-eden/server/proto/server/game"
pbMail "github.com/east-eden/ser... |
package p19
import (
"fmt"
"errors"
"strings"
"strconv"
"github.com/fritzr/advent2020/util"
)
var gVerbose = false
type Rule interface { }
// Match a literal string.
type Literal struct {
literal string
}
// Match a sequence of rules in order.
type Sequence struct {
all []int
}
// Match any of a set... |
package commitmentplans
// Copyright (c) Microsoft and contributors. 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
/... |
// SPDX-License-Identifier: Unlicense OR MIT
package main
import (
"encoding/json"
"fmt"
"os/exec"
"path/filepath"
"sort"
"strings"
"github.com/cybriq/p9/pkg/gel/gio/gpu/internal/driver"
)
// Metadata contains reflection data about a shader.
type Metadata struct {
Uniforms driver.UniformsReflection
Inputs ... |
// 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.
// +build ignore_for_gccgo
package ecdsa
import (
"crypto/cipher"
"crypto/elliptic"
"internal/cpu"
"math/big"
)
// kdsa invokes the "compute digital sign... |
// Copyright 2011 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 main
import (
"bytes"
"flag"
"fmt"
"go/build"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"sort"
"strings"
"testing"
)
var (
updateGolden =... |
package hystrix
import (
"sync"
"time"
"encoding/json"
"github.com/cep21/circuit/v3"
"github.com/cep21/circuit/v3/faststats"
)
// Opener is ClosedToOpen that opens a circuit after a threshold and % error has been
// reached. It is the default hystrix implementation.
type Opener struct {
errorsCount ... |
package generator
import (
"fmt"
"path"
"regexp"
"strings"
"github.com/go-openapi/loads"
"github.com/go-openapi/spec"
"github.com/pkg/errors"
)
// StubGeneratorOptions that can configure the stub generator
type StubGeneratorOptions struct {
Overlay string
BasePath string
}
// StubGenerator is the main typ... |
// *** 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 oci
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// This data source provides details about a specific Exadata Infrastructure r... |
package set_test
import (
"net/http"
"reflect"
"testing"
"github.com/stretchr/testify/assert"
"github.com/nofeaturesonlybugs/set"
)
func typeinfo_Invalid(i set.TypeInfo) bool {
return i.IsMap == false && i.IsScalar == false && i.IsSlice == false && i.IsStruct == false && i.Kind == reflect.Invalid && i.Type ==... |
// Copyright (C) 2017 <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, d... |
package farm
import (
"log"
"github.com/soundcloud/roshi/cluster"
"github.com/soundcloud/roshi/common"
"github.com/soundcloud/roshi/instrumentation"
"github.com/tsenart/tb"
)
// RepairStrategy generates a core repair strategy for a specific set of
// Clusters.
type RepairStrategy func([]cluster.Cluster, instru... |
package server
import (
"context"
"crypto/hmac"
"crypto/sha256"
"encoding/hex"
"encoding/json"
"fmt"
"github.com/avast/retry-go"
scm2 "github.com/herlon214/sonarqube-pr-issues/pkg/scm"
sonarqube2 "github.com/herlon214/sonarqube-pr-issues/pkg/sonarqube"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"... |
package transformers_test
import (
"testing"
. "github.com/nikolaydubina/go-featureprocessing/transformers"
"github.com/stretchr/testify/assert"
)
func TestOneHotEncoderFit(t *testing.T) {
samples := []struct {
name string
input []string
output map[string]uint
n int
}{
{"basic", []string{"a", ... |
// Copyright © 2019 by PACE Telematics GmbH. All rights reserved.
// Created at 2019/11/21 by <NAME>
package postgres
import (
"context"
"sync"
"time"
"github.com/go-pg/pg"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/xerrors"
)
// ConnectionPoolMetrics is the metrics collector for postgres ... |
package marker
import (
"fmt"
"regexp"
"sort"
"strings"
"time"
)
var timestampLayoutRegexps = map[string]*regexp.Regexp{
time.ANSIC: ANSICRegexp,
time.UnixDate: UnixDateRegexp,
time.RubyDate: RubyDateRegexp,
time.RFC822: RFC822Regexp,
time.RFC822Z: RFC822ZRegexp,
time.RFC850: RFC8... |
// Copyright (C) 2019-2020 Zilliz. 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 l... |
// Package config implements loading config from several sources and client creation.
package config
import (
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"github.com/ghodss/yaml"
"github.com/knadh/koanf"
"github.com/knadh/koanf/providers/confmap"
"github.com/peter-evans/kdef/cli/scanner"
"github.com/pet... |
// Copyright 2018 MSolution.IO
//
// 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 ... |
// Copyright 2020, OpenTelemetry 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 ag... |
package discovery
import (
"crypto/rand"
"encoding/hex"
"errors"
"strings"
"time"
dproto "github.com/hatobito-io/discovery/proto"
"github.com/nats-io/nats.go"
)
// DefaultSubjectPrefix is the default subject prefix for messages sent by
// service discovery agent.
const DefaultSubjectPrefix = "github.com.hatob... |
package server
import (
"../integrate/logger"
"../integrate/authentication"
"../integrate/soaClient"
"../service/authorize"
"../exceptions"
"../service/cache"
"fmt"
"strings"
"io"
"net/http"
)
var (
key string
needToken bool
daemonAddr string
)
func init() {
key = "access-token"
needToken = false
da... |
// Copyright (c) 2019-2022 The iexcloud developers. All rights reserved.
// Project site: https://github.com/woodstock-tokyo/iexcloud
// Use of this source code is governed by a MIT-style license that
// can be found in the LICENSE file for the project.
package iex
import (
"fmt"
"time"
)
// HistoricalTimeFrame en... |
package mnist
import (
log "Landsat-Extractor/logger"
"compress/gzip"
"io"
"net/http"
"os"
"strconv"
"gonum.org/v1/gonum/mat"
)
func download(name string) {
url := "http://yann.lecun.com/exdb/mnist/" + name + ".gz"
path := "data/" + name
resp, err := http.Get(url)
if err != nil {
panic("Cannot downloa... |
// Code generated by go-swagger; DO NOT EDIT.
package provisioning
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"time"
"golang.org/x/net/context"
"github.com/go-openapi/errors"
"github.com/go-openapi/ru... |
package main
import (
"github.com/gorilla/mux"
"github.com/tilezen/xonacatl"
"io"
"log"
"net/http"
"net/url"
"regexp"
"strings"
"time"
)
// LayersHandler proxies requests to an origin server and filters the response layers.
//
// It does this by matching the request against a given route pattern, and proxies... |
/*
*
* Copyright 2019. Insolar Technologies GmbH
*
* 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 main
import (
"crypto/sha256"
"encoding/hex"
"io"
"log"
"net/http"
"strconv"
"time"
)
type WorkerGroup struct {
vhost *VHost
in FileChannel
server string
status *StatusBoard
n int
Options struct {
Checksum bool
}
out chan FileStatus
sendStatus bool
}
const TimeFormat ... |
// Copyright 2021 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... |
// Copyright 2018 Tetrate.io, 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 © 2020 FanjianKong
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, subli... |
package accesscontrol
import (
"context"
"strings"
"github.com/grafana/grafana/pkg/models"
)
type Options struct {
ReloadCache bool
}
type AccessControl interface {
// Evaluate evaluates access to the given resources.
Evaluate(ctx context.Context, user *models.SignedInUser, evaluator Evaluator) (bool, error)
... |
package future
import (
"fmt"
"reflect"
"sync"
"golang.org/x/net/context"
)
var (
nilFuture = &nilf{}
closedChan chan struct{} // always closed
)
func init() {
closedChan = make(chan struct{})
close(closedChan)
}
// allows callers to wait for the completion of some function.
// carries completion signal, ... |
/*
SkCQ backend server
*/
package main
import (
"context"
"flag"
"net/http"
"net/http/pprof"
"time"
"cloud.google.com/go/datastore"
"github.com/gorilla/mux"
"golang.org/x/oauth2"
"go.skia.org/infra/go/allowed"
"go.skia.org/infra/go/auth"
"go.skia.org/infra/go/baseapp"
"go.skia.org/infra/go/common"
"go... |
// Copyright 2012 Google, Inc. All rights reserved.
// Copyright 2009-2011 <NAME>. All rights reserved.
//
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file in the root of the source
// tree.
package layers
import (
"encoding/binary"
"fmt"
"github.co... |
package sqlrepo
import (
"context"
"strings"
logging "github.com/ipfs/go-log/v2"
"github.com/jackc/pgx/v4"
"github.com/jackc/pgx/v4/pgxpool"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/lib/blockstore"
blocks "github.com/ipfs/go-block-format"
"github.com/ipfs/go-cid"
"... |
/*
* Copyright (C) 2021 IBM, 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... |
// license that can be found in the LICENSE file.
// Golang port of https://metacpan.org/pod/Crypt::Juniper
// Original Author: https://metacpan.org/pod/Crypt::Juniper#AUTHOR
// Ported By: nadddy
package jcrypt
import (
"errors"
"fmt"
"math/rand"
"strings"
)
const (
magic string = "$9$"
)
var decryptError erro... |
/*
* Copyright © 2019 <NAME>.
*/
package stats
import (
"github.com/hedzr/cmdr/conf"
"net/http"
"strconv"
"sync"
"time"
// influxdb "github.com/influxdata/influxdb/client/v2"
"github.com/sirupsen/logrus"
"fmt"
"github.com/hedzr/voxr-common/xs/tsdb"
"github.com/labstack/echo"
"strings"
)
type (
Reques... |
package locationService
import (
"bytes"
"encoding/json"
"errors"
"net/http"
"github.com/dorajistyle/goyangi/config"
"github.com/dorajistyle/goyangi/db"
"github.com/dorajistyle/goyangi/model"
"github.com/dorajistyle/goyangi/service/commentService"
"github.com/dorajistyle/goyangi/service/likingService/likingM... |
package twineservices
import (
"encoding/json"
"fmt"
"sync"
"github.com/teleclimber/DropServer/cmd/ds-host/domain"
"github.com/teleclimber/DropServer/cmd/ds-host/record"
"github.com/teleclimber/twine-go/twine"
)
type AppGetterService struct {
AppGetter interface {
GetUser(key domain.AppGetKey) (domain.UserI... |
package main
// client.go
// r.20210819.0346
import (
"log"
"flag"
"os"
"os/signal"
"syscall"
"time"
"crypto/tls"
// "io/ioutil"
// "crypto/x509"
"github.com/gorilla/websocket"
smart "github.com/unix-world/smartgo"
)
const (
msgPeriod = 30 * time.Second
reconnectPeriod = 60 * time.Second
)
var targ... |
// Copyright 2016-2019 Granitic. All rights reserved.
// Use of this source code is governed by an Apache 2.0 license that can be found in the LICENSE file at the root of this project.
package validate
import (
"context"
"fmt"
"github.com/graniticio/granitic/v2/config"
"github.com/graniticio/granitic/v2/ioc"
"gi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.