text stringlengths 3.08k 10.4k |
|---|
package node
import (
"encoding/json"
"errors"
"fmt"
"github.com/jegutierrez/focus-db/core"
"github.com/jegutierrez/focus-db/delivery"
"log"
"net/http"
)
// ErrNotFound is triggered when a key isn't found.
var ErrNotFound = errors.New("element not found")
// ErrFatal is triggered when there is an fatal error.... |
// Copyright (c) 2016 <NAME>.
// Use of this source code is governed by the MIT License.
// The MIT license can be found in the LICENSE file.
// TideCrawler 1.0
// Obtains annual tide forecasts for NOAA Station 9414275
// Parses each tide prediction
// Saves all predictions to database
package main
import (
"bytes"... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.24.0
// protoc v3.12.3
// source: libimmds.proto
package libimmds
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime... |
// Copyright 2018 Istio Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
package main
import (
"fmt"
"github.com/5HT2/taro-bot/bot"
"github.com/5HT2/taro-bot/cmd"
"github.com/5HT2/taro-bot/plugins"
"github.com/5HT2/taro-bot/util"
"github.com/diamondburned/arikawa/v3/gateway"
"log"
"math/rand"
"reflect"
)
var p *plugins.Plugin
type config struct {
Fn string `json:"fn"`
}
// Ini... |
package main
import (
"fmt"
"time"
"github.com/golang/glog"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/tools/cache"
"k8s.io/client-go/util/workqueue"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
utilruntime "k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimach... |
package alicloud
import (
"fmt"
"strconv"
"time"
"github.com/alibaba/terraform-provider/alicloud/connectivity"
"github.com/aliyun/alibaba-cloud-sdk-go/sdk/requests"
"github.com/aliyun/alibaba-cloud-sdk-go/services/vpc"
"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/helper/sch... |
// Helper.go
// Utility file - Contains utility functions and custom data types for the eliza chatbot
// Author - <NAME>
package elizaHelper
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"math/rand"
"regexp"
"sort"
"strings"
"time"
)
// variable that holds all keywords contained in keywords.json
var eliz... |
package fipcontroller
import (
"context"
"fmt"
"os"
"time"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/util/retry"
"github.com/hetznercloud/hcloud-go/hcloud"
"github.com/sirupsen/logrus"
"k8s.io/client-go/kubernetes"
"github.com/cbeneke/hcloud-fip-controller/internal/pkg/configuration"
)
// Con... |
package main
import (
"fmt"
"math/rand"
"os/exec"
"strconv"
"strings"
"time"
)
// https://tikv.org/blog/tikv-3.0ga/
const ecc_prefix = "distributed_cache ecc client"
const raft_prefix = "distributed_cache raft client"
const records = 10000
func get_stop_raft_node_command() []string {
return strings.Split("d... |
package client
import (
"bytes"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/http/httputil"
"net/url"
"github.com/puppetlabs/errawr-go/v2/pkg/encoding"
"github.com/puppetlabs/relay/pkg/debug"
"github.com/puppetlabs/relay/pkg/errors"
)
type RequestOptions struct {
method string
path ... |
package peer_test
import (
"fmt"
"net"
"testing"
"time"
"github.com/CityOfZion/neo-go/pkg/peer"
"github.com/CityOfZion/neo-go/pkg/wire"
"github.com/CityOfZion/neo-go/pkg/wire/payload"
"github.com/CityOfZion/neo-go/pkg/wire/protocol"
"github.com/stretchr/testify/assert"
)
func returnConfig() peer.LocalConfig... |
package supplychain
import (
"fmt"
"math"
"github.com/turbonomic/turbo-go-sdk/pkg/proto"
)
// provider creates a template entity that sells commodities to a consumer template.
type provider struct {
provider *proto.Provider
// Specifies if the provider is optional or not.
// For example the provider of Pod is ... |
package main
import (
"github.com/lokken/family-football/gobbler"
"github.com/lokken/family-football/types"
"golang.org/x/net/html"
"log"
"strings"
"sync"
)
func main() {
rootNode := loadWeek()
extractGames(rootNode)
}
func loadWeek() (rootNode *html.Node) {
week := 1
file := gobbler.LoadSchedule(week)
r... |
/*
Copyright 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 agreed to in wr... |
// Unless explicitly stated otherwise all files in this repository are licensed
// under the MIT License.
// This product includes software developed at Guance Cloud (https://www.guance.com/).
// Copyright 2021-present Guance, Inc.
package influxdb
import (
"encoding/json"
"fmt"
"strconv"
)
type NoMoreDataError s... |
package client
import (
"fmt"
"strings"
"time"
metrics "github.com/armon/go-metrics"
"github.com/glympse/replicator/logging"
"github.com/glympse/replicator/replicator/structs"
nomad "github.com/hashicorp/nomad/api"
nomadstructs "github.com/hashicorp/nomad/nomad/structs"
)
const (
deploymentTimeOut = 15 * ti... |
package main
/*
this is very specific tool for one of bigger cocopacket clients, but maybe useful also as example
all slaves in that system has names like NYC-DEFAULT, NYC-COGENT, NYC-LEVEL3 - so name of location and uplink
purpose of this tool is detect/report situations when other uplink has better packet loss... |
package plugins
import (
"fmt"
"os"
"plugin"
printer "github.com/KablamoOSS/go-cli-printer"
"github.com/KablamoOSS/kombustion/internal/manifest"
"github.com/KablamoOSS/kombustion/internal/plugins/lock"
pluginTypes "github.com/KablamoOSS/kombustion/pkg/plugins/api/types"
)
// LoadPlugins from a manifest and lo... |
package cmd
import (
"bufio"
"crypto/md5"
"errors"
"fmt"
"io"
"io/ioutil"
"os"
"regexp"
"strconv"
"strings"
"time"
"github.com/maskshell/kittenhouse/core/destination"
)
/*
Example of config (based on format of db-proxy):
@target_port 3304;
# Forward all unknown tables to Devel ClickHouse
* clk1;
test_ta... |
package dii2pserv
import (
"bufio"
"io"
"log"
"os"
"path/filepath"
"strings"
)
import (
"github.com/eyedeekay/si-i2p-plugin/src/errors"
"github.com/eyedeekay/si-i2p-plugin/src/helpers"
)
// SamServices is a structure for managing SAM services
type SamServices struct {
listOfServices []samHTTPService
samAdd... |
package gitdb
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/bouggo/log"
)
//Schema holds functions for generating a model id
type Schema struct {
dataset string
block string
record string
indexes map[string]interface{}
internal bool
}
//NewSchema con... |
package aws
import (
"context"
"encoding/json"
"fmt"
"os"
"os/signal"
"syscall"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/iam"
"github.com/aws/aws-sdk-go/service/iam/iamiface"
"github.com/aws/aws-s... |
package scim
import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)
// URN is a custom type for the SCIM spec for the schema
type URN string
// Possible schema URNs for the Databricks SCIM api
const (
UserSchema URN = "urn:ietf:params:scim:schemas:core:2.0:User"
ServicePrincipalSchema... |
package handler
import (
"encoding/binary"
"errors"
"fmt"
"github.com/amsalt/log"
"github.com/amsalt/nginet/bytes"
"github.com/amsalt/nginet/core"
)
const (
MaxPacketLen = 8
MaxExtraLen = 8
)
var (
ErrFrameTooLong = errors.New("LengthFieldBasedFrameDecoder: frame too long")
ErrInBoundEventType = erro... |
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
package upaws
import (
"archive/zip"
"bytes"
"io"
"os"
"strings"
"github.com/hashicorp/go-multierror"
"github.com/pkg/errors"
"github.com/mattermost/mattermost-plugin-apps/apps"
"github.com/mattermos... |
package tmx
const (
// chunk size in bytes
infiniteChunkSize = 16*16*numBytes
numBytes = 4
)
const (
// string constants
groupLayer = "group"
tileLayer = "tilelayer"
objectLayer = "objectgroup"
base_64 = "base64"
csv = ""
)
type tilemap struct {
Version ... |
package main
import (
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"sort"
"strings"
"sync"
"github.com/valyala/fastjson"
)
type match struct {
name, version, bin string
}
type matchMap = map[string][]match
// resolves the path to scoop folder
func scoopHome() (res string) {
if value, ok := os.LookupEnv(... |
package dispatcher
import (
"fmt"
"sync"
record_type "github.com/BrobridgeOrg/compton/types/record"
"github.com/BrobridgeOrg/gravity-dispatcher/pkg/dispatcher/converter"
gravity_sdk_types_product_event "github.com/BrobridgeOrg/gravity-sdk/types/product_event"
sdf "github.com/BrobridgeOrg/sequential-data-flow"
... |
package keeper
import (
"strconv"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
vestexported "github.com/cosmos/cosmos-sdk/x/auth/vesting/exported"
"github.com/tharsis/evmos/v2/x/claims/types"
)
// EndBlocker checks if the airdrop claiming period has ended
func ... |
/*
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 player is module of functions for generating stubbed players to go into
the matchmaking pool.
Copyright 2018 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.a... |
package main
import (
"flag"
"fmt"
"io/ioutil"
"math"
"math/rand"
"os"
"path/filepath"
"sort"
"strings"
"unicode"
"github.com/bbalet/stopwords"
"github.com/reiver/go-porterstemmer"
)
// A document, which is a file and some info about its words and clustering.
// Also used for clustering -- we repurpose t... |
/*
*
* Copyright 2019 gRPC 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 ©2015 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 testlapack
import (
"log"
"math/rand"
"testing"
"github.com/gonum/blas"
"github.com/gonum/blas/blas64"
"github.com/gonum/floats"
"github.co... |
// Copyright 2015 <NAME>. All rights reserved.
// Use of this source code is governed by the BSD 3-Clause
// license that can be found in the LICENSE file.
// +build !aix,!windows,!solaris
package flock
import (
"os"
"syscall"
)
// Lock is a blocking call to try and take an exclusive file lock. It will wait
// un... |
package main
import (
"bytes"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"errors"
"fmt"
"github.com/cristalhq/jwt/v4"
"io"
"io/ioutil"
"log"
"net"
"net/http"
"nhooyr.io/websocket"
"os"
"strconv"
"strings"
)
var (
pubkeyfile string
pubkey *rsa.PublicKey
verifier *jwt.RSAlg
roles arrayFlag... |
// *** 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 compute
import (
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
type Address struct {
s *pulumi.ResourceState
}
// NewAddress registers a n... |
// Copyright 2021 Optakt Labs OÜ
//
// 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... |
package integration
import (
"bytes"
"context"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
"path/filepath"
"strings"
"time"
"github.com/pkg/errors"
)
func InitContainerdWorker() {
Register(&containerd{
name: "containerd",
containerd: "containerd",
})
// defined in Dockerfile
// e.g. `containerd-1... |
// Copyright (c) 2015 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, ... |
/*
Copyright 2018 OpenEBS 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, softwar... |
package main
import (
"context"
"fmt"
"strings"
"github.com/mattermost/mattermost-server/mlog"
"github.com/mattermost/mattermost-server/plugin"
"github.com/google/go-github/github"
"github.com/mattermost/mattermost-server/model"
)
const COMMAND_HELP = `* |/github connect| - Connect your Mattermost account to... |
// Copyright Istio Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in wri... |
package apiserver
import (
"context"
"fmt"
"golang.org/x/sync/errgroup"
"net/http"
"os"
"os/signal"
"pkg.autotunego.com/pkg/errors"
"pkg.autotunego.com/pkg/grpcsrv"
"pkg.autotunego.com/pkg/httpsrv"
"pkg.autotunego.com/pkg/logging"
"pkg.autotunego.com/pkg/logging/jsonlog"
_ "pkg.autotunego.com/pkg/resmgmt/m... |
// Copyright 2018 The Couchbase 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... |
/*
* Minio Cloud Storage, (C) 2016 Minio, 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 la... |
package backends
import (
"crypto/tls"
"errors"
"fmt"
"time"
"github.com/dchest/passwordreset"
"gopkg.in/mail.v2"
"github.com/liut/staffio/pkg/common"
"github.com/liut/staffio/pkg/models"
"github.com/liut/staffio/pkg/settings"
)
var (
ErrInvalidResetToken = errors.New("invalid reset token or not found")
... |
// Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writi... |
package as3
import (
"encoding/json"
. "github.com/F5Networks/k8s-bigip-ctlr/pkg/resource"
log "github.com/F5Networks/k8s-bigip-ctlr/pkg/vlogger"
)
// cfgMap States
const (
cmInit = iota + 1
cmActive
cmError
cmDeletePending
F5TypeLabel = "f5type"
VSLabel = "virtual-server"
TrueLabel =... |
package exporter
import (
"fmt"
"io"
"log"
"time"
"github.com/algorand/go-algorand-sdk/client/v2/common/models"
"github.com/algorand/go-algorand-sdk/types"
)
type ExportFactory func() Interface
var formats = map[string]ExportFactory{}
func registerFormat(format string, factory ExportFactory) {
formats[forma... |
// 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... |
/*
* Copyright 2018-present Open Networking Foundation
* 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 main
import (
"strings"
"github.com/moxspec/moxspec/cpu"
"github.com/moxspec/moxspec/cpuid"
"github.com/moxspec/moxspec/model"
"github.com/moxspec/moxspec/msr"
"github.com/moxspec/moxspec/smbios"
"github.com/moxspec/moxspec/util"
)
func shapeProcessor(r *model.Report, sm []*smbios.Processor) {
if sm ... |
package mutator
import (
"sort"
"github.com/klokare/evo"
)
// Complexify mutates a genome by adding to its structure
type Complexify struct {
AddNodeProbability float64
AddConnProbability float64
WeightPower float64
MaxWeight float64
BiasPower float64
MaxBias float64
Hidd... |
package main
import (
"bytes"
"flag"
"io/ioutil"
"log"
"os"
"path"
"path/filepath"
"text/template"
"github.com/litmuschaos/litmus-go/contribute/developer-guide/types"
"gopkg.in/yaml.v2"
)
func main() {
attributeFile := flag.String("attributes", "", "metadata to generate chartserviceversion yaml")
genera... |
// Package utf8 implements encoding and decoding of UTF-8 coded numbers.
package utf8
import (
"errors"
"fmt"
"io"
"github.com/coral/flac/internal/ioutilx"
)
const (
tx = 0x80 // 1000 0000
t2 = 0xC0 // 1100 0000
t3 = 0xE0 // 1110 0000
t4 = 0xF0 // 1111 0000
t5 = 0xF8 // 1111 1000
t6 = 0xFC // 1111 1100
t7... |
package camunda_client_go
import (
"bytes"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"strings"
"time"
)
const PackageVersion = "{{version}}"
const DefaultUserAgent = "CamundaClientGo/" + PackageVersion
const DefaultEndpointUrl = "http://localhost:8080/engine-rest"
const DefaultTimeoutSec = ... |
package coords
import (
"math"
"buildblast/server/lib/vmath"
)
type Direction vmath.Vec3
func (d Direction) Vec3() vmath.Vec3 {
return vmath.Vec3(d)
}
// World represents a position in the 3d world.
type World vmath.Vec3
func (wc World) Vec3() vmath.Vec3 {
return vmath.Vec3(wc)
}
func (wc World) Chunk() Chun... |
package main
import (
"encoding/json"
"flag"
"io/ioutil"
"os"
"path/filepath"
"github.com/google/go-containerregistry/pkg/v1"
"github.com/buildpack/packs"
"github.com/buildpack/packs/cf"
"github.com/buildpack/packs/img"
)
var (
dropletPath string
metadataPath string
repoName string
stackName st... |
package database
import (
"context"
"database/sql"
"fmt"
"time"
"github.com/pilinux/gorest/config"
"gorm.io/gorm"
"gorm.io/gorm/logger"
// Import MySQL database driver
// _ "github.com/jinzhu/gorm/dialects/mysql"
"gorm.io/driver/mysql"
// Import PostgreSQL database driver
_ "github.com/jinzhu/gorm/dial... |
// Package zflake implements distributed unique ID generator inspired
// by Twitter's Snowflake.
//
// A zflake ID is composed of
// 1 bit (most significant) reserved
// 38 bits for time in units of 10 msec
// 13 bits for a sequence number
// 12 bits for a generator ID (GID)
//
// Above bit assigment dictate f... |
/*
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... |
package tpl
import (
"t_util"
"sort"
"t_index"
"t_txn/tpl/rd"
"t_txn"
// "fmt"
"t_log"
)
type TPL struct {
index *(t_index.Mmap)
rw_sam chan int // read write concurency count
rw_dur *t_util.Period
}
func NewTPL(mmap_c, rw_sam_len int, rw_wait_e, rw_wait_v float64) *TPL {
index := t_index.NewMmap(mmap_c)... |
package test
import (
"encoding/json"
"fmt"
"io/ioutil"
"math/rand"
"net/http"
"net/http/httptest"
"os"
"strconv"
"strings"
"testing"
"time"
// 3d Party
"context"
pb "github.com/teamlint/baron/cmd/_integration-tests/transport/proto"
httpclient "github.com/teamlint/baron/cmd/_integration-tests/transpor... |
// Copyright 2021 The rndnet 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 (
"fmt"
"math"
"math/bits"
"sort"
"github.com/pointlander/datum/iris"
)
// SharedLayer is a neural network layer with shared wei... |
// Lute - 一款结构化的 Markdown 引擎,支持 Go 和 JavaScript
// Copyright (c) 2019-present, b3log.org
//
// Lute is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THI... |
package main
import (
"fmt"
ecsService "github.com/aliyun/alibaba-cloud-sdk-go/services/ecs"
"github.com/fatih/color"
"sort"
"strings"
"time"
)
const (
TimeLayout = "2006-01-02T15:04:05Z"
)
type MetaStore struct {
*ecsService.Client
InstanceFamilyCache map[string]ecsService.InstanceType
}
// Initialize the... |
package main
import (
"fmt"
)
/* Organization:
(+ (+ 2 3) 5)
+
/ \
+ 5
/ \
2 3
Evaluation:
A necessarily many to one function:
+
2 3
The `+` node fans in 3→1 by consuming its children as arguments as well as itself returning its evaluated self as a single-node tree.
The `2` node fans in, inci... |
/*
Copyright © 2020 <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 agreed to in writing, softw... |
package g3cmd
import (
"bytes"
"errors"
"fmt"
"io"
"log"
"net/http"
"os"
"sort"
"strconv"
"sync"
"time"
"github.com/uc-cdis/gen3-client/gen3-client/logs"
pb "gopkg.in/cheggaaa/pb.v1"
)
var multipartUploadLock sync.Mutex
func retry(attempts int, filePath string, guid string, f func() error) (err error) ... |
package socketio
import (
"errors"
"io"
"net"
"reflect"
"sync"
"github.com/zyxar/socketio/engine"
)
var (
// ErrorNamespaceUnavaialble indicates error of client accessing to a non-existent namespace
ErrorNamespaceUnavaialble = errors.New("namespace unavailable")
)
// Socket is abstraction of bidirectional s... |
package encoder
import (
"encoding/binary"
"fmt"
"log"
"math"
"reflect"
)
type bitReader struct {
Error error
}
func newBitReader() (result *bitReader) {
result = &bitReader{}
return
}
func (r *bitReader) decode(data []byte, t reflect.Type, v reflect.Value) error {
switch v.Kind() {
case reflect.Ptr:
t ... |
package service
import (
"testing"
"github.com/keybase/client/go/engine"
"github.com/keybase/client/go/kbtest"
"github.com/keybase/client/go/libkb"
keybase1 "github.com/keybase/client/go/protocol/keybase1"
"github.com/keybase/client/go/teams"
"github.com/stretchr/testify/require"
"golang.org/x/net/context"
)
... |
package service
import (
cryptoRand "crypto/rand"
"encoding/binary"
"encoding/hex"
"errors"
"log"
mathRand "math/rand"
"regexp"
"strings"
"time"
"github.com/chrisp986/go-stagecoach/pkg/db"
"github.com/chrisp986/go-stagecoach/pkg/model"
"github.com/chrisp986/go-stagecoach/pkg/notification"
)
//When we hav... |
package main
import (
"bytes"
"encoding/json"
"io/ioutil"
"log"
"net/http"
"os"
"path/filepath"
"strconv"
"time"
"github.com/joncrlsn/dque"
"github.com/stratoberry/go-gpsd"
)
const url = "https://ingest.jrcichra.dev"
const database = "public"
const table = "gps"
const TPVInterval = 10
//gps record with h... |
package main
import (
"context"
"flag"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"time"
"github.com/rs/cors"
"github.com/cosmostation/mintscan-binance-dex-backend/mintscan/client"
"github.com/cosmostation/mintscan-binance-dex-backend/mintscan/config"
"github.com/cosmostation/mintscan-binance-dex-backend/mi... |
package notification
import (
"context"
"encoding/json"
"fmt"
"io"
"strconv"
"strings"
"time"
"cloud.google.com/go/pubsub"
"github.com/fsouza/fake-gcs-server/internal/backend"
)
// EventType is the type of event to trigger. The descriptions of the events
// can be found here:
// https://cloud.google.com/sto... |
package gosn
import (
"fmt"
"os"
"testing"
"github.com/spf13/viper"
"github.com/stretchr/testify/require"
)
type MockKeyRingDodgy struct {
}
func (k MockKeyRingDodgy) Set(user, service, password string) error {
return fmt.Errorf("failed to set Session")
}
func (k MockKeyRingDodgy) Get(service, user string) (... |
package main
import (
"context"
"fmt"
"net/http"
"strconv"
"strings"
"time"
"github.com/go-chi/chi/v5"
"github.com/go-chi/chi/v5/middleware"
"github.com/nownabe/plummet/pkg/slack"
"github.com/rs/zerolog/log"
)
type app struct {
symbols []string
slackChannel string
location *time.Location
slack... |
package router
import (
"github.com/celskeggs/hailburst/sim/component"
"github.com/celskeggs/hailburst/sim/fakewire/fwmodel"
"github.com/celskeggs/hailburst/sim/fakewire/packetlink"
"github.com/celskeggs/hailburst/sim/testpoint"
"math/rand"
"testing"
"time"
)
func SubTestRouterN(t *testing.T, numPorts int, has... |
// 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in w... |
package dataflow
import (
"context"
"fmt"
"runtime/debug"
"sync"
"sync/atomic"
"time"
)
// BaseActuator is the actuator interface
type BaseActuator interface {
Exec(tasks ...Task) error
ExecWithContext(ctx context.Context, tasks ...Task) error
}
// TimedActuator is the actuator interface within timeout metho... |
package ping
import (
"context"
"time"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"github.com/volatiletech/sqlboiler/v4/boil"
"github.com/volatiletech/sqlboiler/v4/queries/qm"
"github.com/dennis-tra/nebula-crawler/pkg/config"
"github.com/dennis-tra/nebula-crawler/pkg/db"
"github.com/dennis-tra... |
package broker
import (
"context"
"sync"
"time"
"golang.org/x/sync/errgroup"
"github.com/sandglass/sandglass-grpc/go/sgproto"
"github.com/sandglass/sandglass/sgutils"
"github.com/cenkalti/backoff"
"github.com/sirupsen/logrus"
"github.com/sandglass/sandglass"
)
var (
leaderElectedEvent = "a leader was ele... |
package main
import (
"github.com/i582/cfmt"
"github.com/pixfid/luft/core/parsers"
"github.com/pixfid/luft/core/utils"
"github.com/pixfid/luft/data"
"github.com/pixfid/luft/usbids"
"github.com/umputun/go-flags"
"os"
"time"
)
const (
ver = "v0.3"
url = "https://github.com/pixfid/luft"
)
var opts struct {
M... |
package backup
import (
"context"
"net/http"
"os"
"path/filepath"
"strings"
"time"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/stackrox/rox/pkg/errox"
"github.com/stackrox/rox/pkg/fileutils"
"github.com/stackrox/rox/pkg/httputil"
"github.com/stackrox/rox/pkg/mathutil"
"github.com/stackro... |
package main
import (
"encoding/base64"
"fmt"
"math/rand"
"strings"
"git.mills.io/prologic/go-gopher"
"github.com/google/uuid"
)
type handlers struct {
firstID uuid.UUID
firstIDStr string
flagIDStr string
flagStr string
probs map[uuid.UUID]mathProbLink
cfg Config
}
func (h *handlers) ... |
package main
import (
"fmt"
"log"
"sync"
"time"
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmctl/opentsdb"
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmctl/vm"
"github.com/cheggaaa/pb/v3"
)
type otsdbProcessor struct {
oc *opentsdb.Client
im *vm.Importer
otsdbcc int
}
type queryObj str... |
/*
* Copyright 2020 <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 wr... |
//
//
// File generated from our OpenAPI spec
//
//
package stripe
import (
"bytes"
"encoding/json"
"github.com/stripe/stripe-go/v72/form"
"io"
"mime/multipart"
"net/url"
"path/filepath"
)
// The [purpose](https://stripe.com/docs/file-upload#uploading-a-file) of the uploaded file.
type FilePurpose string
// ... |
// Copyright (C) MongoDB, Inc. 2014-present.
//
// 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
package line
import (
"github.com/mongodb/mongo-... |
package conn
import (
"context"
"fmt"
"io"
"time"
"github.com/find-in-docs/sidecar/pkg/log"
"github.com/find-in-docs/sidecar/pkg/utils"
pb "github.com/find-in-docs/sidecar/protos/v1/messages"
"github.com/nats-io/nats.go"
"github.com/spf13/viper"
"google.golang.org/protobuf/proto"
)
func unsubscribeJS(subs ... |
// Code generated by go-swagger; DO NOT EDIT.
package games
// 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"
... |
package sqlutil
import (
"context"
"fmt"
"sort"
"github.com/jmoiron/sqlx"
"github.com/spf13/cast"
"github.com/oom-ai/oomstore/internal/database/dbutil"
"github.com/oom-ai/oomstore/internal/database/offline"
"github.com/oom-ai/oomstore/pkg/errdefs"
"github.com/oom-ai/oomstore/pkg/oomstore/types"
)
type Quer... |
package main
import (
"fmt"
"github.com/hajimehoshi/ebiten/v2"
"github.com/hajimehoshi/ebiten/v2/ebitenutil"
"github.com/hajimehoshi/ebiten/v2/inpututil"
"image/color"
"log"
"time"
)
const (
screenWidth = 1000
screenHeight = 700
gridSize = 20
)
func getSpeed() [8]float64 {
possibleSpeeds := [8]float6... |
package pkg
import (
"github.com/divoc/api/config"
"github.com/divoc/api/swagger_gen/models"
"github.com/divoc/kernel_library/services"
"github.com/imroc/req"
log "github.com/sirupsen/logrus"
"time"
)
type ProgramsRegistryResponse struct {
EndDate string `json:"endDate"`
Type string `... |
package approve
import (
"context"
"fmt"
"strings"
"github.com/jinzhu/gorm"
"github.com/ngaut/log"
"github.com/pkg/errors"
"github.com/google/go-github/v32/github"
)
type LgtmRecord struct {
Owner string `gorm:"column:owner"`
Repo string `gorm:"column:repo"`
PullNumber int `gorm:"column:pull... |
package tmdb
import (
"fmt"
"strconv"
"strings"
"github.com/shaunschembri/go-tmdb"
"github.com/spf13/viper"
"github.com/shaunschembri/elastictv/pkg/elastictv"
)
const (
maxActors = 10
maxOtherCredits = 5
directorJob = "Director"
producerJob = "Producer"
executiveProducer... |
/*
This file is part of rclgo
Copyright © 2021 Technology Innovation Institute, United Arab Emirates
Licensed under the Apache License, Version 2.0 (the "License");
http://www.apache.org/licenses/LICENSE-2.0
*/
// Code generated by rclgo-gen. DO NOT EDIT.
package std_msgs_msg
import (
"unsafe"
"github.com/tiiua... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.