text stringlengths 3.08k 10.4k |
|---|
package information
import (
"gin-vue-admin/global"
"gin-vue-admin/model"
"github.com/gookit/color"
"gorm.io/gorm"
"time"
)
var Workflow = new(workflow)
type workflow struct{}
var WorkflowProcess = []model.WorkflowProcess{
{ID: "leaveFlow", CreatedAt: time.Now(), UpdatedAt: time.Now(), Name: "leaveFlow", Claz... |
package tunnel
import (
"net"
"strconv"
"sync"
"sync/atomic"
"github.com/koding/logging"
)
type listener struct {
net.Listener
*vaddrOptions
done int32
// ips keeps track of registered clients for ip-based routing;
// when last client is deleted from the ip routing map, we stop
// listening on connectio... |
// Copyright 2014, The Serviced Authors. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
package elastic
import (
gocheck "gopkg.in/check.v1"
"fmt"
"io/ioutil"
"log"
"math/rand"
"os"
"os/exec"
"strings"
"time"
)
const (
esVers... |
package internal
import (
"encoding/json"
"github.com/jmoiron/jsonq"
"fmt"
"log"
"net/url"
"strconv"
"github.com/gorilla/websocket"
)
type (
Config struct {
TeamAFile *string
TeamBFile *string
TestOnly *bool
}
obsServer struct {
address string
port string
connection *websocket.Conn
... |
package main
import (
"context"
"errors"
"flag"
"github.com/antssh/types"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"
"golang.org/x/crypto/ssh"
"net"
"os"
"os/exec"
"os/signal"
"path/filepath"
"syscall"
"time"
)
var (
err error
exe string
cfg Config
)
func exit() {
if err != nil {
log.Er... |
// Copyright 2021 The Chromium 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 implements the App Engine based HTTP server to handle request
// to GoFindit
package main
import (
"context"
"fmt"
"infra/appengine/go... |
package grpctest
import (
"os"
"path/filepath"
"strings"
"github.com/douyu/juno/pkg/model/db"
"github.com/douyu/jupiter/pkg/xlog"
"github.com/jhump/protoreflect/desc"
"github.com/jhump/protoreflect/desc/protoparse"
)
// example:
// proto := /home/www/server/fun-ProtoParser/fun/comment/srv/comment/comment.prot... |
/*
Copyright 2021 The Alibaba 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, sof... |
// Package dockerfile implements a minimal dockerfile parser.
package dockerfile
import (
"context"
"errors"
"fmt"
"io"
"strings"
"unicode"
"unicode/utf8"
"golang.org/x/text/transform"
)
// GetLabels parses the Dockerfile in the provided Reader and returns all
// discovered labels as provided by the LABEL in... |
// The ncd itself
package ncd
import (
"fmt"
"github.com/isbm/uyuni-ncd/transport"
"github.com/isbm/uyuni-ncd/transport/eventmappers"
"github.com/nats-io/nats.go"
"log"
"strings"
)
const (
CHANNEL_NODES = "nodes"
CHANNEL_DIRECTOR = "director"
)
type NcdConf struct {
Running bool
Leader bool
}
type Nc... |
package main
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"os"
"os/exec"
"path/filepath"
"sort"
"strings"
"github.com/ryanuber/go-license"
)
func directMods(path string) (map[string]struct{}, error) {
mods := make(map[string]struct{})
txt, err := ioutil.ReadFile(path)
if err != nil {
... |
package message
import "encoding/xml"
// MsgType 基本消息类型
type MsgType string
// EventType 事件类型
type EventType string
const (
//MsgTypeText 表示文本消息
MsgTypeText MsgType = "text"
//MsgTypeImage 表示图片消息
MsgTypeImage = "image"
//MsgTypeVoice 表示语音消息
MsgTypeVoice = "voice"
//MsgTypeVideo 表示视频消息
MsgTypeVideo = "video"... |
package sql
import (
"database/sql"
"errors"
"reflect"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/mock"
)
type Custom struct{}
var _ sql.Scanner = (*Custom)(nil)
func (c *Custom) Scan(interface{}) error {
return nil
}
type User struct {
ID uint
Name st... |
package notion
import (
"encoding/json"
"net/url"
)
// These constants represent the enums in the Notion API for rich_text objects
const (
RichTextTypeEnumText = "text"
RichTextTypeEnumMention = "mention"
RichTextTypeEnumEquation = "equation"
AnnotationColorEnumDefault = "default"
AnnotationColo... |
// 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... |
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// Source: image.proto
package pb
import (
context "context"
transport "github.com/erda-project/erda-infra/pkg/transport"
grpc1 "github.com/erda-project/erda-infra/pkg/transport/grpc"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status ... |
package main
import (
"math"
"strconv"
"syscall/js"
)
const (
dead = iota
alive = iota
)
const (
toggleAction = iota
gliderAction = iota
pulsarAction = iota
)
const (
cellSize = 10
borderSize = 1
)
var (
universe *Universe
ctx js.Value
lastTick float64
animationID = -1
c... |
// Copyright 2016 The Vanadium 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 lockutil
import (
"bytes"
"fmt"
"io"
"os"
"os/exec"
"regexp"
"strconv"
"syscall"
)
// v1 improves upon v0 in two ways:
//
// - reduces t... |
// Code generated by gotdgen, DO NOT EDIT.
package tdapi
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdjson"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
// No-op definition for keeping imports.
var (
_ = bin.Buffer{}
_... |
package tiss
import (
"bytes"
"io"
"os"
"testing"
"github.com/kpmy/tiss/gen"
"github.com/kpmy/tiss/ir"
"github.com/kpmy/tiss/ir/ops"
"github.com/kpmy/tiss/ir/types"
"github.com/kpmy/tiss/ps"
"github.com/kpmy/ypk/fn"
)
func TestDump(t *testing.T) {
if f, err := os.Create("dump.wast"); err == nil {
defer ... |
// testmynet_cli - CLI based network bandwidth tester using testmy.net.
//
// See instructions in the README.md file that accompanies this program.
//
// (C) by <NAME> <paganini AT paganini DOT net>
//
package main
import (
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"os/user"
"path/filepath"
"strings"
"time"
"g... |
package store
import (
"time"
)
// For convenient storage, special methods are provided that apply to
// data which fulfills the Item interface
type Item interface {
// return a key for the data item
Key() []byte
// return a store id for the data item
StoreID() []byte
// serialize data item
Bytes() ([]byte, er... |
/**
* MIT License
*
* Copyright (c) 2020 CNES
*
* 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, me... |
package sbmark
import (
"fmt"
"sort"
"time"
"github.com/montanaflynn/stats"
)
type BurstBenchmarkMode struct {
}
func (m *BurstBenchmarkMode) DisableKeepAlives() bool {
// We want to keep the latency as low as possible for measuring the max throughput.
// We enable keepalives to force connection pooling so th... |
package main
import (
"errors"
"flag"
"fmt"
"os"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/dynamodb"
"github.com/aws/aws-sdk-go/service/dynamodb/dynamodbattribute"
"github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface"
)
func usage() {
fm... |
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20180915
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type ArtifactSource struct {
pulumi.Cus... |
// Copyright 2019 The LUCI Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... |
// Copyright The 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 main
import (
"flag"
"fmt"
"net/http"
"os"
"os/signal"
"syscall"
"time"
"github.com/golang/glog"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/rtreffer/kubernetes-pressurecooker/pkg/config"
"github.com/rtreffer/kubernetes-pre... |
package kangaroo
import (
"time"
"github.com/lindsaygelle/nook"
"github.com/lindsaygelle/nook/animal"
"github.com/lindsaygelle/nook/character"
"github.com/lindsaygelle/nook/gender"
"github.com/lindsaygelle/nook/personality"
"golang.org/x/text/language"
)
var (
kittBirthday = nook.Birthday{
Day: 11,
Mon... |
package libgolb
import (
"fmt"
"log"
"net/http"
"os"
"os/exec"
"path/filepath"
"time"
)
// ANSIC = "Mon Jan _2 15:04:05 2006"
// UnixDate = "Mon Jan _2 15:04:05 MST 2006"
// RubyDate = "Mon Jan 02 15:04:05 -0700 2006"
// RFC822 = "02 Jan 06 15:04 MST"
// RFC822Z = "02 Jan 06 15:04 -0700" /... |
// Copyright (c) 2020, NLP Odyssey 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 pretokenizedstring
import (
"fmt"
"github.com/nlpodyssey/gotokenizers/encodings"
"github.com/nlpodyssey/gotokenizers/models"
"github.com/... |
package parser
import (
"strconv"
"strings"
"github.com/census-ecosystem/opencensus-experiments/go/iot/protocol"
"github.com/pkg/errors"
)
type TextParser struct {
}
// In this function, it firstly transform the input byte stream into a map of string -> interface{}.
// If it manages so, it would extract the req... |
// Copyright ©2020 The go-hep 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 rcmd_test
import (
"bytes"
"fmt"
"os"
"path/filepath"
"testing"
"go-hep.org/x/hep/groot"
"go-hep.org/x/hep/groot/rcmd"
"go-hep.org/x/hep/... |
package main
import (
"flag"
"fmt"
"io/ioutil"
"os"
"strings"
)
type byteStream []byte
// exit code
const (
exitCodeOK int = iota
exitCodeError
)
const (
maxSize = 65536
endByte = 0xff
)
var (
cmd5LengthList = [][2]int{}
cmd6LengthList = [][2]int{}
)
var (
srcIndex = 0
destIndex = 0
)
var (
comman... |
package collector
import (
"errors"
"fmt"
"html"
"strconv"
"sync"
"time"
"github.com/kwf2030/cdp"
"github.com/kwf2030/commons/base"
)
var ErrNoRuleMatched = errors.New("no rule matched")
type Handler interface {
// 只会回调一次,所有字段一次性返回
OnFields(*Page, map[string]string)
// 按设置的导出周期回调(如export_cycl... |
// Package redis implements a communication interface with the redis server
// running on the BitBoxBase.
package redis
import (
"fmt"
"log"
"github.com/digitalbitbox/bitbox-base/middleware/src/rpcmessages"
"github.com/gomodule/redigo/redis"
)
// Redis is an interface representing a redis Client
type Redis inter... |
package mongo
import (
"context"
"github.com/reearth/reearth-backend/internal/infrastructure/mongo/mongodoc"
"github.com/reearth/reearth-backend/internal/usecase/repo"
"github.com/reearth/reearth-backend/pkg/id"
"github.com/reearth/reearth-backend/pkg/log"
"github.com/reearth/reearth-backend/pkg/property"
"git... |
package alert
import (
"sort"
"time"
"fmt"
)
type Type int
const (
ScaleUp Type = iota
ScaleDown
Retire
)
type Status int
const (
Created Status = iota
Pending
InProgress
Completed
)
type Trigger int
const (
Resources Trigger = iota
Schedule
Service
Instance
)
type Alert struct {
Type ... |
// Licensed to LinDB under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. LinDB licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compli... |
package service
import (
"context"
"fmt"
"log"
"strconv"
"strings"
"time"
"unfire/domain/model"
"unfire/infrastructure/datastore"
"unfire/usecase"
"unfire/utils"
"github.com/pkg/errors"
"github.com/garyburd/go-oauth/oauth"
)
type DatastoreController struct {
ds datastore.Datastore
}
// TODO: 失敗したらどうする... |
package analyzer
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"github.com/nearform/gammaray/nodepackage"
"github.com/nearform/gammaray/packagelockrunner"
"github.com/nearform/gammaray/pathrunner"
"github.com/nearform/gammaray/vulnfetcher"
"github.com/nearform/gammaray/vulnfetcher/nodeswg"
"github.com... |
// Copyright © 2013-2016 Galvanized Logic Inc.
// Use is governed by a BSD-style license found in the LICENSE file.
// +build !dx
// Use OpenAL by default.
package audio
import (
"fmt"
"log"
"strings"
"github.com/gazed/vu/audio/al"
)
// Note: 64-bit OpenAL may be difficult to locate for Windows machines.
// ... |
/*
Copyright 2021 The Clusternet 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 discord
import (
"strconv"
"github.com/bwmarrin/discordgo"
"github.com/rs/zerolog/log"
"github.com/target/flottbot/models"
"github.com/target/flottbot/remote"
)
/*
=======================================
Implementation for the Remote interface
=======================================
*/
// Client struct... |
package dbgen
import (
"fmt"
"io"
)
const (
oLcntMin = 1
oLcntMax = 7
oSuppSd = 10
oClrkSd = 11
oOdateSd = 13
oPrioSd = 38
oCkeySd = 40
oLcntSd = 43
oCmntLen = 49
oCmntSd = 12
oClrkScl = 1000
lQtySd = 14
lDcntSd = 15
lTaxSd = 16
lShipSd = 17
lSmodeSd = 18
lPkey... |
package radiusauth
import (
"reflect"
"testing"
"github.com/mholt/caddy"
"github.com/mholt/caddy/caddyhttp/httpserver"
)
func TestSetup(t *testing.T) {
// c := caddy.NewTestController("http", "radiusauth {\n server localhost:1812\nsecret TOOMANYSECRETS\n}")
c := caddy.NewTestController("http",
`radiusauth {
... |
package main
import (
"fmt"
"math/rand"
"sync"
"testing"
"github.com/stretchr/testify/require"
)
const (
peerName1 = "01:00:00:00:00:00"
peerName2 = "02:00:00:00:00:00"
peerName3 = "03:00:00:00:00:00"
nodeName1 = "fake-node-1"
nodeName2 = "fake-node-2"
testIters = 1000
)
func TestPeerListBasic(t *testin... |
package main
import (
"fmt"
"github.com/yuin/gopher-lua"
"strconv"
)
type Int64 int64
func (i Int64) register(L *lua.LState) {
mt := L.NewTypeMetatable("int64")
L.SetGlobal("int64", mt)
// static attributes
L.SetField(mt, "new", L.NewFunction(i.newInt64))
// meta-methods
L.SetFuncs(mt, map[string]lua.LGFunc... |
// Copyright 2012, Google Inc. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package stats is a wrapper for expvar. It addtionally
// exports new types that can be used to track performance.
// It also provides a callback hook that allow... |
package main
import (
"encoding/json"
"flag"
"io"
"log"
"net"
"os"
//"sync"
)
var LISTEN string
var SERVER string
var USERS []string
func handleConnection(c net.Conn) {
// rfc1929: username/password
var ver byte // 0x05 ?
var ml, nl, pl int
var support, allow bool
var s net.Conn
var err error
//var w... |
package main
import (
"log"
"reflect"
"sync"
v2 "github.com/envoyproxy/go-control-plane/envoy/api/v2"
core "github.com/envoyproxy/go-control-plane/envoy/api/v2/core"
endpoint "github.com/envoyproxy/go-control-plane/envoy/api/v2/endpoint"
"github.com/golang/protobuf/ptypes"
"github.com/golang/protobuf/ptypes/a... |
// Copyright © 2022 Cisco Systems, Inc. and its affiliates.
// 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
//... |
// Copyright 2017 The Fuchsia 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 analytics_util provides functions to send google analytics
package analytics_util
import (
"fmt"
"net/http"
"net/url"
"runtime"
"strconv"
... |
// Package clientlib provides utility functions to help with downloading client libraries.
package clientlib
import (
"archive/zip"
"bytes"
"fmt"
"io"
"net/http"
"os"
"path/filepath"
"sync"
"discovery-artifact-manager/common/errorlist"
)
// Lib represents a downloadable client library.
type Lib struct {
Na... |
// Copyright 2017 Pilosa Corp.
//
// 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... |
// KATO, Application Management Platform
// Copyright (C) 2021 Gridworkz Co., Ltd.
// 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 r... |
package ringman
import (
"encoding/json"
"fmt"
"net/http"
"github.com/Nitro/sidecar/catalog"
"github.com/Nitro/sidecar/receiver"
"github.com/Nitro/sidecar/service"
"github.com/relistan/go-director"
log "github.com/sirupsen/logrus"
)
const (
DefaultReceiverCapacity = 50
)
// A SidecarRing is a ring backed b... |
package agent
import (
"context"
"fmt"
"os"
"strings"
"sync"
"time"
"github.com/hashicorp/consul-template/manager"
consulApi "github.com/hashicorp/consul/api"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"github.com/trento-project/trento/agent/discovery"
"github.com/trento-project/trento/inte... |
// 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 applicable law or agreed to in wri... |
package visibility
import (
"context"
"fmt"
"go.uber.org/zap"
"reflect"
"runtime"
"strconv"
"strings"
)
type loggerKey struct {
}
var loggerKeyVal = &loggerKey{}
func CL(ctx context.Context, opts ...zap.Option) *zap.Logger {
value := ctx.Value(loggerKeyVal)
if value == nil {
panic("Trying to log from an ... |
package client
//#cgo linux CFLAGS: -I/usr/local/include
//#cgo darwin CFLAGS: -I/usr/local/include
//#cgo windows CFLAGS: -IE:/src/tdlib -IE:/src/tdlib/build
//#cgo linux LDFLAGS: -L/usr/local/lib -ltdjson_static -ltdjson_private -ltdclient -ltdcore -ltdapi -ltdactor -ltddb -ltdsqlite -ltdnet -ltdutils -lstdc++ -lssl... |
// Copyright 2018 The QOS Authors
package buyad
import (
"encoding/json"
"errors"
"fmt"
"github.com/QOSGroup/qbase/txs"
qbasetypes "github.com/QOSGroup/qbase/types"
qostxs "github.com/QOSGroup/qos/txs"
"github.com/QOSGroup/qstars/client/utils"
"github.com/QOSGroup/qstars/config"
"github.com/QOSGroup/qstars/t... |
// Package store defines the byte store and implements the file byte store.
package store
import (
"bufio"
"encoding/binary"
"fmt"
"os"
"sync"
)
// Store is an interface for the byte store.
type Store interface {
// Append persists the given bytes to the store. Returns the number of
// written bytes, the posit... |
package tc
import (
"build-monitor-v2/server/db"
"sort"
"time"
"github.com/pstuart2/go-teamcity"
)
// GetRunningBuilds Gets the running builds
var GetRunningBuilds = func(c *Server, lastBuilds []teamcity.Build) []teamcity.Build {
runningBuilds, err := c.Tc.GetRunningBuilds()
if err != nil {
c.Log.Errorf("Fai... |
package main
// SPDX-License-Identifier: WTFPL
import (
"flag"
"fmt"
"log"
"os"
"os/signal"
"strings"
"syscall"
"time"
"github.com/miekg/dns"
)
const (
SOA = `wd.ip.wtf SOA wd-ns.ip.wtf dns-admin.oo.fail 42 42 42 42 42`
NS = `wd.ip.wtf NS wd-ns.ip.wtf`
TXT = ` TXT ""`
)
var (
flagListen = flag.String(... |
package elastic
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"strings"
"github.com/FoxComm/highlander/middlewarehouse/lib/gohttp"
)
const (
esIndex = "%s/%s"
esMapping = "%s/%s/_mapping/%s"
esGetIndices = "%s/_cat/indices?h=index"
)
// Client is our interface the FoxCommerce conve... |
/*
Copyright (c) 2018 <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, distribute, sublicen... |
package main
import (
"bufio"
"encoding/binary"
"fmt"
"io"
"io/ioutil"
"log"
"os"
commcid "github.com/filecoin-project/go-fil-commcid"
commp "github.com/filecoin-project/go-fil-commp-hashhash"
"github.com/ipfs/go-cid"
cbor "github.com/ipfs/go-ipld-cbor"
"github.com/mattn/go-isatty"
"github.com/pborman/op... |
//
// 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
// Package configfile provides the configfile.SourceInfo struct
// that gives the config file properties: path, format and source.
package configfile
import (
"fmt"
"os"
"path/filepath"
"runtime"
"strings"
)
type enumConfigSource int
// Configuration file source enum.
// Note that command-line or environment so... |
package statedb
import (
"encoding/json"
"fmt"
"github.com/incognitochain/incognito-chain/common"
"math/big"
"reflect"
)
const (
OTA_STATUS_OCCUPIED = iota
OTA_STATUS_STORED
)
type OnetimeAddressState struct {
tokenID common.Hash
publicKey []byte
index *big.Int
status int
}
func (s Onetime... |
package model
import (
"errors"
)
type Order struct {
ID int64 `json:"id,omitempty"`
Guid string `json:"Guid,omitempty" xorm:"varchar(100) index"`
BillNumber string `json:"BillNumber,omitempty" xorm:"varchar(100) index"` //是 订单号
Status ... |
package protocol
import (
"context"
"fmt"
pb "github.com/yindaheng98/gogisnet/grpc/protocol/protobuf"
"github.com/yindaheng98/gogisnet/grpc/protocol/registrant"
"github.com/yindaheng98/gogisnet/grpc/protocol/registry"
"github.com/yindaheng98/gogistry/protocol"
"google.golang.org/grpc"
"net"
"sync"
"testing"
... |
package net
import (
"context"
"errors"
"net"
"time"
)
// A TCPServer represents a server object using tcp network.
type TCPServer struct {
address string
cctx context.Context
cancelFunc context.CancelFunc
doneCh <-chan struct{}
listener net.Listener // for Server
err error //
pl... |
package metadata
type MetadataRequestType string
const (
BulkType MetadataRequestType = "bulk"
PgAddSource MetadataRequestType = "pg_add_source"
PgDropSource MetadataRequestType = "pg_drop_source"
PgTrackTable MetadataRequestType = "pg_t... |
/*
Copyright 2019 The KubeOne 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, sof... |
package prometheus
import (
"context"
"fmt"
"net/http"
"time"
"github.com/prometheus/client_golang/api"
v1 "github.com/prometheus/client_golang/api/prometheus/v1"
"github.com/prometheus/common/model"
"github.com/kiali/k-charted/config/extconfig"
"github.com/kiali/k-charted/httputil"
)
type ClientInterface ... |
package main
import (
"bytes"
"encoding/binary"
"net"
"strings"
"strconv"
"time"
"gopkg.in/mgo.v2"
"fmt"
)
var roomid string
type Packet struct {
length int32
hLength int32
hType int16
hEncrypt byte
hReserved byte
data string
}
func ... |
package syncer
import (
"context"
"database/sql"
"errors"
"fmt"
"io/ioutil"
"os"
"strings"
"unicode/utf8"
"github.com/jackc/pgx/v4"
"github.com/jmoiron/sqlx"
libgit2 "github.com/libgit2/git2go/v33"
"github.com/mergestat/fuse/internal/db"
uuid "github.com/satori/go.uuid"
)
func (w *worker) sendBatchFiles... |
// Package serviceutil provides service helper functions
package serviceutil
import (
"context"
"database/sql"
"fmt"
"net"
"net/http"
"sync"
"github.com/apex/log"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometh... |
// +build e2e
/*
Copyright 2018 Knative Authors 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... |
// Copyright © 2018 by PACE Telematics GmbH. All rights reserved.
// Created at 2018/09/03 by <NAME>
// Package oauth2 provides a middelware that introspects the auth token on
// behalf of PACE services and populate the request context with useful information
// when the token is valid, otherwise aborts the request.
p... |
// Copyright (c) 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/licenses/L... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: test/test_weak.proto
package test
import (
proto "github.com/golang/protobuf/proto"
protoapi "github.com/golang/protobuf/protoapi"
protoreflect "github.com/golang/protobuf/v2/reflect/protoreflect"
protoimpl "github.com/golang/protobuf/v2/runtime/protoimp... |
// Copyright 2018 The Cockroach 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 plan
import (
"errors"
"fmt"
neturl "net/url"
"os"
"path/filepath"
"strings"
"github.com/hashicorp/go-getter"
)
// DownloadUpgrade downloads the given url into the provided directory and ensures it's valid.
// The provided url must contain a checksum parameter that matches the file being downloaded.
/... |
package types
import "fmt"
import (
"github.com/Netflix/titus-executor/config"
"os/exec"
"github.com/Netflix/titus-executor/api/netflix/titus"
"github.com/Netflix/titus-executor/executor/metatron"
vpcTypes "github.com/Netflix/titus-executor/vpc/types"
"context"
"path/filepath"
// The purpose of this is to... |
// Copyright 2020 VMware, 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 2018 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 applicable law or agree... |
package client
import (
"bytes"
"context"
"encoding/json"
"io"
"io/ioutil"
"net"
nethttp "net/http"
"net/url"
"strings"
"time"
"unicode/utf8"
"github.com/keys-pub/keys"
"github.com/keys-pub/keys/http"
"github.com/keys-pub/keys/tsutil"
"github.com/pkg/errors"
)
// Client ...
type Client struct {
url ... |
package main
import (
"bufio"
"flag"
"fmt"
"log"
"os"
"os/signal"
"syscall"
"time"
)
const (
seqNameStart string = "start"
seqNamePrecount string = "precount"
partNameStop string = "_stop_"
stopMessage string = "Press 'Enter' to continue..."
unknownPartWait time.Dura... |
package rig
import (
"testing"
"github.com/Pimmr/rig/validators"
"github.com/pkg/errors"
)
func TestFloat64Value(t *testing.T) {
for _, test := range []struct {
value float64
expectedString string
input string
expectedSet float64
expectedError bool
}{
{
value: 4.2,
... |
//
// (C) Copyright 2020 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 by applicable law or ... |
// Copyright 2017 The Bazel 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 appl... |
package main
import (
"fmt"
"github.com/coreos/bbolt"
)
const (
dbFilePermission = 0600
defaultTxMaxSize = 65536
)
type compactDBCommand struct {
TxMaxSize int64 `long:"txmaxsize" description:"Maximum transaction size. (default 65536)"`
SourceDB string `long:"sourcedb" description:"The lnd channel.db file t... |
package bundler
import (
"errors"
"fmt"
"io"
"os"
"path/filepath"
"github.com/spf13/afero"
)
const fileMode = os.FileMode(0o755)
// Bundler helps create Archivematica transfers in the filesystem.
//
// It is a simpler alternative to amclient.TransferSession that does not concern
// with the submission of the ... |
/*
Copyright 2020 Clastix Labs.
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
d... |
package sigma
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"os/user"
"path/filepath"
"strings"
"gopkg.in/yaml.v2"
)
/*
This package will be the main entrypoint when imported from other projects.
*/
type Config struct {
Directories []string
}
func (c *Config) Validate() error {
var err error
if c.Directories... |
// Copyright The Linux Foundation and each contributor to CommunityBridge.
// SPDX-License-Identifier: MIT
package dynamo_events
import (
"context"
"fmt"
"strconv"
"github.com/aws/aws-lambda-go/events"
gitlab_api "github.com/communitybridge/easycla/cla-backend-go/gitlab_api"
log "github.com/communitybridge/eas... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.