text stringlengths 3.08k 10.4k |
|---|
// Code generated by transpiler. DO NOT EDIT.
/**
* Go Video Downloader
*
* Copyright 2019 Tenta, 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.or... |
package nat
import (
"context"
"errors"
"fmt"
"sync"
"time"
nat "github.com/RTradeLtd/go-nat"
"go.uber.org/zap"
)
var (
// ErrNoMapping signals no mapping exists for an address
ErrNoMapping = errors.New("mapping not established")
)
// DefaultTimeout for discovering nat
var DefaultTimeout = nat.DefaultTimeo... |
/*
Copyright 2019 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... |
package scrape
import (
"bytes"
"context"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"strconv"
"time"
"github.com/pingcap/log"
"github.com/pingcap/ng-monitoring/component/conprof/meta"
"github.com/pingcap/ng-monitoring/component/conprof/store"
"github.com/pingcap/ng-monitoring/config"
"github.com/pkg/e... |
package main
import (
"log"
"fmt"
"forjj/creds"
"forjj/git"
"os"
"github.com/forj-oss/forjj-modules/trace"
)
func (a *Forj) maintainAction(string) {
if err := a.Maintain(); err != nil {
log.Fatalf("Forjj maintain issue. %s", err)
}
println("FORJJ - maintain ", a.w.GetString("organization"), " DONE") // , ... |
package gerrit
import (
"crypto/md5" // nolint: gas
"crypto/rand"
"encoding/base64"
"errors"
"fmt"
"io"
"net/http"
"strings"
)
var (
// ErrWWWAuthenticateHeaderMissing is returned by digestAuthHeader when the WWW-Authenticate header is missing
ErrWWWAuthenticateHeaderMissing = errors.New("WWW-Authenticate h... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package glacier
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
)
// The input value for ListTagsForVaultInput.
type ListTagsForVaultInput st... |
package app_test
import (
"code.cloudfoundry.org/tlsconfig"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/http/httptest"
"sync/atomic"
"time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"code.cloudfoundry.org/loggregator-agent/cmd/syslog-binding-cache/app"
"code.cloudfoundry.org/logg... |
package model
import (
"errors"
"math"
"sort"
"github.com/alexhans1/certainty_poker/helpers"
poker "github.com/alexhans1/poker-chip-allocation"
)
// CurrentBettingRound returns the last element of the game's QuestionRounds slice
func (q *QuestionRound) CurrentBettingRound() *BettingRound {
return q.BettingRoun... |
package request
//请求子商品信息
type ChildInfo struct {
Id string `valid:"Required" 父商品id`
CompanyRoomId string `仓库Id`
}
type SwitchGoods struct {
Id int `商品id`
IsParent int `1是父商品 0不是`
UnitId int `单位Id`
CompanyRoomId int `仓库Id`
}
type SwitchGoodsString struct {
Id strin... |
package dockerbuild
import (
"bufio"
"bytes"
"io/ioutil"
"strings"
"sync"
"github.com/sirupsen/logrus"
"go.mikenewswanger.com/utilities/executil"
"go.mikenewswanger.com/utilities/filesystem"
)
// BuildBaseImages builds all docker images by heirarchy
func BuildBaseImages(dockerRegistryBasePath string, tag st... |
package conf
import (
"errors"
"net/url"
"os"
"strconv"
"strings"
"time"
"github.com/BurntSushi/toml"
"go-common/library/conf"
"go-common/library/log"
xtime "go-common/library/time"
)
// ENV Key
const (
BNSDNSAddr = "BNS_DNS_HOST"
BNSDNSPort = "BNS_DNS_PORT"
BNSHTTPAddr = "BNS_HTTP_ADDR"
BNSHTTPPort... |
// *** 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 exoscale
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Provides information on a [Private Network][pri... |
/*
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 blade
import (
"context"
"encoding/json"
"fmt"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types"
"os"
"time"
"github.com/TylerBrock/colorjson"
sawconfig "github.com/TylerBrock/saw/config"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v... |
// Copyright 2020 ConsenSys Software 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 a... |
package main
import (
"encoding/json"
"fmt"
"math"
"strings"
"github.com/dadosjusbr/coletores"
)
// parse takes a json filePath and retrieve the array of employees from it.
func parse(filePath string) ([]coletores.Employee, error) {
resultJSON, err := readJSON(filePath)
if err != nil {
return nil, fmt.Error... |
package server
import (
"bytes"
"log"
"net/http"
"time"
"gorm.io/gorm"
ws "github.com/gorilla/websocket"
"github.com/uwezo-app/chat-server/utils"
)
// ConnectedClient holds the connection info of a specific client
type ConnectedClient struct {
gorm.Model
UserID uint `gorm:"primaryKey"`
Client *Client `... |
// Copyright 2016 The Gosl Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build ignore
package main
import (
"bytes"
"encoding/json"
"github.com/cpmech/gosl/chk"
"github.com/cpmech/gosl/gm/msh"
"github.com/cpmech/gosl/io... |
// Based on http://golang.org/src/pkg/hash/crc32/crc32_test.go
// Adapted for CRC-16 by <NAME> (http://npat.efault.net/)
package crc16
import (
"io"
"testing"
)
type crcCheck struct {
cfg *Conf
sum uint16
in string
}
var cTbl = []crcCheck{
{X25, 0x906e, "123456789"},
{PPP, 0x906e, "123456789"},
{Modbus, 0x... |
// Copyright (C) 2019 Orange
//
// This software is distributed under the terms and conditions of the 'Apache License 2.0'
// license which can be found in the file 'License.txt' in this package distribution
// or at 'http://www.apache.org/licenses/LICENSE-2.0'.
//
package addcolumn
import (
"encoding/csv"
"io"
... |
package endure
import (
"reflect"
"github.com/spiral/endure/pkg/fsm"
"github.com/spiral/endure/pkg/vertex"
"github.com/spiral/errors"
"go.uber.org/zap"
)
/*
Traverse the DLL in the forward direction
*/
func (e *Endure) internalInit(vrtx *vertex.Vertex) error {
const op = errors.Op("endure_internal_init")
... |
package main
import (
"errors"
"fmt"
"io"
"math"
"math/rand"
"reflect"
"strings"
"sync"
"sync/atomic"
"time"
"unsafe"
"golang.org/x/tour/reader"
"golang.org/x/tour/tree"
)
var wg sync.WaitGroup
// IPAddr ipv4 address
type IPAddr [4]byte
func (i IPAddr) String() string {
return fmt.Sprintf("%v.%v.%v.%... |
package main
import (
"fmt"
"net"
"net/http"
"os"
"os/signal"
"syscall"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
kitgrpc "github.com/go-kit/kit/transport/grpc"
stdopentracing "github.com/opentracing/opentracing-go"
"github.com/openzipkin/zipkin-go"
zipkinhttp "github.com/openzipkin/zi... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package redshift
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/redshift/types"
smithy "github.com/awslabs/smithy-go"
"github.com/awslabs/smithy-... |
package discovery
import (
"bufio"
"fmt"
"io"
"os"
"strings"
"sync"
"time"
)
type leaseFile struct {
file, format string
}
var leaseFiles = []leaseFile{
{"/var/run/dhcpd.leases", "isc-dhcpd"},
{"/var/lib/dhcp/dhcpd.leases", "isc-dhcpd"},
{"/var/dhcpd/var/db/dhcpd.leases", "isc-dhcpd"},
{"/var/lib/misc/dn... |
/*
Copyright (c) Facebook, Inc. and its affiliates.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
*/
package decode
// InformationElementIdentifier is a byte for identifying an element in a message
type InformationEl... |
package byteutil
import (
"sync"
"github.com/szuwgh/temsearch/pkg/engine/tem/global"
bin "github.com/szuwgh/temsearch/pkg/engine/tem/mybinary"
)
//内存分配
type InvertedBytePool struct {
// buffers [][]byte //数据
// buffer []byte //current buffer
// bufIndex int
bytePool
//usedBufSize uint64
MaxblockSize i... |
package exporter
import (
"context"
"errors"
"fmt"
"github.com/Masterminds/sprig/v3"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/prometheus/client_golang/prometheus"
pconfig "github.com/prometheus/common/config"
"io"
"io/ioutil"
"jsonbox_exporter/config"
"math"
"net/http"
"n... |
// +build !nodbxml
package main
import (
pqnode "github.com/rug-compling/paqu/internal/node"
"github.com/pebbe/dbxml"
"github.com/pebbe/util"
"encoding/xml"
"fmt"
"os"
"strings"
)
type Alpino_ds struct {
XMLName xml.Name `xml:"alpino_ds"`
Version string `xml:"version,attr,omitempty"`
Metada... |
package local_e2e
import (
"net/http"
"bytes"
"context"
"fmt"
"github.com/solo-io/gloo/pkg/api/types/v1"
"crypto/tls"
"crypto/x509"
"io/ioutil"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/pkg/errors"
. "github.com/solo-io/gloo/test/helpers"
)
const (
sslCertificateChainKey = "tl... |
package server
import (
"context"
"sync"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/zero-os/0-Disk/config"
"github.com/zero-os/0-Disk/log"
"github.com/zero-os/0-Disk/tlog"
"github.com/zero-os/0-Disk/tlog/schema"
"github.com/zero-os/0-Disk/tlog/stor"
"g... |
/*
* Tencent is pleased to support the open source community by making 蓝鲸 available.
* Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the Li... |
package ethereum
import (
"errors"
"fmt"
"math/big"
"time"
"github.com/ethereum/go-ethereum"
ecommon "github.com/ethereum/go-ethereum/common"
ecore "github.com/ethereum/go-ethereum/core"
etypes "github.com/ethereum/go-ethereum/core/types"
"gitlab.com/thorchain/thornode/common"
"gitlab.com/thorchain/thornod... |
// 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
package cmds
import (
"bytes"
"fmt"
gbuild "github.com/gopherjs/gopherjs/build"
"github.com/gopherjs/gopherjs/compiler"
"github.com/pubgo/vapper/templates"
"go/build"
"go/scanner"
"go/types"
"io"
"os"
"os/exec"
"path/filepath"
"syscall"
"text/template"
"time"
"github.com/gobuffalo/envy"
"github.com/p... |
package stripe
import (
"net/url"
"strconv"
"strings"
)
// Invoice represents statements of what a customer owes for a particular
// billing period, including subscriptions, invoice items, and any automatic
// proration adjustments if necessary.
//
// see https://stripe.com/docs/api#invoice_object
type Invoice str... |
package clientselector
import (
"errors"
"math/rand"
"strings"
"sync"
"time"
"github.com/hashicorp/consul/api"
"github.com/smallnest/rpcx"
"github.com/smallnest/rpcx/core"
)
// ConsulClientSelector is used to select a rpc server from consul.
//This registry is experimental and has not been test.
type ConsulC... |
/*
Copyright © 2017 OpenText Corp.
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, su... |
package writer
import (
"context"
"fmt"
"go.nanomsg.org/mangos/v3"
"go.nanomsg.org/mangos/v3/protocol/pub"
"go.nanomsg.org/mangos/v3/protocol/push"
_ "go.nanomsg.org/mangos/v3/transport/ipc"
_ "go.nanomsg.org/mangos/v3/transport/tcp"
"strings"
"sync"
"time"
"github.com/Jeffail/benthos/v3/lib/log"
"github.... |
// 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 i... |
/*
Copyright 2016 The Rook Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to ... |
package ast
import (
"fmt"
"os"
"strings"
"github.com/ku-lang/ku/util/log"
"github.com/ku-lang/ku/util"
)
type IdentType int
const (
IDENT_VARIABLE IdentType = iota
IDENT_TYPE
IDENT_FUNCTION
IDENT_MODULE
)
func (v IdentType) String() string {
switch v {
case IDENT_FUNCTION:
return "function"
case ID... |
package main
import (
"encoding/xml"
"fmt"
"io/ioutil"
"log"
"os"
"runtime"
"sort"
"strconv"
"strings"
"time"
"github.com/bodgit/rom"
"github.com/bodgit/rom/dat"
"github.com/bodgit/rom/synchronizer"
"github.com/olekukonko/tablewriter"
"github.com/urfave/cli/v2"
)
var (
version = "dev"
commit = "non... |
package resource
import (
"fmt"
"log"
"sort"
"strings"
"time"
"github.com/Azure/azure-sdk-for-go/services/resources/mgmt/2020-06-01/resources"
"github.com/hashicorp/go-azure-helpers/resourcemanager/location"
"github.com/hashicorp/terraform-provider-azurerm/helpers/azure"
"github.com/hashicorp/terraform-provi... |
package sexpr
import (
"fmt"
"io"
"github.com/google/xtoproto/textpos"
)
type sourceFile interface {
fileName() string
readRune() (rune, error)
peekRune() (rune, error)
unreadRune() error
cursorOffset() cursorOffset
offsetToRowCol(cursorOffset) rowCol
rowColToOffset(rc rowCol) cursorOffset
}
type cursorOf... |
package venom
import (
"context"
"encoding/json"
"fmt"
"os"
"path"
"time"
"github.com/gosimple/slug"
"github.com/ovh/cds/sdk/interpolate"
)
type dumpFile struct {
Variables H `json:"variables"`
TestStep TestStep `json:"step"`
Result interface{} `json:"result"`
}
//RunTestStep executes a ... |
package utils
import (
"bufio"
"fmt"
"os"
"path/filepath"
"strings"
"github.com/iancoleman/strcase"
ispnv1 "github.com/infinispan/infinispan-operator/pkg/apis/infinispan/v1"
"github.com/infinispan/infinispan-operator/pkg/controller/constants"
users "github.com/infinispan/infinispan-operator/pkg/infinispan/se... |
// Copyright Red Hat, Inc., and individual 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
//
// Unless required by appl... |
/*
This file was originally part of github.com/michaeljs1990/sqlitestore which is
licensed under the MIT license. Copyright (c) 2013 Contributors.
All modifications are Copyright (c) 2016 The Packet Guardian Authors.
*/
package common
import (
"database/sql"
"encoding/gob"
"fmt"
"net/http"
"time"
"github.com/... |
// Copyright 2019 Yunion
//
// 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 apis
import (
"context"
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
"strconv"
"strings"
"sync"
"syscall"
"unsafe"
"github.com/pkg/errors"
"github.com/rancher/wins/pkg/powershell"
"github.com/sirupsen/logrus"
)
var ppool sync.Map
type process struct {
id int
name string
stdout io.ReadClo... |
package main
import (
"context"
"fmt"
"io"
"os"
"path/filepath"
"strings"
"github.com/docker/docker/pkg/archive"
"github.com/spf13/cobra"
)
// createDescription is used to describe create command in detail and auto generate command doc.
var copyDescription = "Copy files/folders between a container and the lo... |
package main
import (
"bufio"
"crypto/rsa"
"encoding/json"
"fmt"
"net/http"
"os"
"strconv"
"strings"
)
var (
DBptr *DB
PRIV *rsa.PrivateKey
)
func init() {
DBptr = DBInit("database.db")
PRIV = ParsePrivate([]byte(PemPrivateKey))
if DBptr == nil || PRIV == nil {
panic("init error")
}
}
func main() {... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: src/envoy/tcp/metadata_exchange/config/metadata_exchange.proto
package config
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 _ = ... |
package toposort
// Graph represents a directed graph. It is not safe
// for use by concurrent goroutines.
type Graph struct {
nodes []string
outputs map[string]map[string]int
inputs map[string]int
objects map[string]Interface
}
// NewGraph returns a new graph with an initial capacity.
func NewGraph(cap int) *... |
// vim: ff=unix ts=3 sw=3 noet
package pego
import (
"fmt"
"strings"
)
// Interface for instructions.
// XXX(mizardx): Make this more specific?
type Instruction interface {
fmt.Stringer
}
// Match a single character.
type IChar struct {
char byte
}
func (op *IChar) String() string {
return fmt.Sprintf("Char %... |
/*
Copyright 2021 The Kupenstack 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 codec
import (
/*
#cgo linux,amd64 pkg-config: libav_linux_amd64.pc
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include "libavcodec/avcodec.h"
#include "libavutil/avutil.h"
#include "libavutil/opt.h"
#include "libavresample/avresample.h"
... |
// Copyright 2020 The pmon 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 (
"bufio"
"flag"
"fmt"
"image/color"
"log"
"os"
"strings"
"time"
"github.com/sbinet/pmon"
"go-hep.org/x/hep/hbook"
"go-hep.o... |
package avro
import (
"fmt"
"sort"
"testing"
"github.com/wshirey/confluent-kafka-go/kafka"
"strconv"
"log"
)
var schemaTests = []struct {
source string
load func(string) string
testSerializer func(record Schema) interface{}
verifySerializer func(...interface{})
}{
{source: "./schemas/advanced.... |
package ascii
import (
"fmt"
"image"
"image/color"
"image/gif"
"time"
"github.com/gdamore/tcell/v2"
)
type Renderer struct {
screen tcell.Screen
image *gif.GIF
width int
height int
fill bool
ppcX int
ppcY int
}
var ErrQuit = fmt.Errorf("user quit")
func (r *Renderer) init() error {
screen, er... |
package controllers
import (
"html/template"
. "pixiublog/models"
"pixiublog/utils"
"strings"
)
type WebController struct {
BaseController
}
func (self *WebController) Type() {
typeID, err := self.GetInt(":type")
if err != nil {
typeID = -1
}
home(self, typeID, -1, -1)
self.Data["url"] = "type"
self.dis... |
package direktiv
import (
"encoding/base64"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"math"
"os"
"os/exec"
"path/filepath"
"strings"
parser "github.com/novln/docker-parser"
"github.com/vorteil/direktiv/pkg/dlog"
"github.com/vorteil/direktiv/pkg/isolate"
log "github.com/sirupsen/logrus"
)
func sigintAllC... |
package kubernetes
import (
"context"
"fmt"
"time"
"gitlab.jiagouyun.com/cloudcare-tools/datakit"
"gitlab.jiagouyun.com/cloudcare-tools/datakit/io"
"gitlab.jiagouyun.com/cloudcare-tools/datakit/plugins/inputs"
kubev1apps "k8s.io/client-go/kubernetes/typed/apps/v1"
)
const kubernetesDeploymentName = "kubernete... |
package main
import (
"bufio"
"compress/gzip"
"errors"
"flag"
"fmt"
"log"
"os"
"path/filepath"
"strconv"
"strings"
"github.com/bradfitz/gomemcache/memcache"
"github.com/golang/protobuf/proto"
"./appsinstalled"
)
const NORMAL_ERR_RATE = 0.01
type AppsInstalled struct {
devType string
devId string
... |
package gumbleopenal // import "github.com/bmmcginty/gumble/gumbleopenal"
import (
"encoding/binary"
"errors"
"os/exec"
"time"
"github.com/bmmcginty/gumble/gumble"
"github.com/bmmcginty/go-openal/openal"
)
var (
ErrState = errors.New("gumbleopenal: invalid state")
ErrMic = errors.New("gumbleopenal: microph... |
package otlp
import (
"bytes"
"context"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"sync"
"github.com/observiq/stanza/entry"
"github.com/observiq/stanza/errors"
"github.com/observiq/stanza/operator"
"github.com/observiq/stanza/operator/buffer"
"github.com/observiq/stanza/operator/flusher"
"github.com/observi... |
package swarm
import (
"bytes"
"encoding/json"
"fmt"
"io"
"net"
"net/http"
"net/url"
log "github.com/sirupsen/logrus"
)
type nodeInfoClient interface {
// GetNodeInfo returns a list of peers to join from an
// external service discovery source.
GetNodeInfo() ([]*NodeInfo, error)
// Self returns NodeInfo ... |
package runtime
import (
"bytes"
"context"
"errors"
"fmt"
"io"
"mime"
"net/http"
"net/url"
"path"
"strings"
"sync"
"github.com/dogmatiq/protean/internal/proteanpb"
"github.com/dogmatiq/protean/internal/protomime"
"github.com/dogmatiq/protean/rpcerror"
"google.golang.org/protobuf/proto"
)
// ClientOpti... |
package deriver
import (
"bytes"
"crypto/sha256"
"encoding/hex"
"fmt"
"log"
"sort"
"github.com/btcsuite/btcd/txscript"
"github.com/btcsuite/btcutil"
"github.com/btcsuite/btcutil/hdkeychain"
. "github.com/square/beancounter/utils"
)
// AddressDeriver is a struct that contains necessary information to deriv... |
/*
Copyright 2020 Motoreq Infotech Pvt 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 applicable law or agreed to in writi... |
package nodelocal
import (
"errors"
"fmt"
"math"
"strconv"
"strings"
"time"
"github.com/shirou/gopsutil/cpu"
"github.com/shirou/gopsutil/load"
"k8s.io/klog/v2"
"k8s.io/kubernetes/pkg/kubelet/cm/cpuset"
"github.com/gocrane/crane/pkg/common"
"github.com/gocrane/crane/pkg/ensurance/collector/types"
)
const... |
// To run this program: go generate
//
// (the go:generate line is in gen.go/gen_go1.17.go/gen_go1.18.go)
//
//go:build generate && !go1.17
// +build generate,!go1.17
package main
import (
"fmt"
"go/ast"
"go/parser"
"go/token"
"log"
"os"
"runtime"
"sort"
"strconv"
"strings"
"github.com/dolmen-go/codegen"
... |
package mapping
type MetricInfo struct {
Namespace string
DimensionName string
Period int64
MetricDetails []MetricDetail
}
type MetricDetail struct {
MetricName string
Statistics string
}
var MetricsMap = map[string]MetricInfo{
// https://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/viewing_me... |
package horreum
import (
hyperfoilv1alpha1 "github.com/Hyperfoil/horreum-operator/pkg/apis/hyperfoil/v1alpha1"
routev1 "github.com/openshift/api/route/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
func keycloakPod(cr *hyperfoilv1alpha1.Horreum) *corev1.Pod {
initContainers := ma... |
/*
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, ... |
package folie
// This file contains !commands.
import (
"bytes"
"fmt"
"io"
"os"
"sync"
"time"
)
// bufferPool holds buffers to use in Read() calls.
var bufferPool = sync.Pool{New: func() interface{} { return make([]byte, 256) }}
func getBuffer() []byte { return bufferPool.Get().([]byte) }
func putBuffer(b []b... |
// Package permission
//
// @author: xwc1125
package permission
import (
"context"
"errors"
"github.com/chain5j/chain5j-pkg/codec"
"github.com/chain5j/chain5j-pkg/event"
"github.com/chain5j/chain5j-protocol/models"
"github.com/chain5j/chain5j-protocol/models/eventtype"
"github.com/chain5j/chain5j-protocol/proto... |
// Copyright 2017 Google
//
// 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 (C) 2019 <NAME>. All Rights Reserved.
// Package keyfile provides an interface to read and write small secrets such
// as encryption keys in a persistent format protected by a passphrase.
//
// Each secret is stored in a binary packet, inside which the secret is
// encrypted and authenticated with AES-256... |
// +build js
package main
import (
"net/http"
"github.com/gopherjs/jquery"
s5 "github.com/seven5/seven5/client"
"github.com/iansmith/movienight/client/uilib"
"github.com/iansmith/movienight/shared"
"github.com/iansmith/movienight/wire"
)
var (
loginParent = s5.NewHtmlId("span", "login-parent")
newMovie ... |
package watch
import (
"fmt"
"log"
"time"
"github.com/prometheus/client_golang/prometheus"
"github.com/steinarvk/watcher/config"
"github.com/steinarvk/watcher/hostinfo"
"github.com/steinarvk/watcher/runner"
"github.com/steinarvk/watcher/scheduler"
"github.com/steinarvk/watcher/storage"
"github.com/cenkalti... |
package internal
import (
"encoding/json"
"github.com/operator-framework/api/pkg/validation/errors"
interfaces "github.com/operator-framework/api/pkg/validation/interfaces"
policyv1beta1 "k8s.io/api/policy/v1beta1"
rbacv1 "k8s.io/api/rbac/v1"
schedulingv1 "k8s.io/api/scheduling/v1"
"k8s.io/apimachinery/pkg/api... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package quicksight
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
)
type UpdateThemeAliasInput struct {
_ struct{} `type:"structure"`
// ... |
package anydesk
import (
"fmt"
"github.com/stretchr/testify/assert"
"os"
"testing"
"time"
)
func TestNewClientDetailRequest(t *testing.T) {
server := NewAPITestServer(t, "/clients/100000000", "./_tests/client_detail.json", 200)
defer server.Close()
client := NewAPITestClient(t, server, "", "")
req := NewCl... |
package httpx
import (
"bytes"
"crypto"
"crypto/ecdsa"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"encoding/pem"
"errors"
"strings"
"time"
)
var (
ErrMissPrivateKey = errors.New("certificate: private key miss")
ErrMissPublicKey = errors.New("certificate: public key miss")
ErrNotEffect... |
package main
import (
"fmt"
"io/ioutil"
"regexp"
"strconv"
"strings"
)
const testStr string = `position=< 9, 1> velocity=< 0, 2>
position=< 7, 0> velocity=<-1, 0>
position=< 3, -2> velocity=<-1, 1>
position=< 6, 10> velocity=<-2, -1>
position=< 2, -4> velocity=< 2, 2>
position=<-6, 10> velocity=< 2, -2>
po... |
package writers
import (
"fmt"
"io"
"net"
"sync"
"github.com/modulo-srl/sparalog"
"github.com/modulo-srl/sparalog/writers/base"
)
type tcpWriter struct {
base.Writer
debug bool
stateCb StateChangeCallback
listener net.Listener
quitCh chan bool
//connsWG sync.WaitGroup
mu sync.RWMutex
conn... |
package linepay
import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
// `Amount` required, valid amount `form.amount != sum(packages[].amount) + sum(packages[].userFee) + shippingFee`
// `Currency` required, is ISO 4217, supported: USD, JPY, TWD, THB
// `OrderId` required
// if `Capture` true: only ... |
package main
import (
"bytes"
"context"
"image"
"image/color"
"io/ioutil"
"os"
"github.com/MakeNowJust/hotkey"
"github.com/atotto/clipboard"
"github.com/bay0/ptrscr/ptrscr-app/gist"
"github.com/bay0/ptrscr/ptrscr-app/icon"
"github.com/bay0/ptrscr/ptrscr-app/logging"
"github.com/bay0/ptrscr/ptrscr-app/regi... |
package billing
import (
"fmt"
"net"
"strconv"
"sync"
"time"
log "github.com/Sirupsen/logrus"
"github.com/fluent/fluent-logger-golang/fluent"
"github.com/prometheus/client_golang/prometheus"
"golang.org/x/net/context"
"github.com/weaveworks/common/instrument"
)
var (
// RequestDuration is the duration of... |
package main
import (
"fmt"
"net"
"os"
"strconv"
"strings"
"github.com/futjikato/goBattleships/battleships"
"github.com/futjikato/goBattleships/messages"
)
type screenState string
const (
lobbyScreen screenState = "lobby"
setupScreen screenState = "setup"
gameScreen screenState = "game"
)
type hostGameS... |
// Copyright 2021 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 firmware
import (
"context"
"regexp"
"strconv"
"strings"
"time"
"chromiumos/tast/common/servo"
"chromiumos/tast/errors"
"chromiumos/t... |
package logs
import (
"dbcache/conf"
"errors"
"fmt"
"path"
"runtime"
"strings"
)
type logLevel uint16 //日志级别
//从上往下,日志级别越高
const (
UNKNOWN logLevel = iota
DEBUG
TRACE
INFO
WARNING
ERROR
FATAL
)
var (
Flog *FileLog //文件日志对象
Slog *StdoutLog //标准输出对象
Elog *EmailLog //email对象
sL... |
/*
* Copyright (c) 2018 WSO2 Inc. (http:www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you 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/license... |
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package rwsetutil
import (
"fmt"
"github.com/golang/protobuf/proto"
"github.com/mcc-github/blockchain-protos-go/ledger/rwset/kvrwset"
"github.com/mcc-github/blockchain/bccsp"
bccspfactory "github.com/mcc-github/blockchain/bccsp/... |
package box
// box gets information about the Vagrant box "default" directly from VirtualBox
// This package gives most up-to-date information about the server box
import (
"errors"
"fmt"
"io/ioutil"
"path/filepath"
"regexp"
"strconv"
"time"
"naksu/boxversion"
"naksu/constants"
"naksu/log"
"naksu/mebrouti... |
package main
import (
"fmt"
"github.com/sasha-s/go-deadlock"
"github.com/Demonware/balanced/pkg/apis/balanced/v1alpha1"
"github.com/golang/glog"
api "k8s.io/api/core/v1"
coreinformer "k8s.io/client-go/informers/core/v1"
"k8s.io/client-go/tools/cache"
)
type TunnelReconciler struct {
hostname stri... |
// Copyright 2014 CoreOS, 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... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.