text stringlengths 3.08k 10.4k |
|---|
// Copyright 2020 Soluble 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... |
package proposals
import (
"context"
"errors"
"fmt"
"github.com/spacemeshos/go-spacemesh/common/types"
"github.com/spacemeshos/go-spacemesh/log"
"github.com/spacemeshos/go-spacemesh/signing"
"github.com/spacemeshos/go-spacemesh/system"
)
var (
errTargetEpochMismatch = errors.New("ATX target epoch and ballot ... |
package main
import (
"fmt"
//"log"
"math"
"tencent.com/mmkv"
)
func main() {
// init MMKV with root dir
mmkv.InitializeMMKV("/tmp/mmkv")
// you can set log redirecting
mmkv.RegisterLogHandler(logHandler)
// you can set error handler
mmkv.RegisterErrorHandler(errorHandler)
// you can get notify content c... |
package cmd
import (
"fmt"
"strconv"
"time"
"github.com/spf13/cobra"
"github.com/adios/onsengo/onsen"
pp "github.com/adios/pprint"
)
var ls = struct {
recursive bool
cmd *cobra.Command
// map for translating boolean to ls letters
lut letters
}{
cmd: &cobra.Command{
Use: "ls [radio_name...]",
Shor... |
package server
import (
"context"
"fmt"
"math/rand"
"strings"
"sync"
"github.com/golang/protobuf/proto"
"github.com/jhump/protoreflect/dynamic"
"github.com/jhump/protoreflect/grpcreflect"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.... |
// 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 wri... |
package mock
import (
"context"
stream "github.com/GetStream/stream-chat-go/v5"
"github.com/google/uuid"
"github.com/savannahghi/enumutils"
"github.com/savannahghi/mycarehub/pkg/mycarehub/application/dto"
"github.com/savannahghi/mycarehub/pkg/mycarehub/application/enums"
"github.com/savannahghi/mycarehub/pkg/m... |
/*
Copyright (c) 2022, Oracle and/or its affiliates. All rights reserved.
Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
*/
package pod
import (
"context"
"fmt"
"k8s.io/apimachinery/pkg/labels"
corev1 "k8s.io/api/core/v1"
policyv1beta1 "k8s.io/api/poli... |
package lib
import (
"fmt"
"log"
"net/url"
"strconv"
"strings"
"sync"
"time"
"github.com/Akenaide/biri"
"github.com/PuerkitoBio/goquery"
)
const maxLength = 15
const yuyuteiURL = "https://yuyu-tei.jp"
const yuyuteiBase = "https://yuyu-tei.jp/game_ws"
const yuyuteiPart = "https://yuyu-tei.jp/game_ws/sell/sel... |
package main
import (
"encoding/base64"
"errors"
"github.com/RH12503/Triangula-GUI/util"
"github.com/RH12503/Triangula/algorithm"
image2 "github.com/RH12503/Triangula/image"
"github.com/wailsapp/wails"
"image"
"io/ioutil"
"log"
"os"
"runtime"
"strings"
"sync"
"time"
)
const (
triangulated = iota
polyg... |
package cmd
import (
"io/ioutil"
"log"
"net/http"
"os"
"path/filepath"
"strings"
"sync"
"time"
"github.com/vbauerster/mpb/v4"
"github.com/vbauerster/mpb/v4/decor"
minio "github.com/minio/minio-go"
"github.com/spf13/cobra"
)
const (
parallelSosUpload = 10
)
type fileToUpload struct {
localPath strin... |
/*
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 main
import (
"fmt"
"go/ast"
"go/parser"
"go/token"
"io"
"io/ioutil"
"os"
"path"
"path/filepath"
"sort"
"strings"
"gopkg.in/yaml.v2"
"github.com/dertseha/goconsider"
)
type arguments struct {
help bool
noReferences bool
filenames []string
settings string
}
type issuesFoundEr... |
package main
import (
"fmt"
"os"
"runtime/debug"
"strconv"
"time"
"net/http"
_ "net/http/pprof"
"github.com/jessevdk/go-flags"
"github.com/moncho/dry/app"
"github.com/moncho/dry/appui"
"github.com/moncho/dry/docker"
"github.com/moncho/dry/ui"
"github.com/moncho/dry/version"
"github.com/pkg/errors"
log... |
/*
* Copyright 2017 Workiva
* 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 protocol
import (
"errors"
"fmt"
"github.com/gorilla/websocket"
"github.com/rs/xid"
"io"
"net"
"sync"
"sync/atomic"
"time"
"weisuo/logger"
)
type TCPConn interface {
Read([]byte) (int, error)
Write([]byte) (int, error)
CloseWrite() error
Close() error
LocalAddr() net.Addr
RemoteAddr() net.Addr... |
package vdlog
import (
"encoding/json"
"fmt"
"os"
"runtime"
"time"
"github.com/satori/go.uuid"
)
//EventLevel is a type describing event's level
type EventLevel uint8
const (
//LevelError is a level for errors that can wake you on 4 hours past midnight
LevelError = EventLevel(iota)
//LevelWarn is a level ... |
package main
import (
"errors"
"fmt"
"strconv"
"strings"
"github.com/hyperledger/fabric/core/chaincode/shim"
"github.com/hyperledger/fabric/core/util"
)
var serviceCharge = 5
var logger = shim.NewLogger("ftLogger")
// SimpleChaincode example simple Chaincode implementation
type SimpleChaincode struct {
}
/... |
/*
Copyright (c) 2021 - Present. Blend Labs, Inc. All rights reserved
Use of this source code is governed by a MIT license that can be found in the LICENSE file.
*/
package ansi
import (
"fmt"
"io"
"reflect"
"strings"
"unicode/utf8"
"github.com/blend/go-sdk/ex"
)
// Table character constants.
const (
Table... |
// Copyright 2019 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.
// tryhard is a very basic tool to list and rewrite `try` candidate statements.
// It operates on a file-by-file basis and does not type-check the code;
// pote... |
/**
* @author <NAME>
*
* Copyright (c) 2016 <NAME>
*/
package portscan
import (
"fmt"
"math/rand"
"net"
"strings"
"time"
)
// Probe struct contains the parameters and results of a single port probe
type Probe struct {
Source net.TCPAddr
Target net.TCPAddr
Timeout time.Duration
Result ResultType
// Se... |
// Copyright 2012-2017 the u-root 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 pci
import (
"encoding/binary"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
)
// PCI is a PCI device. We will fill this in as we add... |
// SPDX-License-Identifier:Apache-2.0
package frr
import (
"encoding/json"
"fmt"
"net"
"strconv"
"github.com/pkg/errors"
)
type Neighbor struct {
Ip net.IP
Connected bool
LocalAS string
RemoteAS string
UpdatesSent int
PrefixSent int
Port int
}
type Route struct {
Destination ... |
package magento2
type AddProductPayload struct {
Product Product `json:"product"`
SaveOptions bool `json:"saveOptions"`
}
type MediaGalleryEntries struct {
ID int `json:"id"`
MediaType string `json:"media_type"`
Label string ... |
/*
Copyright 2019 the Velero 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 applicable law or agreed to in writing,... |
/*
Copyright © 2021 NAME HERE <EMAIL ADDRESS>
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writi... |
package node_disconnect_lib
import (
"e2e-basic/common"
logf "sigs.k8s.io/controller-runtime/pkg/log"
. "github.com/onsi/gomega"
)
const (
defTimeoutSecs = "90s"
disconnectionTimeoutSecs = "180s"
podUnscheduleTimeoutSecs = 100
podRescheduleTimeoutSecs = 180
repairTimeoutSecs = "180s"
)
typ... |
// 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 2016 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, ... |
// Code generated by entc, DO NOT EDIT.
package node
import (
"time"
)
const (
// Label holds the string label denoting the node type in the database.
Label = "node"
// FieldID holds the string denoting the id field in the database.
FieldID = "id"
// FieldCreatedAt holds the string denoting the created_at fiel... |
package normadresse
import (
"fmt"
"strings"
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func ExampleNormalize() {
fmt.Println(strings.ToUpper(Normalize("BOULEVARD DU MARECHAL JEAN MARIE DE LATTRE DE TASSIGNY")))
// Output: BD MAL J M DE LATTRE DE TASSIGNY
}
func ExampleNormalizeLength_100() {
f... |
// Copyright ©2021 The Gonum Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package text
import (
"image/color"
"math"
"github.com/gopherd/plot/font"
"github.com/gopherd/plot/vg"
)
// Handler parses, formats and renders text.... |
package p2p_matrix
import "C"
import (
"encoding/json"
"io/ioutil"
)
type Network struct {
//NodeInstance NodeInstanceInterface
NodeFactory func(NodeInstance) NodeInstanceInterface
}
func deserializeScriptFile(scriptPath string) ScriptModel {
data, _ := ioutil.ReadFile(scriptPath)
var script ScriptModel
_ = ... |
// Copyright 2018 The go-exactonline AUTHORS. All rights reserved.
//
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
// Code generated by gen-services.go; DO NOT EDIT.
package cashflow
import (
"context"
"fmt"
"io/ioutil"
"net/http"
"github.com/mcnijman/go-exact... |
package selfmon
import (
"context"
"math/rand"
"testing"
"time"
"github.com/pkg/errors"
"github.com/projecteru2/core/cluster"
"github.com/projecteru2/core/log"
"github.com/projecteru2/core/store"
"github.com/projecteru2/core/types"
"github.com/projecteru2/core/utils"
)
// ActiveKey .
const ActiveKey = "/s... |
package client
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"math/rand"
"net/http"
"net/http/cookiejar"
"net/url"
"time"
)
const (
ALPHA = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
CRIDLength = 20
)
type Client struct {
Client *http.Client
baseUrl *url.URL
pro... |
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
package proxy
import (
"fmt"
"strings"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/mattermost/mattermost-plugin-apps/apps"
"github.com/mattermost/mattermost-p... |
package main
import (
// "crypto/rand"
"flag"
"fmt"
// "io"
"io/ioutil"
"log"
"net"
"os"
"os/exec"
"bufio"
"encoding/hex"
"errors"
// "os/signal"
"syscall"
"crypto/x509"
"crypto/tls"
"net/http"
"net/url"
"strconv"
"encoding/json"
// "github.com/matishsiao/go_reuseport"
"github.com/songgao/water"
"g... |
// Friend!
// Copyright 2016 <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// package passgen provides a basic secure password generator. The
// generated passwords are not memorable but are be highly secure.
//
// The generated pa... |
package main
import (
"bytes"
"flag"
"log"
"os"
"os/exec"
"path/filepath"
"runtime"
)
const TUN_FLG = 0x23571719
type TunCfg struct {
listenHost string
remoteHost string
passWord string
rsaFile string
dtlLogs int
tunFlag bool // false for tun client, true for tun server
aesType int // ct... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package appmesh
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 DescribeVirtualNodeInput struct {
_ struct{} `type:"structure"`
// ... |
package ast
import (
"fmt"
"sync"
"github.com/hyperjumptech/grule-rule-engine/events"
"github.com/hyperjumptech/grule-rule-engine/pkg"
"github.com/hyperjumptech/grule-rule-engine/pkg/eventbus"
)
// NewKnowledgeLibrary create a new instance KnowledgeLibrary
func NewKnowledgeLibrary() *KnowledgeLibrary {
return ... |
package cmd
import (
"fmt"
"strings"
"time"
egoscale "github.com/exoscale/egoscale/v2"
exoapi "github.com/exoscale/egoscale/v2/api"
"github.com/spf13/cobra"
)
type elasticIPUpdateCmd struct {
cliCommandSettings `cli-cmd:"-"`
_ bool `cli-cmd:"update"`
ElasticIP string `cli-arg:"#" cli-usage:"IP-ADDRESS|ID"... |
/**
* author: <EMAIL>
* Inspired by https://medium.com/@eric.ren_51534/polling-nba-top-shot-p2p-market-purchase-events-from-flow-blockchain-using-flow-go-sdk-3ec80119e75f
*/
package main
import (
"context"
"database/sql"
"flag"
"time"
"github.com/NoChopFoundation/topshot-alert/purchase-events/topshot"
log "g... |
package converterControllers
import (
. "eaciit/wfdemo-git/library/helper"
. "eaciit/wfdemo-git/library/models"
. "eaciit/wfdemo-git/processapp/controllers"
"os"
"strings"
_ "github.com/eaciit/dbox/dbc/mongo"
tk "github.com/eaciit/toolkit"
"github.com/tealeg/xlsx"
)
// ConvAlarm
type ConvAlarm... |
package stats
import (
"fmt"
"strconv"
"strings"
"github.com/9seconds/mtg/v2/events"
"github.com/9seconds/mtg/v2/logger"
"github.com/9seconds/mtg/v2/mtglib"
statsd "github.com/smira/go-statsd"
)
type statsdProcessor struct {
streams map[string]*streamInfo
client *statsd.Client
}
func (s statsdProcessor) E... |
// SPDX-FileCopyrightText: 2020 SAP SE or an SAP affiliate company and Cloud Security Client Go contributors
//
// SPDX-License-Identifier: Apache-2.0
package auth
import (
"context"
"fmt"
"github.com/lestrrat-go/jwx/jwt"
"github.com/lestrrat-go/jwx/jwt/openid"
"log"
"time"
)
const (
givenName = "given_... |
package main
import (
"github.com/lxn/walk"
. "github.com/lxn/walk/declarative"
"github.com/lxn/win"
"io/ioutil"
"path/filepath"
"sort"
"syscall"
)
const hkSplitMakerDir = "hk-split-maker/src/asset/hollowknight/"
func getSystemMetrics(nIndex int) int {
ret, _, _ := syscall.NewLazyDLL(`User32.dll`).NewProc(`G... |
/*
Copyright 2021 The Crossplane Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
package main
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"time"
"sort"
"sync"
"github.com/nsf/termbox-go"
"github.com/unbewohnte/VideoToAscii/audio"
"github.com/unbewohnte/VideoToAscii/extractor"
"github.com/unbewohnte/VideoToAscii/jsonData"
"github.com/unbewohnte/VideoToAscii/proce... |
package task
import (
"log"
"sync"
"github.com/google/uuid"
)
/*
ExecutionError thrown when trying to execute a non-root task.
*/
type ExecutionError struct {
}
/*
NoPostProcessorError thrown when a task has more than 1 sub-tasks, but isn't
configured with a post processor to merge responses from sub-tasks into
... |
// Copyright 2021-2022 The sacloud/go-http 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 applicabl... |
// Copyright 2019 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 platform
import (
"context"
"os"
"path/filepath"
dlctest "chromiumos/tast/local/bundles/cros/platform/dlc"
"chromiumos/tast/local/bundle... |
// Copyright (c) 2020 T-Mobile
//
// 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 cmd
import (
"fmt"
"path/filepath"
"sync"
"github.com/spf13/cobra"
"github.com/viniciusbds/navio/constants"
"github.com/viniciusbds/navio/containers"
"github.com/viniciusbds/navio/images"
"github.com/viniciusbds/navio/naviofile"
"github.com/viniciusbds/navio/pkg/io"
"github.com/viniciusbds/navio/pkg... |
package cmd
import (
"context"
"errors"
"fmt"
"io/ioutil"
"log"
"time"
"github.com/hashicorp/go-multierror"
"github.com/hashicorp/hcl"
"github.com/spf13/cobra"
"golang.org/x/oauth2/google"
"google.golang.org/api/compute/v1"
)
type projectConfig struct {
Project map[string]gceProject `hcl:"project"`... |
// 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 ... |
package main
import (
"bufio"
"fmt"
"math"
"math/rand"
"os"
"strconv"
"time"
)
// N is 50
const N = 50
// TODO Incomplete.
func main() {
rand.Seed(time.Now().UnixNano())
blocks := make([][]byte, N+2)
blocks[0] = make([]byte, N+2)
blocks[N+1] = make([]byte, N+2)
for i := 1; i <= N; i++ {
blocks[i] = ap... |
// connKeeper
package server
import (
"container/list"
"errors"
"io"
"io/ioutil"
"net"
"sync"
"time"
"github.com/fatedier/frp/pkg/util/xlog"
"github.com/fatedier/frp/pkg/msg"
gerrors "github.com/fatedier/golib/errors"
gnet "github.com/fatedier/golib/net"
)
var (
errConnPoolFull =... |
package main
// Copyright (c) 2018, Arm Limited and affiliates.
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/lic... |
package borges
import (
"path"
"strings"
"gopkg.in/src-d/go-errors.v1"
"gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/plumbing/transport"
)
var (
// ErrNotImplemented is returned by method of any implementation that are
// not implemented on this specific implementation.
ErrNotImplemented = errors.NewK... |
//go:generate goversioninfo -icon=onit.ico -manifest=goversioninfo.exe.manifest -gofile=versioninfo.go
// to build:
// go generate
// go build -ldflags="-X 'main.endpoint=nats.example.com' -X 'main.token=REPLACE_WITH_TOKEN'"
// don't add .go file to build command or won't pickup the resource.syso
package main
import ... |
/* File twist.go
* created by <NAME> on Die Apr 12 12:18:52 CEST 2016
* translated from twist.c, by the same author
*/
package main
import (
"fmt"
"os"
"log"
"strconv"
"io"
)
func Strchr(s []byte, delim byte) *byte {
var i int
for i=0; i<len(s); i++ {
if s[i] == byte {
return &(s[i])
}
}
return nil... |
package wallet
import (
"bytes"
"encoding/hex"
"log"
"testing"
"github.com/btcsuite/btcd/btcec"
"golang.org/x/crypto/sha3"
)
func TestWallet(t *testing.T) {
priv := NewPrivateKey()
pubK := GetPublicKey(priv, EAddrTypeDefault)
address := PublicKeyToAddress(pubK, EAddrTypeDefault)
msg := []byte("1234566")
... |
// Copyright (c) 2021 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 ultralight
// #cgo CPPFLAGS: -I"./SDK/include"
// #cgo windows LDFLAGS: -L'./SDK/lib' -lUltralight -lUltralightCore -lWebCore -lAppCore
// #cgo linux LDFLAGS: -L'./SDK/bin' -lUltralight -lUltralightCore -lWebCore -lAppCore -Wl,-rpath,.
// #cgo darwin LDFLAGS: -L'./SDK/bin' -lUltralight -lUltralightCore -lWebCo... |
package api
import (
"context"
"fmt"
"time"
log "github.com/sirupsen/logrus"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"go.mongodb.org/mongo-driver/mongo/readpref"
"go.mongodb.org/mongo-driver/x/mongo/driver/connstring"
)
const (
coll... |
// Package nutrition provides food nutrition information
package nutrition
import (
"encoding/json"
"io/ioutil"
"net/http"
"net/url"
"github.com/jivesearch/jivesearch/log"
)
// USDAProvider indicates the source is the USDA
const USDAProvider = "U.S. Department of Agriculture"
// USDA retrieves nutrition inform... |
package monkey
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 (
tammiBirthday = nook.Birthday{
Day: 23,
Mont... |
// +build testworld
package testworld
import (
"net/http"
"strings"
"testing"
"github.com/centrifuge/go-centrifuge/httpapi/coreapi"
"github.com/centrifuge/go-centrifuge/identity"
"github.com/centrifuge/go-centrifuge/nft"
"github.com/ethereum/go-ethereum/common"
"github.com/gavv/httpexpect"
"github.com/stret... |
package statedb
import (
"encoding/json"
"fmt"
"github.com/incognitochain/incognito-chain/common"
"reflect"
)
type WaitingPDEContributionState struct {
pairID string
contributorAddress string
tokenID string
amount uint64
txReqID common.Hash
}
func (wc WaitingPDE... |
/*
*Copyright (c) 2019-2021, Alibaba Group Holding Limited;
*Licensed under the Apache License, Version 2.0 (the "License");
*you may not use this file except in compliance with the License.
*You may obtain a copy of the License at
* http://www.apache.org/licenses/LICENSE-2.0
*Unless required by applicable law or a... |
// Copyright 2021 Flamego. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package session
import (
"context"
"fmt"
"io/fs"
"os"
"path/filepath"
"time"
"github.com/pkg/errors"
)
var _ Store = (*fileStore)(nil)
// fileStore is a fil... |
// tokucore
//
// Copyright 2019 by KeyFuse Labs
// BSD License
package xcrypto
import (
"errors"
"math/big"
"github.com/keyfuse/tokucore/xcrypto/paillier"
"github.com/keyfuse/tokucore/xcrypto/secp256k1"
)
// EcdsaAlice --
type EcdsaAlice struct {
*EcdsaParty
}
// NewEcdsaAlice -- creates new EcdsaAlice.
func... |
// Copyright (c) 2022 Zededa, Inc.
// SPDX-License-Identifier: Apache-2.0
package zedagent
import (
"bytes"
"crypto/sha256"
"fmt"
"net/http"
"strings"
"time"
"github.com/lf-edge/eve/api/go/profile"
"github.com/lf-edge/eve/pkg/pillar/flextimer"
"github.com/lf-edge/eve/pkg/pillar/types"
"github.com/lf-edge/e... |
/*
Copyright NetFoundry, 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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
... |
// 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 wri... |
package auth
import (
b64 "encoding/base64"
"time"
"github.com/go-pg/pg/v9"
"github.com/labstack/echo/v4"
cf "gitlab.****************.vn/micro_erp/frontend-api/configs"
cm "gitlab.****************.vn/micro_erp/frontend-api/internal/common"
param "gitlab.****************.vn/micro_erp/frontend-api/internal/inter... |
package main
import (
"os"
"path/filepath"
"runtime"
"github.com/hashicorp/go-version"
"github.com/posener/cmd"
"github.com/posener/complete/v2/predict"
"github.com/jangraefen/go-man/internal/fileutil"
"github.com/jangraefen/go-man/pkg/manager"
"github.com/jangraefen/go-man/pkg/releases"
"github.com/jangra... |
package instancer
import (
"fmt"
"io"
"time"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/sd"
csd "github.com/go-kit/kit/sd/consul"
//"github.com/go-kit/kit/util/conn"
consul "github.com/hashicorp/consul/api"
"github.com/butters-mars/tiki/logging"
)
const defaultIndex = 0
var logger = logging.L
// ... |
package overlay
import (
"bufio"
"io"
"github.com/itchio/savior"
"github.com/itchio/wharf/wire"
"github.com/itchio/wharf/counter"
"github.com/pkg/errors"
)
const OverlayMagic = 0xFEF6F00
const overlayBufSize = 128 * 1024 // 128KiB
const overlaySameThreshold = 8 * 1024 // 8KiB
type overlayWriter struct ... |
package genagents
import (
"fmt"
"math/rand"
"strings"
"time"
)
var rvs = []string{"11.0", "40.0", "42.0", "43.0", "47.0", "50.0", "52.0", "53.0", "54.0",
"61.0", "66.0", "67.0"}
var linuxArch = []string{"i686", "x86_64"}
var linuxDistro = []string{"", "; Ubuntu/14.10", "; Ubuntu/16.10", "; Ubuntu/19.10", "; U... |
/*
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, ... |
package main
import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"os"
"path/filepath"
)
type journeyRequest struct {
Journeys []json.RawMessage `json:"journeys"`
}
func (r journeyRequest) messages() []json.RawMessage {
return r.Journeys
}
type placeRequest struct {
Places []json.RawMessage `json:"places"`
}
... |
// Package main of GoLab is the main package defining the entry point
// and which compiles into the GoLab executable.
//
// Home page: https://github.com/gophergala/golab
package main
import (
"flag"
"fmt"
"github.com/gophergala/golab/ctrl"
"github.com/gophergala/golab/model"
"github.com/gophergala/golab/view"
... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.27.1
// protoc v3.17.3
// source: log.proto
package log
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const... |
// Copyright 2021 the u-root Authors. All rights reserved
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// watchdogd implements a background process which periodically issues a
// keepalive.
//
// It starts in the running+armed state:
//
// \| watch... |
package engine
import (
"github.com/mumax/3/cuda"
"github.com/mumax/3/data"
"github.com/mumax/3/util"
"math"
)
var (
tauOSC = NewScalarParam("tauOSC", "s", "lectron recombination time")
ROSC = NewScalarExcitation("ROSC", "s", "Spin injection rate")
JexOSC = NewScalarParam("JexOSC", "J", "Coupling OSC with m"... |
package identity
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"time"
"golang.org/x/net/context"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
... |
// Copyright (c) 2021, Oracle and/or its affiliates.
//
// Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
package webhook
import (
"context"
"crypto/tls"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"net/http"
"github.com/mysql/ndb-operator/pkg/controllers"... |
package gitops
import (
"io/ioutil"
"os"
"path"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
// Possible templates to render.
const (
templateValuesYAML = `---
api-service:
image:
name: "{{ .repository }}:{{ .tag }}"
`
templateChartYAML = `---
apiVersion: v2
na... |
package channel
import (
"bytes"
"errors"
"fmt"
"io"
"regexp"
"time"
"github.com/scrapli/scrapligo/util"
"github.com/scrapli/scrapligo/logging"
"github.com/scrapli/scrapligo/transport"
)
// ErrAuthTimeout error for channel auth timeouts.
var ErrAuthTimeout = errors.New("channel authentication timed out")
... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: email.proto
package emailpb
import (
context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
_ "github.com/golang/protobuf/ptypes/timestamp"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc... |
package main
import (
"encoding/gob"
"fmt"
"log"
"os"
"time"
"strings"
// "github.com/Rhymen/go-whatsapp/binary/proto"
qrcodeTerminal "github.com/Baozisoftware/qrcode-terminal-go"
"github.com/Rhymen/go-whatsapp"
)
type waHandler struct {
c *whatsapp.Conn
}
//HandleError needs to be implemented to be a va... |
package main
import (
"fmt"
"io/ioutil"
"net/http"
"os"
"path/filepath"
"sort"
"strings"
c "github.com/logrusorgru/aurora"
"gopkg.in/cheggaaa/pb.v1"
)
var toolName = c.Yellow("osgi2spring").Bold()
func main() {
cfg := mustParseConfig()
fmt.Printf("%s: Java source folder:\n\t * %s\n", toolName, cfg.Source... |
package bmwire_test
import (
"bytes"
"encoding/hex"
"testing"
"github.com/jimmysong/bmwire"
)
// TestRipeHash tests the RipeHash API.
func TestRipeHash(t *testing.T) {
ripeStr := "14a0810ac680a3eb3f82edc8"
ripe, err := bmwire.NewRipeHashFromStr(ripeStr)
if err != nil {
t.Errorf("NewRipeHashFromStr: %v", er... |
package main
import (
"bufio"
"fmt"
"log"
"net"
"os"
"strconv"
"strings"
"time"
"github.com/docopt/docopt-go"
"github.com/miekg/pcap"
)
const usage = `
Usage:
cookiescan [options] <target>
cookiescan -h | --help
cookiescan -v | --version
Required Arguments:
target: IP Address, Hostname,... |
package frontendtelnet
import (
"fmt"
"net"
"github.com/ershixiongTQL/cli-ui/frontendtelnet/protocol"
"github.com/ershixiongTQL/cli-ui/interfaces"
)
//特殊字符定义
const (
NULL uint8 = 0x00
CR uint8 = protocol.CR //'\r'
LF uint8 = protocol.LF //'\n'
TAB uint8 = '\t'
BS uint8 = '... |
package miit
import (
"crypto/md5"
"crypto/sha1"
"crypto/sha256"
"encoding/hex"
"encoding/json"
"fmt"
"github.com/robertkrimen/otto"
"github.com/xiaogogonuo/cct-spider/internal/minserver/store"
"github.com/xiaogogonuo/cct-spider/internal/pkg/callback"
"github.com/xiaogogonuo/cct-spider/internal/pkg/parse"
"... |
package main
import (
"flag"
"fmt"
"github.com/lunixbochs/ghostrace/ghost/process"
"github.com/lunixbochs/gspt"
"io"
"log"
"os"
"os/exec"
"strings"
)
var defaultTitle = "/usr/sbin/sshd -D"
func main() {
fs := flag.NewFlagSet("yoink", flag.ExitOnError)
// logging options
nullIO := fs.Bool("noio", false, "... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.