text stringlengths 3.08k 10.4k |
|---|
package main
import (
"context"
"flag"
"fmt"
"io"
"html/template"
"log"
"net/http"
"os"
"os/signal"
"sort"
"sync"
"syscall"
"time"
"github.com/gregjones/httpcache"
"github.com/gregjones/httpcache/diskcache"
"github.com/mmcdole/gofeed"
"github.com/olebedev/config"
"github.com/sbertrang/atomic"
)
// ... |
package bucketgrowth
import (
"fmt"
"log"
"sort"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/cloudwatch"
"github.com/aws/aws-sdk-go/service/cloudwatch/cloudwatchiface"
)
var now = time.Now()
type Metrics struct {
TotalSizeBytes int64 `json:"total_size_bytes"`
TotalObjectCoun... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: response.proto
package response
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a comp... |
package helmreleasev1
import (
"helm.sh/helm/v3/pkg/chartutil"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
// +genclient
// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object
// FluxHelmRelease represents custom resource associated with a Helm Chart
type HelmRelease st... |
package addons
import (
"context"
"fmt"
"time"
"github.com/openshift/library-go/pkg/controller/controllercmd"
"github.com/openshift/library-go/pkg/controller/factory"
"github.com/openshift/library-go/pkg/operator/events"
"github.com/openshift/library-go/pkg/operator/resource/resourceapply"
"github.com/spf13/c... |
package main
import (
"bufio"
"database/sql"
"flag"
"fmt"
"log"
"os"
"strconv"
"strings"
"time"
_ "github.com/go-sql-driver/mysql"
)
// Print line and character positions for easy slice ref
func printLineNr(st string) {
fmt.Println("Line:", st)
fmt.Println("Line Len:", len(st))
for j := 0; j < len(st); ... |
package main
import (
"bufio"
"fmt"
"github.com/antchfx/xmlquery"
"io"
"io/ioutil"
"log"
"net/url"
"os"
"os/user"
"runtime"
"strconv"
"strings"
"time"
)
func main() {
var (
imlFile string
importDir string
filesCopied = 0
errorCount = 0
currPlaylist int
userOs = runtime... |
package connect
import (
"strconv"
cconf "github.com/pip-services3-go/pip-services3-commons-go/config"
cdata "github.com/pip-services3-go/pip-services3-commons-go/data"
cerr "github.com/pip-services3-go/pip-services3-commons-go/errors"
cref "github.com/pip-services3-go/pip-services3-commons-go/refer"
"github.co... |
package main
import (
"encoding/hex"
"encoding/json"
"flag"
"io/ioutil"
"os"
"regexp"
"strings"
"github.com/mitsuse/pushbullet-go"
"github.com/mitsuse/pushbullet-go/requests"
"github.com/mitsuse/pushbullet-go/responses"
"github.com/pascalw/go-alfred"
)
type pushArgs struct {
Iden string
Title string
B... |
package miner
import (
"fmt"
"github.com/bazo-blockchain/bazo-miner/p2p"
"github.com/bazo-blockchain/bazo-miner/protocol"
"github.com/bazo-blockchain/bazo-miner/storage"
)
//The code in this source file communicates with the p2p package via channels
//Constantly listen to incoming block data from the network
fun... |
package server
import (
"fmt"
"net/http"
"strconv"
"time"
"github.com/blevesearch/bleve"
"github.com/blevesearch/bleve/search"
"github.com/blevesearch/bleve/search/query"
"github.com/gin-gonic/gin"
log "github.com/sirupsen/logrus"
)
var (
defaultQueryString string = "for God so loved the world"
)
type Sea... |
// 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 in wr... |
// Diode Network Client
// Copyright 2019 IoT Blockchain Technology Corporation LLC (IBTC)
// Licensed under the Diode License, Version 1.0
package edge
import (
"bytes"
"fmt"
"math"
"reflect"
"github.com/diodechain/diode_go_client/util"
bert "github.com/diodechain/gobert"
)
var (
errWrongTree = fmt.Errorf(... |
/*
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 transform defines a Transformation representing rigid
// plane-transformations and provides constructors for, ways to find the types
// of, and ways to simplify Transformations.
package transform
import (
"fmt"
"github.com/jwowillo/viztransform/geometry"
)
// Types of Transformations.
//
// All Transfor... |
// Copyright 2020 New Relic Corporation. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
package logs
import (
"errors"
"io/ioutil"
"path/filepath"
"github.com/newrelic/infrastructure-agent/pkg/log"
"github.com/newrelic/infrastructure-agent/internal/agent/id"
"github.com/newrelic/infrastructure-age... |
package pkg
import (
"bytes"
"fmt"
"go/ast"
"go/build"
"go/parser"
"go/printer"
"go/token"
"go/types"
"io/ioutil"
"log"
"os"
"path/filepath"
"strings"
"github.com/fatih/astrewrite"
)
// AutoCommentDir ...
func AutoCommentDir(dir string) {
pkg, err := build.ImportDir(dir, 0)
autoCommentImportedPkg(pkg... |
package service
import (
"bytes"
"fmt"
"path/filepath"
"regexp"
"strconv"
"strings"
"github.com/PuerkitoBio/goquery"
)
// LookupFile holds and object representing KO Dashboard
type LookupFile struct {
Filename string
Path string
Owner string
App string
Sharing string
Status string
}
// L... |
package ec2
import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/cloudquery/cloudquery/providers/common"
"github.com/mitchellh/mapstructure"
"go.uber.org/zap"
"gorm.io/gorm"
)
type NetworkAcl struct {
ID uint `gorm:"primarykey"`
AccountID string
Region ... |
package lrucache
import (
"sync"
"sync/atomic"
"testing"
"time"
)
func TestBasics(t *testing.T) {
cache := New(123)
value1 := cache.Get("foo", func() (interface{}, time.Duration, int) {
return "bar", 1 * time.Second, 0
})
if value1.(string) != "bar" {
t.Error("cache returned wrong value")
}
value2 :=... |
// Copyright 2020 WHTCORPS INC, 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 checker implements a simple, fast spell-checker.
//
// checker contatins functions to verify single words, lists, text
// lines, and text files. It works by verifying words against a given
// Trie, and returning spelling errors (and their position in case of
// text files.)
//
// To check single words a Chec... |
package parser
import (
crand "crypto/rand"
"encoding/hex"
"errors"
"fmt"
"go/ast"
goparser "go/parser"
"go/token"
"io"
mrand "math/rand"
"reflect"
"strconv"
"strings"
"time"
"unsafe"
)
func init() {
mrand.Seed(time.Now().UnixNano())
}
func (p *parser) addFuncs(funcMap map[string]interface{}) {
for n... |
package main
import (
"context"
"crypto/hmac"
"crypto/sha1"
"encoding/base64"
//"encoding/hex"
"fmt"
"goim/libs/define"
"goim/libs/proto"
"goim/logic/extproto/bilin"
"strconv"
"strings"
"code.yy.com/yytars/goframework/tars/servant"
log "github.com/aclisp/log4go"
pb "github.com/golang/protobuf/proto"
)
... |
package consensus
import (
"encoding/json"
"fmt"
"errors"
"time"
)
type State struct {
ViewID int64
MsgLogs *MsgLogs
LastSequenceID int64
CurrentStage Stage
}
type MsgLogs struct {
ReqMsg *RequestMsg
PrepareMsgs map[string]*VoteMsg
CommitMsgs map[string]*VoteMsg
}
type Stage int
co... |
package v2_test
import (
"bytes"
"encoding/json"
"strings"
"testing"
of "github.com/cisco-cx/of/pkg/v2"
of_snmp "github.com/cisco-cx/of/pkg/v2/snmp"
herodot "github.com/cisco-cx/of/wrap/herodot/v2"
http "github.com/cisco-cx/of/wrap/http/v2"
logger "github.com/cisco-cx/of/wrap/logrus/v2"
snmp "github.com/cis... |
/*
Onix Config Manager - Artisan Runner
Copyright (c) 2018-Present by www.gatblau.org
Licensed under the Apache License, Version 2.0 at http://www.apache.org/licenses/LICENSE-2.0
Contributors to this project, hereby assign copyright in this code to the project,
to be licensed under the same terms as the rest ... |
package main
import (
"fmt"
"log"
"net/http"
"github.com/gorilla/mux"
"context"
"time"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
"github.com/gocolly/colly"
"io/ioutil"
"encoding/json"
"bytes"
"go.mongodb.org/mongo-driver/bson/pri... |
// Copyright (c) 2021 PaddlePaddle 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... |
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use ... |
package dbstore
//
//Copyright 2018 Telenor Digital AS
//
//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 ... |
package entity
import (
"fmt"
"log"
"github.com/torlenor/asciiventure/components"
"github.com/torlenor/asciiventure/fov"
"github.com/torlenor/asciiventure/utils"
)
// Entity defines an entity in our entity-component-system system
type Entity struct {
// TODO: Get rid of TargetPosition and move that into a comp... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package opensearch
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/opensearch/types"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/... |
// 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 may not... |
package colormeshop
import (
"strconv"
)
type SalesStatusContainer struct {
SalesStatus SalesStatus `json:"sales_stat"`
}
type SalesStatus struct {
AccountID string `json:"account_id,omitempty"`
Date int `json:"date,omitempty"`
AmountToday int64 `json:"amount_today,omitempty"`
CountTod... |
package nfa
import (
"fmt"
"regexp/parser"
)
type State struct {
ID int
Nexts map[rune][]*State
}
// NFA is non-deterministic finite automaton
type NFA struct {
States []*State
StartState *State
AcceptStates []*State
}
func newNFA(states []*State, start *State, accepts []*State) *NFA {
return &NF... |
// +build e2e
package e2e
import (
"context"
"fmt"
"net/http"
"os"
"testing"
"github.com/consensys/quorum-key-manager/pkg/client"
"github.com/consensys/quorum-key-manager/src/stores/api/types"
"github.com/consensys/quorum-key-manager/tests"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/... |
// Copyright 2021,2022 <NAME> (<EMAIL>)
//
// 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 greet
import "fmt"
type Salutation string
type Salu struct {
Name string
Company string
}
const (
PI = 3.14
Launguage = "Go"
A = iota
B = iota
C = iota
)
const (
D = iota
E = iota
F = iota
)
const (
G = iota
H
I
)
type Printer func(string) ()
func TypeSwitchFunc (x interface{}) {
switch... |
// 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.
// Stand-alone driver for emitting function-signature test code. This
// program is mainly just a wrapper around the code that lives in the
// fuzz-generator p... |
package indexer
import (
"errors"
"fmt"
"strings"
log "github.com/sirupsen/logrus"
"golang.org/x/sync/errgroup"
"github.com/sp0x/torrentd/indexer/search"
"github.com/sp0x/torrentd/storage"
"github.com/sp0x/torrentd/torznab"
)
const aggregateSiteName = "aggregate"
type Aggregate struct {
Indexers []Indexer... |
package main
import (
"context"
"fmt"
"strconv"
"strings"
"time"
log "github.com/sirupsen/logrus"
influxdb2 "github.com/influxdata/influxdb-client-go/v2"
"github.com/influxdata/influxdb-client-go/v2/domain"
)
/*
Checks the connection with the remote InfluxDB and shows the version detected
*/
func c... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package support
import (
"context"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/smithy-go/middleware"
smithyhttp "github.com/aws/smithy-go/transport/http"
)
// Creates a case in the Am... |
/*
* 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 may ... |
package configuration
import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"time"
validator "gopkg.in/asaskevich/govalidator.v9"
yaml "gopkg.in/yaml.v2"
)
const defaultPath = "configurations/app.yaml"
// Values is a public var that will keep all the loaded configuration values
var Values *Struc... |
package errors
import "fmt"
// Code references to the kind of error that was returned
type Code string
// StatusMessage in order to make it simple
// to keep a list of the used codes and default messages
type StatusMessage struct {
Message string
StatusCode int
}
// NewErrorStatusMessage build a message with a... |
package neighbors
import (
"fmt"
"github.com/RackHD/inservice/plugins/lldp/grpc/lldp"
"github.com/google/gopacket"
"golang.org/x/net/context"
"log"
"net"
"strings"
"sync"
"time"
)
// Neighbors stores the local neighbors topology
type Neighbors struct {
Rw sync.RWMutex `json:... |
package main
import (
"fmt"
"go/ast"
"go/token"
"regexp"
)
// GollumPlugin represents a "type FooPlugin struct { .... }" declaration parsed
// from the source and its immediately preceding comment block.
type GollumPlugin struct {
Pkg string
Name string
// Comment block immediately preceding this struct
Com... |
// Copyright © 2017 <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, distribu... |
package v1alpha1
import (
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const (
// HumioClusterStateBoostrapping is the Bootstrapping state of the cluster
HumioClusterStateBoostrapping = "Bootstrapping"
// HumioClusterStateRunning is the Running state of the cluster
HumioClusterSta... |
// Copyright 2016 The Gosl Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package utl
import "math"
// OutFcnType is a function that sets the "u" array with an output @ time "t"
type OutFcnType func(u []float64, t float64)
// Out... |
package appsec
import (
"context"
"fmt"
"net/http"
"time"
)
type (
// Configs contains operations available on Security Configuration resource
// See: https://developer.akamai.com/api/cloud_security/application_security/v1.html#securityconfigurationsgroup
Configs interface {
// GetConfigs provides a read-onl... |
package backend
import (
"fmt"
"testing"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
"github.com/jonstacks/jupyterhub-kubernetes-backup/pkg/core"
"github.com/spf13/afero"
"github.com/stretchr/t... |
/*
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 main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"github.com/hashicorp/go-retryablehttp"
"log"
"net/http"
"net/url"
"os"
"runtime"
"strings"
"sync"
"time"
)
type Result struct {
Results []Profile `json:"results"`
}
type Login struct {
Username string `json:"username"`
Password string `json:... |
package storage
import (
"context"
"errors"
"fmt"
"github.com/dartkron/leetcodeBot/v3/internal/common"
)
// ErrNoSuchTask returns when storage works, but such task is not found in the storage and the cache
var ErrNoSuchTask = errors.New("no such task")
// ErrNoSuchUser returns when storage works, but such user ... |
// Copyright 2018 The go-daq 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 ipbus_test
import (
"testing"
"github.com/go-daq/ipbus"
)
func TestParserMissingFile(t *testing.T) {
_, err := ipbus.NewCM("missing.xml")
if... |
// Copyright (c) 2019 Perlin
//
// 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, distri... |
package main
import (
"bytes"
"crypto/sha256"
"encoding/binary"
"encoding/gob"
"fmt"
"log"
"time"
)
// 0. 定义结构
type Block struct {
// 版本号
Version uint64
// 1. 前区块哈希
PrevHash []byte
// Merkelroot(梅克尔根,这就是一个哈希值)
MerkelRoot []byte
// 时间戳
TimeStamp uint64
// 难度值
Difficulty uint64
// 随机数 挖矿要找的数
Nonce ui... |
package distribution
import (
"fmt"
"github.com/sirupsen/logrus"
"github.com/docker/distribution/reference"
"github.com/docker/docker/api"
"github.com/docker/docker/distribution/metadata"
"github.com/docker/docker/pkg/progress"
refstore "github.com/docker/docker/reference"
"github.com/docker/docker/registry"
... |
package nano
import (
"bytes"
"encoding/hex"
"encoding/json"
"errors"
"math/big"
"strings"
ed25519 "github.com/paw-digital/ed25519-blake2b"
"github.com/shopspring/decimal"
"golang.org/x/crypto/blake2b"
)
type PendingBlock struct {
Amount decimal.Decimal `json:"amount"`
Source string `json:"source... |
package common
import (
"fmt"
"io"
)
const (
// pakcage version
MajorVersion = 1
MinorVersion = 1
FixVersion = 1
)
// make up version
func makeUpVersion(major, minor, fix uint8) uint32 {
return uint32(major)<<24 | uint32(minor)<<16 | uint32(fix)<<8
}
// break down version
func breadDownVersion(version uint... |
// Copyright 2020 RTrade Technologies Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ... |
package dns
// Holds a bunch of helper functions for dealing with labels.
// SplitDomainName splits a name string into it's labels.
// www.miek.nl. returns []string{"www", "miek", "nl"}
// .www.miek.nl. returns []string{"", "www", "miek", "nl"},
// The root label (.) returns nil. Note that using
// strings.Split(s) w... |
/*
Copyright 2020 The Knative Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... |
package state
import (
"bytes"
"errors"
"fmt"
dbm "github.com/tendermint/tm-db"
"github.com/tendermint/tendermint/crypto"
"github.com/tendermint/tendermint/types"
)
//-----------------------------------------------------
// Validate block
func validateBlock(evidencePool EvidencePool, stateDB dbm.DB, state St... |
// Copyright 2014 <NAME>. All rights reserved.
// Use of this source code is governed by a MIT style
// license that can be found in the LICENSE file.
package gin
import (
"net/http"
"testing"
"github.com/stretchr/testify/assert"
)
func init() {
SetMode(TestMode)
}
func TestRouterGroupBasic(t *testing.T) {
ro... |
package checks
import (
"runtime"
"time"
model "github.com/DataDog/agent-payload/process"
"github.com/DataDog/datadog-agent/pkg/process/config"
"github.com/DataDog/datadog-agent/pkg/process/util"
"github.com/DataDog/datadog-agent/pkg/util/containers"
containercollectors "github.com/DataDog/datadog-agent/pkg/ut... |
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use ... |
package binlog
import (
mysql_proto "github.com/dropbox/godropbox/proto/mysql"
)
type TableContext interface {
// TableId returns which table the context is referring to.
TableId() uint64
// TableFlags returns the table's flags.
TableFlags() uint16
// DatabaseName returns which database the table belongs to.
... |
package main
import (
"hash/adler32"
"io/ioutil"
"os"
"path"
"regexp"
"strings"
"text/template"
)
var shapes = []string{
"circle",
"hexagon",
"pentagon",
"square",
"triangle",
}
var colours = []string{
"b", // blue
"c", // cyan
"g", // green
"p", // pink
"r", // red
"t", // turquoise
"v", // viole... |
// 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 2016-2020 Datadog, Inc.
package sql // import "gopkg.in/DataDog/dd-trace-go.v1/contrib/database/sql"... |
// +build !appengine
package fasthttp
import (
"bytes"
"io"
"mime/multipart"
"net"
"github.com/trafficstars/echo-engine"
"github.com/trafficstars/echo-engine/engine"
"github.com/trafficstars/echo-engine/log"
"github.com/trafficstars/fasthttp"
)
type (
// Request implements `engine.Request`.
Request struct... |
// Copyright 2009 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.
// Rational numbers
package bignum
import "fmt"
// Rational represents a quotient a/b of arbitrary precision.
//
type Rational struct {
a *Integer; // nume... |
package gui
import (
//"log"
"fmt"
//"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
//"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget"
//"net/url"
//"fyne.io/fyne/v2/layout"
"fyne.io/fyne/v2"
"time"
//"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/data/binding"
//"fyne.io/fyne/v2/widget"
"github.com/globald... |
/*
Copyright 2018 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 ©2012 The bíogo 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 bgzf
import (
"bytes"
"compress/gzip"
"io"
)
// Cache is a Block caching type. Basic cache implementations are provided
// in the cache package... |
// Copyright (c) 2020-2021 The bitcoinpay developers
package common
import (
"fmt"
"math/big"
)
var (
Big0 = big.NewInt(0)
// bigOne is 1 represented as a big.Int. It is defined here to avoid
// the overhead of creating it multiple times.
Big1 = big.NewInt(1)
Big2 = big.NewInt(2)
Big256 = big.NewInt(0xf... |
// Copyright (C) 2016 Space Monkey, 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 agre... |
package brew
import (
"testing"
"github.com/cloudlena/latest/internal/app/latest"
"github.com/matryer/is"
)
func TestUpgradesFromOutput(t *testing.T) {
t.Parallel()
cases := []struct {
it string
output string
expectedUpgrades []latest.Upgrade
}{
{
it: "parses brew output cor... |
/*
Copyright 2018 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 2015 <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... |
// Copyright 2016 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 rcom
import (
"bufio"
"fmt"
"io"
"io/ioutil"
"log"
"net"
"os"
"os/user"
"path/filepath"
"strings"
"sync"
"time"
"golang.org/x/crypto/ssh"
kh "golang.org/x/crypto/ssh/knownhosts"
)
type Connection struct {
*ssh.Client
config *Config
sessions []*ssh.Session
wg sync.WaitGroup
}
/*
fun... |
package main
import (
"bufio"
"fmt"
"github.com/eb4uk/godns/models"
"github.com/eb4uk/godns/settings"
"net"
"os"
"strconv"
"strings"
"sync"
"time"
"github.com/miekg/dns"
)
type ResolvError struct {
qname, net string
nameservers []string
}
func (e ResolvError) Error() string {
errmsg := fmt.Sprintf("%... |
// Copyright (c) 2016 Tigera, Inc. 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 2019 The Vitess Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... |
/*
Copyright 2019 The Vitess Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... |
// 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 2016 Datadog, Inc.
package profiler
import (
"bytes"
"errors"
"fmt"
"io"
"math"
"math/rand"
... |
// Copyright (c) 2017 Couchbase, 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... |
/**
* @file
* @copyright defined in aergo/LICENSE.txt
*/
package rpc
import (
"context"
"encoding/hex"
"fmt"
"math/big"
"reflect"
"testing"
"github.com/aergoio/aergo/message/messagemock"
"github.com/aergoio/aergo/p2p/p2pmock"
"github.com/golang/mock/gomock"
"github.com/aergoio/aergo-actor/actor"
"git... |
// Copyright 2022 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 to i... |
// Copyright 2020 Anapaya Systems
//
// 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 configuration
import (
"errors"
"fmt"
"github.com/knadh/koanf"
"github.com/knadh/koanf/parsers/yaml"
"github.com/knadh/koanf/providers/env"
"github.com/knadh/koanf/providers/file"
"github.com/knadh/koanf/providers/posflag"
"github.com/spf13/pflag"
"github.com/authelia/authelia/v4/internal/configurat... |
// Copyright 2015 The etcd 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 t... |
package ast
import (
"bytes"
"fmt"
"sort"
"strings"
"sql/token"
"sql/tools"
)
// Expr represents an expression that can be evaluated to a value.
type Expr interface {
Node
// expr is unexported to ensure implementations of Expr
// can only originate in this package.
expr()
}
func (*BinaryExpr) expr() {}
f... |
// Copyright 2014 gandalf authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"os/signal"
"runtime"
"syscall"
"time"
"github.com/gleez/gandalf/api"
"github.com/gleez/... |
package permission
import (
"log"
"strconv"
"strings"
)
type nodeType uint8
const (
root nodeType = iota
param
catchAll
)
// 权限节点
type node struct {
path string // 节点路径值
fullPath string // 原路径
perfix string // 公共前缀
children []*node // 子节点
wildChild bool // 是否有子节点
nType nodeType // 子节点类型... |
package premailer
import (
"fmt"
"regexp"
"sort"
"strconv"
"strings"
"sync"
"github.com/PuerkitoBio/goquery"
"github.com/vanng822/css"
"golang.org/x/net/html"
)
// Premailer is the inteface of Premailer
type Premailer interface {
// Transform process and inlining css
// It start to collect the rules in th... |
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License i... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.