text stringlengths 3.08k 10.4k |
|---|
package p2p
import (
"fmt"
"io"
"log"
"net"
"time"
"math"
"runtime"
"bufio"
"github.com/snakewarhead/eos-go"
"github.com/snakewarhead/eos-go/ecc"
)
type Peer struct {
Address string
chainID eos.SHA256Bytes
agent string
connection net.Conn
r... |
package sso
import (
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"reflect"
)
var (
// TranquilityOAuth root address.
TranquilityOAuth = "https://login.eveonline.com"
// SingularityOAuth root address.
SingularityOAuth = "https://sisilogin.testeveonline.com"
// ErrClientID is ret... |
package json
type Reader struct {
Lexer Lexer
Type uint16
First string
OutOfOrder bool
IsCompact bool
NoFields bool
}
func OpenReader(b []byte) (Reader, error) {
r := Reader{
Lexer: Lexer{
Data: b,
},
Type: 0,
}
in := &r.Lexer
isTopLevel := in.IsStart()
if in.IsNull() {
if is... |
// Copyright 2021 The Okteto 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 ... |
// Copyright 2014 beego Author. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applica... |
/*
Copyright AppsCode Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distri... |
// Copyright (c) 2017 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 nltest provides utilities for netlink testing.
package nltest
import (
"fmt"
"io"
"github.com/mdlayher/netlink"
"github.com/mdlayher/netlink/nlenc"
)
// PID is the netlink header PID value assigned by nltest.
const PID = 1
// MustMarshalAttributes marshals a slice of netlink.Attributes to their binar... |
package main
import (
"flag"
"fmt"
"log"
"os"
"path/filepath"
"runtime"
"time"
"koding/kites/config"
"koding/klient/app"
konfig "koding/klient/config"
"koding/klient/registration"
)
// TODO(rjeczalik): replace with multiconfig
var (
flagIP = flag.String("ip", "", "Change public ip")
flagPort ... |
package helper
import (
"fmt"
"reflect"
"regexp"
"time"
"github.com/elsevier-core-engineering/replicator/logging"
"github.com/elsevier-core-engineering/replicator/replicator/structs"
"github.com/mitchellh/hashstructure"
)
// FindIP will return the IP address from a string. This is used to deal with
// respons... |
package gift
import (
"image"
"image/draw"
)
type rankMode int
const (
rankMedian rankMode = iota
rankMin
rankMax
)
type rankFilter struct {
ksize int
disk bool
mode rankMode
}
func (p *rankFilter) Bounds(srcBounds image.Rectangle) (dstBounds image.Rectangle) {
dstBounds = image.Rect(0, 0, srcBounds.Dx(... |
package bmsteams
import (
"context"
"fmt"
"os"
"regexp"
"strings"
"time"
"github.com/42wim/matterbridge/bridge"
"github.com/42wim/matterbridge/bridge/config"
// "github.com/davecgh/go-spew/spew"
msgraph "github.com/matterbridge/msgraph.go/beta"
"github.com/matterbridge/msgraph.go/msauth"
"github.com/matt... |
package objects
import (
"fmt"
"github.com/esurdam/go-sophos"
)
// Right is a generated struct representing the Sophos Right Endpoint
// GET /api/nodes/right
type Right struct {
RightGroup RightGroup `json:"right_group"`
RightRight RightRight `json:"right_right"`
}
var _ sophos.Endpoint = &Right{}
var defsRigh... |
package command
import (
"flag"
"fmt"
"strings"
"github.com/mitchellh/cli"
"github.com/ryanuber/columnize"
)
type KeysCommand struct {
Ui cli.Ui
}
var _ cli.Command = &KeysCommand{}
func (c *KeysCommand) Help() string {
helpText := `
Usage: serf keys [options]...
Manage the internal encryption keyring us... |
/*
SPDX-License-Identifier: Apache-2.0
Copyright Contributors to the Submariner project.
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 requ... |
package fastbloom
import (
"unsafe"
"github.com/zeebo/xxh3"
)
type FastBloom struct {
slotData []uint64
slotCount int
probePerEntry int
seed0 [8]byte
seed1 [8]byte
}
const (
SlotByteCount = 64 //Intel CPUs have 64-byte cache lines
SlotBitCount = SlotByteCount * 8
SlotWordCount = ... |
package v1alpha1
import (
"fmt"
"github.com/metaprov/modelaapi/pkg/apis/data/v1alpha1"
"github.com/metaprov/modelaapi/pkg/apis/inference"
"github.com/metaprov/modelaapi/pkg/util"
"gopkg.in/yaml.v2"
v1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/met... |
package zconfig
import (
"errors"
"reflect"
"strings"
"testing"
"time"
)
type Service struct {
Workers int `key:"workers"`
Dependency SimpleDependency `key:"dependency" inject-as:"dependency"`
Injected SimpleDependency `inject:"dependency"`
Recursive *RecursiveDependency
n... |
package main
import (
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"os"
"time"
"github.com/gorilla/websocket"
"golang.org/x/crypto/ssh"
)
const (
// Time allowed to write or read a message.
messageWait = 10 * time.Second
// Maximum message size allowed from peer.
maxMessageSize = 512
)
var terminalMode... |
package recipes
import (
"bytes"
"context"
"io"
"io/ioutil"
"net/http"
"net/url"
"os"
"reflect"
"strings"
"testing"
"gopkg.in/yaml.v2"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/newrelic/newrelic-cli/internal/install/types"
)
var (
testRecipeFileString = `... |
// Copyright 2019 Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in complian... |
// Copyright 2021 iLogtail 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 (c) 2017 <NAME>
//
// MIT License
//
// 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, merg... |
package keylogger
import (
"bytes"
"encoding/binary"
"fmt"
"io/ioutil"
"os"
"strings"
"syscall"
)
// KeyLogger wrapper around file descriptior
type KeyLogger struct {
fd *os.File
}
type devices []string
type Keyboard struct {
Device string
Path string
}
func (d *devices) hasDevice(str string) bool {
f... |
// Copyright 2021 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 impersonate
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"strings"
"time"
"golang.org/x/oauth2"
)... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.24.0-devel
// protoc v3.13.0
// source: memtable.proto
package pb
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime... |
// Copyright (c) 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the Lice... |
package hh
import (
"encoding/binary"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"strconv"
"sync"
"time"
"github.com/influxdb/influxdb/models"
"github.com/influxdb/influxdb/tsdb"
)
type Processor struct {
mu sync.RWMutex
dir string
maxSize int64
maxAge time.Duration
retry... |
package models
import (
"encoding/json"
"io"
"log"
"os"
"time"
"go.etcd.io/bbolt"
"github.com/gobuffalo/envy"
"github.com/gobuffalo/pop/v5"
"github.com/gofrs/uuid"
)
const nullUUID = "00000000-0000-0000-0000-000000000000"
// DB is a connection to your database to be used
// throughout your application.
va... |
// Copyright (c) 2020 Blockwatch Data Inc.
// Author: <EMAIL>
package cmd
import (
"encoding/json"
"fmt"
"os"
"runtime"
"runtime/debug"
"runtime/pprof"
"github.com/spf13/cobra"
"github.com/echa/config"
logpkg "github.com/echa/log"
)
var rootCmd = &cobra.Command{
Use: APP_NAME + " [OPTIONS] [COMMANDS]",
... |
/*Package configurationFile represents Encodable/Decodable Golang structures from/to TOML structures.
*
*The global structure is ConfigurationFile, which is the simple way to store accurtely your local informations.
*
*/
package configurationFile
import (
"bytes"
"io/ioutil"
"os"
"os/user"
"path/filepath"
... |
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you... |
// This file contains functions for transpiling function calls (invocations).
package transpiler
import (
"errors"
"fmt"
"strings"
"github.com/elliotchance/c2go/ast"
"github.com/elliotchance/c2go/program"
"github.com/elliotchance/c2go/types"
"github.com/elliotchance/c2go/util"
goast "go/ast"
"go/token"
)
... |
package api
import (
"errors"
"fmt"
"os"
"strings"
"encoding/base64"
"encoding/json"
"io/ioutil"
"net/http"
"net/url"
"github.com/dgrijalva/jwt-go"
"github.com/emicklei/go-restful"
"github.com/AcalephStorage/kontinuous/pipeline"
"github.com/AcalephStorage/kontinuous/store/kv"
)
type GithubAuthResponse... |
// 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-2021 Dolthub, 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... |
package cachetable
import (
"errors"
"math/bits"
)
const MaxUint uint = 1<<bits.UintSize - 1
// Node which is stored at each level
type Node struct {
key string
Value interface{}
create_time uint
}
// CacheTable implemented with a fixed bucketcapacity.
// removes oldest element in bucket once buc... |
package gh
import (
"context"
"fmt"
"net/url"
"path"
"github.com/cockroachdb/pebble"
"github.com/google/go-github/v33/github"
"go.uber.org/multierr"
"go.uber.org/zap"
"golang.org/x/xerrors"
"github.com/gotd/td/telegram/message"
"github.com/gotd/td/telegram/message/markup"
"github.com/gotd/td/telegram/mes... |
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2018 Datadog, Inc.
package aggregator
import (
"sort"
"testing"
"github.com/DataDog/datadog-age... |
package wavefront
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"reflect"
"strconv"
"time"
)
// Query represents a query to be made against the Charts API
type Query struct {
// client is the Wavefront client used to execute queries
client Wavefronter
// Params is the set of parameters that will be us... |
// Copyright (c) 2019 Cisco and/or its affiliates.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicabl... |
/*
* ECAL
*
* Copyright 2020 <NAME>. All rights reserved.
*
* This Source Code Form is subject to the terms of the MIT
* License, If a copy of the MIT License was not distributed with this
* file, You can obtain one at https://opensource.org/licenses/MIT.
*/
package engine
import (
"bytes"
"fmt"
"math/rand... |
package transformers
import (
"encoding/hex"
"encoding/json"
"strings"
"github.com/golang/protobuf/proto"
"go.uber.org/zap"
"github.com/geometry-labs/icon-addresses/config"
"github.com/geometry-labs/icon-addresses/crud"
"github.com/geometry-labs/icon-addresses/kafka"
"github.com/geometry-labs/icon-addresses... |
// *** 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 folder
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Allows management of Organization policies for a G... |
// 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 ble
import (
"bytes"
"errors"
"fmt"
"v.io/v23/discovery"
idiscovery "v.io/x/ref/lib/discovery"
)
const (
// We pack an advertisement exc... |
// Copyright (c) 2016, 2018, 2021, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei... |
// Copyright 2012 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
// This program generates fixedhuff.go
// Invoke as
//
// go run gen.go -output fixedhuff.go
package main
import (
"bytes"
"flag"
"fmt"
... |
// Code generated by gotdgen, DO NOT EDIT.
package tg
import (
"context"
"errors"
"fmt"
"sort"
"strings"
"go.uber.org/multierr"
"github.com/gotd/td/bin"
"github.com/gotd/td/tdp"
"github.com/gotd/td/tgerr"
)
// No-op definition for keeping imports.
var (
_ = bin.Buffer{}
_ = context.Background()
_ = fmt... |
package clusternative
import (
"fmt"
"io"
"sync"
"time"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/bytesutil"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/consts"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/encoding"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/fasttime"
"github.com/VictoriaMe... |
package cmd
import (
"github.com/spf13/cobra"
"github.com/cov-ert/gofasta/pkg/updown"
)
var TRquery string
var TRtarget string
var TRignore string
var TRoutfile string
var TRsizetotal int
var TRsizeup int
var TRsizedown int
var TRsizeside int
var TRsizesame int
var TRnofill bool
var TRdistall int
var TRdistup i... |
package appinsights
import (
"bytes"
"compress/gzip"
"encoding/json"
"io/ioutil"
"net/http"
"sort"
"time"
)
type transmitter interface {
Transmit(payload []byte, items TelemetryBufferItems) (*transmissionResult, error)
}
type httpTransmitter struct {
endpoint string
}
type transmissionResult struct {
stat... |
// Copyright 2019 <NAME>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writi... |
package paw
import (
"bufio"
"bytes"
"compress/gzip"
"crypto/md5"
"fmt"
"io"
"log"
"os"
"os/exec"
"strings"
)
// LineCount counts the number of '\n' for reader `r`
func LineCount(r io.Reader) (int, error) {
buf := make([]byte, 32*1024)
count := 0
lineSep := []byte{'\n'}
for {
c, err := r.Read(buf)
c... |
package ante_test
import (
"encoding/json"
"strings"
"testing"
"github.com/stretchr/testify/require"
"github.com/tendermint/tendermint/crypto"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/auth/ante"
"github.com/cosmos/cosmos-sdk/x/auth/types"
)
func TestValidateBasic(t *testing.T... |
/*
Copyright 2021 The AtomCI Group 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, s... |
package virtualbox
import (
"io/ioutil"
"os"
"time"
"github.com/Sirupsen/logrus"
"github.com/emc-advanced-dev/pkg/errors"
"github.com/solo-io/unik/pkg/compilers/rump"
"github.com/solo-io/unik/pkg/config"
unikos "github.com/solo-io/unik/pkg/os"
"github.com/solo-io/unik/pkg/providers/common"
"github.com/solo-... |
/*
Copyright (C) 2018 Synopsys, Inc.
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"... |
//
// Package aessrp implements encrypted authentication and encrypted REST.
// SRP-6a for login authenticaiton, followed by AES 256 bit encrypted RESTful calls.
//
// Copyright (C) <NAME>, 2013-2016
//
// Do not remove the following lines - used in auto-update.
// Version: 0.5.9
// BuildNo: 1811
// FileId: 0001
//
pa... |
// Copyright Ngo 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 writi... |
package main
import (
"fmt"
"math/rand"
"time"
"github.com/golang/protobuf/proto"
"golang.org/x/net/context"
pbd "github.com/brotherlogic/discovery/proto"
pb "github.com/brotherlogic/gobuildmaster/proto"
pbs "github.com/brotherlogic/gobuildslave/proto"
)
type getter interface {
getSlaves() (*pbd.ServiceLis... |
package main
import (
"flag"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"regexp"
"strings"
"sync"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
utilerrors "k8s.io/apimachinery/pkg/util/errors"
prowconfig "k8s.io/test-infra/prow/config"
"sigs.k8s.io/yaml"
)
type options struct {
prowJobConfigDir stri... |
package issue
import (
flags "github.com/jessevdk/go-flags"
"github.com/lighttiger2505/lab/commands/internal"
"github.com/lighttiger2505/lab/internal/config"
)
type Option struct {
ProjectProfileOption *internal.ProjectProfileOption `group:"Project, Profile Options"`
CreateUpdateOption *CreateUpdateOption ... |
/*
* Copyright (c) 2021. -present, <NAME>, Inc. All rights reserved.
*
* This source code is licensed under the MIT license
* found in the LICENSE file in the root directory of this source tree.
*/
package nlptools
import (
"crypto/md5"
"encoding/hex"
"github.com/broosaction/gotext/tokenizers"
stringUtils... |
// package genshindaily contains a Pub/Sub Cloud Function.
package genshindaily
import (
"context"
"io/ioutil"
"net/http"
"testing"
"github.com/go-resty/resty/v2"
"github.com/google/go-cmp/cmp"
"github.com/jarcoal/httpmock"
"gotest.tools/assert"
"github.com/kyoukaya/genshindaily/internal/genshindaily/models... |
// Copyright 2015 <NAME>. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
// +build gofuzz
package gofuzzdep
/*
#cgo CFLAGS: -std=c99
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
typedef int memcmp_cb_t(void*, const void*, const ... |
/*
* Copyright 2019 <NAME>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agr... |
/*
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 un... |
package main
import (
"fmt"
"github.com/bwmarrin/discordgo"
"github.com/bwmarrin/lit"
"math/rand"
"net/url"
"os"
"path/filepath"
"strings"
"sync"
"time"
)
// Finds user current voice channel
func findUserVoiceState(session *discordgo.Session, i *discordgo.Interaction) *discordgo.VoiceState {
for _, guild :... |
package main
import (
"fmt"
"io/ioutil"
"net/http"
"os"
"sync"
"github.com/kotaroooo0/snowforecast-twitter-bot/domain"
)
func main() {
// elasticsearchのデータ初期化用のテキストファイル
file, err := os.Create("snow_resorts.json")
if err != nil {
panic(err)
}
defer file.Close()
// スキー場の地域一覧
regions := []string{
"exo... |
/*
* Copyright 2019 the original author or 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 applic... |
package blockchain
import (
"context"
"crypto/tls"
"encoding/json"
"fmt"
"net/url"
"sync"
"time"
"github.com/smartcontractkit/chainlink/core/logger"
"github.com/smartcontractkit/chainlink/core/store/models"
"github.com/smartcontractkit/external-initiator/store"
"github.com/smartcontractkit/external-initiat... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package devicefarm
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type ListTestGridSessionActionsInput struct {
_ struct{} `type:"structure"`
// The maximum number of sessions to retur... |
/*
In this file we handle 'git archive' downloads
*/
package git
import (
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"path"
"path/filepath"
"regexp"
"time"
"github.com/golang/protobuf/proto" //lint:ignore SA1019 https://gitlab.com/gitlab-org/gitlab-workhorse/-/issues/274
"github.com/prometheus/client_golang/... |
package ws
import (
"crypto/md5"
"errors"
"fmt"
"net/http"
"strconv"
"sync"
"time"
"github.com/gorilla/websocket"
"github.com/kuangcp/logger"
)
// 客户端读写消息
type websocketMsg struct {
// websocket.TextMessage 消息类型
messageType int
data []byte
}
// 客户端连接
type ServerSession struct {
wsSocket *websock... |
package main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"net/http"
"github.com/davecgh/go-spew/spew"
"gopkg.in/macaron.v1"
log "unknwon.dev/clog/v2"
)
var Version = "dev"
func main() {
configPath := flag.String("config", "./app.ini", "The config file path")
flag.Parse()
if err := log.NewConsole(); er... |
package main
import(
"encoding/json"
"encoding/csv"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"strconv"
"strings"
"golang.org/x/net/context"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
"google.golang.org/api/sheets/v4"
)
var spreadsheetId = ""
var csvFile = ""
var categoryMap = map[str... |
package nrepl
import (
"fmt"
"path/filepath"
"strings"
"sync"
"github.com/athos/trenchman/bencode"
"github.com/athos/trenchman/client"
"github.com/google/uuid"
)
type (
Client struct {
conn *Conn
sessionInfo *SessionInfo
outputHandler client.OutputHandler
errHandler client.ErrorHand... |
package openapi
import (
"encoding/json"
"fmt"
)
// AddOrderSubInfoRequest 请求结构体
type AddOrderSubInfoRequest struct {
AccessToken string // 接口调用凭证
OpenID string // 用户 openId
SceneID string // 百度收银台分配的平台订单 ID,通知支付状态接口返回的 orderI... |
package client
import (
"bytes"
"io"
"time"
"github.com/Cloud-Foundations/Dominator/lib/hash"
"github.com/Cloud-Foundations/Dominator/lib/log"
"github.com/Cloud-Foundations/Dominator/lib/objectserver"
"github.com/Cloud-Foundations/Dominator/lib/srpc"
proto "github.com/Cloud-Foundations/Dominator/proto/filegen... |
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
// Copyright 2018 The Nakama 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 ... |
package tokenizer
import (
"fmt"
"path"
"runtime"
)
//go:generate stringer -type=ItemType
type ItemType int
const (
itemError ItemType = iota
T_EOF
T_ABSTRACT // "abstract"
T_AND_EQUAL // "&="
T_ARRAY // array(...
T_ARRAY_CAST // "(array)"
T_A... |
// Copyright (C) 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 t... |
package maze
import (
"bytes"
"math/rand"
"time"
)
// Grid is an interface of grid.
type Grid interface {
Rows() int
Cols() int
Get(int, int) *Cell
Random() *Cell
Size() int
EachRow() [][]*Cell
EachCell() []*Cell
String() string
DeadEnds() []*Cell
Braid(float64)
}
// NormalGrid is a grid containing all ... |
package ini
import (
"bufio"
"bytes"
"errors"
"fmt"
"io"
"os"
"regexp"
"strings"
)
const newline = 10
var MissingEqualSignError = errors.New("missing equal sign")
var TooManyEqualSignsError = errors.New("too many equal signs")
var assignmentPattern = regexp.MustCompile("[^\\\\]=")
type lineReader struct {
... |
/*
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
package configula
import (
"bytes"
"reflect"
"testing"
yaml "gopkg.in/yaml.v3"
)
func TestRecursiveGenerate(t *testing.T) {
tests := []struct {
node *yaml.Node
expected string
}{
{&yaml.Node{Tag: "!!int", Value: "1"}, "YamlNode(1)"},
{&yaml.Node{Tag: "!!str", Value: "foobar"}, "YamlNode('foobar')"}... |
// +build linux
package cluster
import (
"fmt"
"strings"
"github.com/coreos/go-iptables/iptables"
"github.com/openvswitch/ovn-kubernetes/go-controller/pkg/util"
)
const (
localnetGatewayIP = "169.254.33.2/24"
localnetGatewayNextHop = "169.254.33.1"
localnetGatewayNextHopSubnet = "169.254.33.... |
// Copyright 2021 FerretDB 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... |
package connect
import (
"fmt"
"github.com/alibaba/kt-connect/pkg/common"
"github.com/alibaba/kt-connect/pkg/kt/exec"
"math/rand"
"strconv"
"strings"
"sync"
"github.com/alibaba/kt-connect/pkg/kt/exec/sshchannel"
"github.com/alibaba/kt-connect/pkg/kt/util"
"github.com/rs/zerolog/log"
)
// Inbound mapping lo... |
/*
Copyright (c) 2015, <NAME> (<EMAIL>)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice, this
list of conditions and the followi... |
package main
import "C"
import (
"bytes"
"crypto/tls"
"io"
"io/ioutil"
"log"
"net/http"
"os"
"strconv"
"time"
"golang.org/x/net/http2"
"github.com/lucas-clemente/quic-go"
"github.com/lucas-clemente/quic-go/h2quic"
"github.com/lucas-clemente/quic-go/logger"
)
func main() {}
const (
// Prefix for PROX... |
package revision
import (
"bytes"
"crypto/sha256"
"database/sql"
"errors"
"io/ioutil"
"os"
"path/filepath"
"regexp"
"strconv"
"strings"
"time"
"github.com/andrewpillar/mgrt/config"
)
var (
upFile = "up.sql"
downFile = "down.sql"
reslug = regexp.MustCompile("[^a-zA-Z0-9]")
redup = regexp.MustCompi... |
/**
* Copyright 2017 <NAME>, Inc.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
* Unless required by applicable law or agreed to in writi... |
// *** 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 eventgrid
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information abo... |
// _ _
// __ _____ __ ___ ___ __ _| |_ ___
// \ \ /\ / / _ \/ _` \ \ / / |/ _` | __/ _ \
// \ V V / __/ (_| |\ V /| | (_| | || __/
// \_/\_/ \___|\__,_| \_/ |_|\__,_|\__\___|
//
// Copyright © 2016 - 2022 SeMI Technologies B.V. All rights reserved.
//
// CONTACT: <EMAIL>... |
package article
import (
"context"
"fmt"
"strconv"
"sync"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/dynamodb"
"github.com/pkg/errors"
)
const (
articleSortKey = "Article"
fieldSlug = "Slug"
fieldSortKey = "SortKey"
fieldTitle = "Title"
fieldContent ... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: check_token.proto
package identityd2
import (
fmt "fmt"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.M... |
// Copyright © 2018 <NAME> <<EMAIL>>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
package lib
import (
"errors"
"path"
"sort"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/se... |
package main
import (
"flag"
"math/rand"
. "paxi"
"paxi/glog"
"sync"
"time"
)
var sid = flag.Int("sid", 0, "Site ID.")
var nid = flag.Int("nid", 0, "Node ID.")
var T = flag.Int("T", 1, "Number of threads (simulated clients).")
var addr = flag.String("master", "127.0.0.1", "Master address.")
var t = flag.Int("t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.