text stringlengths 3.08k 10.4k |
|---|
package updater
import (
"context"
"errors"
"fmt"
"sort"
"sync"
"time"
"github.com/go-ble/ble"
"github.com/go-ble/ble/linux"
"github.com/sirupsen/logrus"
"github.com/jdoupe/govee-exporter/internal/config"
"github.com/jdoupe/govee-exporter/pkg/govee"
)
var (
updaterTickDuration = 10 * time.Second
)
type ... |
// Copyright (c) 2014 The gomqtt 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 b... |
/*
Copyright 2019 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 Google 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 applicable... |
// Copyright 2018 ETH Zurich
//
// 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... |
/*
* Copyright 2021, Offchain Labs, 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 ag... |
/*
Every tile has six neighbors: east, southeast, southwest, west, northwest, and northeast.
These directions are given in your list, respectively, as e, se, sw, w, nw, and ne.
/\ /\
| | |
/\ /\ /\
| | | | --> x
\/ \/ \/
| | |
\/ \/
\
\
y
Tiles can be addressed usin... |
package agent
import (
"errors"
"fmt"
"github.com/mitre/gocat/output"
"github.com/mitre/gocat/proxy"
)
func (a *Agent) ActivateLocalP2pReceivers() {
for receiverName, p2pReceiver := range proxy.P2pReceiverChannels {
if err := p2pReceiver.InitializeReceiver(&a.server, &a.beaconContact, a.p2pReceiverWaitGroup);... |
// Copyright (c) 2017 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge... |
/*
* Copyright 2018- The Pixie 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... |
// SPDX-License-Identifier: MIT
//
// Copyright (C) 2021 <NAME>. All Rights Reserved.
//
// This source code is licensed under the MIT license found in the
// LICENSE file in the root directory of this source tree or at
// https://spdx.org/licenses/MIT.html
package opaque
import (
"errors"
"fmt"
"github.com/bytem... |
/*
Copyright 2016 <NAME> <www.webx.top>
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 © 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 writ... |
package yajsonschema
import (
"errors"
"io"
"sort"
"strings"
// go-yaml doesn't have custom tag support yet... grabbing random fork.
// see: https://github.com/go-yaml/yaml/issues/191
"github.com/wryun/yaml"
)
const (
optionalSigil = "?"
objectType = "object"
arrayType = "array"
)
// Convert processes e... |
// Copyright ©2016 The go-hep Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package hbook
import "sort"
// indices for the 2D-binning overflows
const (
BngNW int = 1 + iota
BngN
BngNE
BngE
BngSE
BngS
BngSW
BngW
)
type Bi... |
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"strings"
wireguardapi "github.com/jamescun/wg-api"
"github.com/jamescun/wg-api/server"
"github.com/jamescun/wg-api/server/jsonrpc"
flag "github.com/spf13/pflag"
"golang.zx2c4.com/wireguard/wgctrl"
)
const help = `... |
package contract
import (
"encoding/json"
"fmt"
"github.com/xuperchain/xupercore/kv/kvdb"
"github.com/xuperchain/xupercore/ledger"
"github.com/xuperchain/xupercore/pb"
"github.com/xuperchain/xupercore/xmodel"
)
// KernelModuleName is the name of kernel contract
const KernelModuleName = "kernel"
// ConsensusMo... |
// Copyright (c) 2019 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge... |
// +build integration
package controller_test
import (
"context"
"fmt"
"sync"
"testing"
"time"
"github.com/stretchr/testify/assert"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/watch"
"k8s.io/client-go/tools/cache"
"... |
package day8
import (
"bufio"
"fmt"
"log"
"math"
"os"
"path/filepath"
"runtime"
"sort"
"strings"
mapset "github.com/deckarep/golang-set"
)
func parseLine(line string) ([]string, []string) {
var signals []string
var outputs []string
foundDelimiter := false
for _, s := range strings.Fields(line) {
if s... |
// +build unit
package agreementbot
import (
"flag"
"testing"
"time"
)
func init() {
flag.Set("alsologtostderr", "true")
flag.Set("v", "7")
// no need to parse flags, that's done by test framework
}
func Test_PrioritizedWorkQueue_serial(t *testing.T) {
nbc := NewPrioritizedWorkQueue(uint64(100), 2, 10)
if n... |
// Copyright (c) 2017 Uber Technologies, 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 a... |
package clients
import (
"github.com/Kamva/octopus/base"
"github.com/Kamva/octopus/term"
"github.com/Kamva/shark"
"github.com/globalsign/mgo"
"github.com/globalsign/mgo/bson"
)
// MongoDB is a client for the MongoDB
type MongoDB struct {
session base.MongoSession
dbName string
collection base.MongoColl... |
package ircTransport
// IRC transport for papaBot.
import (
"strings"
"time"
"crypto/tls"
"net"
"fmt"
"github.com/pawelszydlo/papa-bot/events"
"github.com/pawelszydlo/papa-bot/utils"
"github.com/pelletier/go-toml"
"github.com/sirupsen/logrus"
"github.com/sorcix/irc"
)
const MsgLengthLimit = 440 // IRC me... |
package gw
import (
"net/http"
"os"
"path"
"strings"
"sync"
"github.com/digitalcircle-com-br/gw/lib/base"
"github.com/digitalcircle-com-br/gw/lib/forward"
confighandler "github.com/digitalcircle-com-br/gw/lib/handlers/config"
exechandler "github.com/digitalcircle-com-br/gw/lib/handlers/exec"
execphandler "g... |
// Copyright 2013-2018 <NAME> (<EMAIL>).
// Copyright 2013-2018 Kosh (<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
//
// Unle... |
package storage
import (
"context"
"errors"
"math"
"strings"
"github.com/gogo/protobuf/types"
"github.com/ivopetiz/influxdb/logger"
"github.com/ivopetiz/influxdb/pkg/metrics"
"github.com/ivopetiz/influxdb/tsdb/engine/tsm1"
"github.com/opentracing/opentracing-go"
"github.com/opentracing/opentracing-go/ext"
... |
// Copyright 2020 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 ... |
package kubeletmetrics
import (
"context"
"fmt"
"time"
"github.com/signalfx/golib/v3/datapoint"
"github.com/signalfx/golib/v3/sfxclient"
"github.com/signalfx/signalfx-agent/pkg/core/common/kubelet"
"github.com/signalfx/signalfx-agent/pkg/core/config"
"github.com/signalfx/signalfx-agent/pkg/monitors"
"github.... |
package main
import (
"fmt"
"log"
"net/http"
"sort"
"strconv"
"strings"
"math"
)
// Constants with html code for our web page
const (
pageTop = `
<!DOCTYPE html>
<html lang="en">
<head>
<title>Statistics</title>
<meta charset="utf-8">
... |
package parser
import (
"fmt"
"go/ast"
"os"
"os/user"
"path/filepath"
. "github.com/flydevtools/goas/openApi3Schema"
log "github.com/sirupsen/logrus"
)
type parser struct {
ModulePath string
ModuleName string
MainFilePath string
HandlerPath string
GoModFilePath string
GoModCachePath string... |
package cat
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 (
kittyBirthday = nook.Birthday{
Day: 15,
Month: ... |
// Copyright 2016 Keybase Inc. All rights reserved.
// Use of this source code is governed by a BSD
// license that can be found in the LICENSE file.
package libdokan
import (
"strings"
"time"
"github.com/keybase/kbfs/dokan"
"github.com/keybase/kbfs/kbfsmd"
"github.com/keybase/kbfs/libkbfs"
"golang.org/x/net/c... |
package waves
import (
"bytes"
"encoding/json"
"github.com/trustwallet/blockatlas"
"github.com/trustwallet/blockatlas/coin"
"testing"
)
const transferV1 = `
{
"type":4,
"id":"7QoQc9qMUBCfY4QV35mgBsT8eTXybvGkM2HTumtAvBUL",
"sender":"<KEY>",
"senderPublicKey":"<KEY>",
"fee":100000,
"timestamp":1561048131740,... |
/*
Copyright 2019 Kohl's Department Stores, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writi... |
// +build disabled
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package revoked
import (
"strings"
"testing"
"github.com/hyperledger/fabric-sdk-go/pkg/common/errors/retry"
"github.com/hyperledger/fabric-sdk-go/pkg/common/errors/status"
contextAPI "github... |
// Copyright 2020 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 writi... |
// Copyright (c) 2013 Couchbase, Inc.
package common
import "fmt"
import "math/rand"
import "github.com/prataprc/goparsec"
var _ = fmt.Sprintf("dummy")
// Scope of production grammar, a scope can be evaluated to
// generate permutations and combinations. For the first
// time after compiling the production grammar... |
/*
Copyright 2017 <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 writing, software
distribu... |
package main
import (
"crypto/tls"
"crypto/x509"
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"os/exec"
"reflect"
"strings"
"github.com/spf13/cobra"
)
var config = &Config{}
var versionString = "unknown"
var versionCommit = ""
// Config represents config of the updater
typ... |
package digitalocean
import (
"flag"
"fmt"
"net/url"
"strings"
"time"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/logger"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/promauth"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/promscrape/discoveryutils"
"github.com/VictoriaMetrics/VictoriaMetrics/lib/pr... |
package initutil
import (
"context"
"fmt"
"sync"
"time"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
datastore "github.com/ipfs/go-datastore"
"github.com/ipfs/go-ipfs/core"
pubsub "github.com/libp2p/go-libp2p-pubsub"
"github.com/oklog/run"
"github.com/prometheus/client_golang/prometheus"
"github.com/sh... |
package main
import (
"bytes"
"context"
"flag"
"image"
"io"
"io/ioutil"
"log"
"net/http"
"os"
"os/signal"
"path"
"strconv"
"strings"
"time"
"image/draw"
"image/jpeg"
_ "image/jpeg"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
)
va... |
package ui
import (
"fmt"
"os"
"os/exec"
"strings"
"emperror.dev/errors"
tea "github.com/charmbracelet/bubbletea"
"github.com/gdamore/tcell/v2"
"github.com/kballard/go-shellquote"
"github.com/phuslu/log"
"github.com/rivo/tview"
"github.com/spf13/afero"
"github.com/lemoony/snipkit/internal/model"
"github... |
package handlers
import (
"bytes"
"encoding/json"
"errors"
"html/template"
"io/ioutil"
"log"
"net/http"
"os/exec"
"sort"
"strconv"
"strings"
"sync"
"time"
"google.golang.org/api/cloudmonitoring/v2beta2"
"github.com/VantageSports/common/constants/privileges"
"github.com/VantageSports/lolvideo/coordina... |
package aoe
import (
"io"
"net"
)
const (
// macMaskArgLen specifies the minimum required length for a MACMaskArg.
//
// 1 byte : reserved
// 1 byte : MAC mask command
// 1 byte : MAC mask error
// 1 byte : directive count
// 8*N bytes: directives
macMaskArgLen = 1 + 1 + 1 + 1
// directiveLen spec... |
package main
import (
"fmt"
"github.com/kiteco/kiteco/kite-go/lang/python/pythonast"
"github.com/kiteco/kiteco/kite-go/lang/python/pythongraph/traindata"
"github.com/kiteco/kiteco/kite-go/lang/python/pythonpipeline"
"github.com/kiteco/kiteco/kite-go/lang/python/pythonresource"
"github.com/kiteco/kiteco/kite-go/l... |
package api
import (
casbinmw "ditto/booking/casbin"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
)
//RegisterRoutes -
func (s *Service) RegisterRoutes(e *echo.Echo, prefix string) {
config := middleware.JWTConfig{
SigningKey: s._rsa.GetPublicKey(),
SigningMethod: "RS512",
Toke... |
/**
Plik upload server
The MIT License (MIT)
Copyright (c) <2015> Copyright holders list can be found in AUTHORS file
- <NAME> <<EMAIL>>
- <NAME> <<EMAIL>>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal... |
package http
import (
"bytes"
"context"
"crypto/tls"
"crypto/x509"
"errors"
"fmt"
"net"
"net/http"
"strconv"
"time"
"github.com/valyala/bytebufferpool"
"github.com/why444216978/gin-api/client/codec"
loggerRPC "github.com/why444216978/gin-api/library/logger/rpc"
"github.com/why444216978/gin-api/library/... |
package transactions
import (
"bytes"
"encoding/binary"
"encoding/hex"
"errors"
"fmt"
"strconv"
"strings"
)
func FromASM(asmIn string, version uint8) ([]byte, error) {
lookUpOp := ASM_TO_OPCODES["CHAIN_NAME_LOOKUP"]
var byteCodeHeader []byte
var ok bool
if byteCodeHeader, ok = BYTECODE_VERSION[version]; !o... |
// *** 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 cur
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to get information on an AWS Co... |
package gnf
/*
Copyright 2019 NFSB Research Team & Developers
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 a... |
/*
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 writing, software
dist... |
package client
import (
"github.com/carwow/terraform-provider-hirefire/ptr"
"github.com/carwow/terraform-provider-hirefire/testing/assert"
"net/http"
"net/http/httptest"
"testing"
)
func TestGetManager(t *testing.T) {
server := httptest.NewServer(http.HandlerFunc(func(rw http.ResponseWriter, req *http.Request) ... |
package netio
import (
"context"
"runtime"
"strings"
"time"
"github.com/shirou/gopsutil/net"
"github.com/signalfx/golib/datapoint"
"github.com/signalfx/signalfx-agent/internal/core/config"
"github.com/signalfx/signalfx-agent/internal/monitors"
"github.com/signalfx/signalfx-agent/internal/monitors/types"
"gi... |
/*
Copyright 2020 The 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, soft... |
// Copyright (c) Mainflux
// SPDX-License-Identifier: Apache-2.0
package cassandra
import (
"encoding/json"
"fmt"
"github.com/gocql/gocql"
"github.com/mainflux/mainflux/pkg/errors"
"github.com/mainflux/mainflux/pkg/transformers/senml"
"github.com/mainflux/mainflux/readers"
)
var errReadMessages = errors.New("... |
// Package puzzles declares common interface for puzzle solutions and functionality for register and run them.
package puzzles
import (
"bytes"
"errors"
"fmt"
"io"
"sort"
"sync"
"testing"
)
// Solver represents solutions for puzzles methods.
type Solver interface {
Part1(input io.Reader) (string, error)
Part... |
package etcd
import (
"context"
"fmt"
"sort"
"strconv"
"time"
"github.com/leechanx/ekko-idgenerator/config"
errors "github.com/leechanx/ekko-idgenerator/ekko_errors"
"github.com/leechanx/ekko-idgenerator/util"
"github.com/smallnest/rpcx/log"
clientv3 "go.etcd.io/etcd/client/v3"
)
type EtcdCoordinator str... |
package utils
import (
"context"
"encoding/base64"
"encoding/json"
"fmt"
"net/http"
"reflect"
"strings"
"github.com/google/uuid"
"github.com/volatiletech/sqlboiler/queries/qm"
"github.com/graphql-go/graphql"
"github.com/graphql-go/graphql/language/ast"
"github.com/graphql-go/relay"
"github.com/lithammer... |
package main
import (
"bufio"
"errors"
"fmt"
"os"
"path/filepath"
"reflect"
"github.com/ethereum/go-ethereum/cmd/utils"
"github.com/ethereum/go-ethereum/log"
"github.com/ethereum/go-ethereum/node"
"github.com/ethereum/go-ethereum/params"
"github.com/naoina/toml"
"gopkg.in/urfave/cli.v1"
"github.com/Fant... |
package dbhandler
import (
"errors"
"net"
"regexp"
"strings"
ezn "github.com/darkwyrm/goeznacl"
"github.com/darkwyrm/sra/server/base"
)
type NetworkAdapterInfo struct {
AdapterID base.UID
Name string
Type string
DHCP bool
MAC string
IPv4 string
Subnet string
Gateway strin... |
package jwks
import (
"crypto"
"crypto/ecdsa"
"crypto/elliptic"
"crypto/rsa"
"crypto/x509"
"encoding/base64"
"encoding/json"
"os"
"github.com/pkg/errors"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
jose "gopkg.in/square/go-jose.v2"
"k8s.io/client-go/util/keyutil"
)
type jwksCmd struct {
p... |
/* calc TEST */
// tests functionality of simple calculator
package main
import (
"fmt"
"strconv"
"calc/lexer"
"calc/parser"
"calc/parser/bsr"
)
/* MATCHING TESTS
* tests include variations of whitespace to check
* that it is functioning properly
*/
// should match
const single_num = `1` // passe... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package route53
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/route53/types"
smithy "github.com/awslabs/smithy-go"
"github.com/awslabs/smithy-go... |
// +build linux
// Copyright 2016-2019 DutchSec (https://dutchsec.com/)
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless requ... |
package tests
import (
"database/sql"
stderrors "errors"
"fmt"
"os"
"runtime"
"strings"
"testing"
"github.com/ShoshinNikita/go-errors"
pkgerrors "github.com/pkg/errors"
"github.com/stretchr/testify/require"
)
const modulePath = "github.com/ShoshinNikita/go-errors/tests"
var (
ErrGlobal = errors.New("glob... |
// ahocorasick.go: implementation of the Aho-Corasick string matching
// algorithm. Actually implemented as matching against []byte rather
// than the Go string type. Throughout this code []byte is referred to
// as a blice.
//
// http://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_string_matching_algorithm
//
// Copyrig... |
package cli
// Copyright (c) 2018 Bhojpur Consulting Private Limited, India. All rights reserved.
// 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 l... |
// Package fritzboxmetrics provides metrics fro the UPnP and Tr64 interface
package fritzboxmetrics
// Copyright 2016 <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
//
// htt... |
// Copyright 2020 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 ... |
// Copyright 2020-2021 Buf Technologies, 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... |
package protocol
import (
"context"
"encoding/hex"
"sync/atomic"
"time"
"i10r.io/crypto/ed25519"
"i10r.io/errors"
"i10r.io/log"
"i10r.io/protocol/bc"
"i10r.io/protocol/patricia"
"i10r.io/protocol/state"
)
var (
// ErrBadContractsRoot is returned when the computed contracts merkle root
// disagrees with t... |
// Package publisher contains a NATS publisher implementation build around
// the lower level NATS code.
package publisher
import (
"errors"
"expvar"
"fmt"
"sync"
"time"
"github.com/Nitro/lagermeister/message"
"github.com/nats-io/go-nats-streaming"
log "github.com/sirupsen/logrus"
)
var (
publishRetries = [... |
// Copyright (c) 2022 Zededa, Inc.
// SPDX-License-Identifier: Apache-2.0
package conntester
import (
"crypto/tls"
"errors"
"fmt"
"io/ioutil"
"strings"
"time"
"github.com/lf-edge/eve/pkg/pillar/base"
"github.com/lf-edge/eve/pkg/pillar/devicenetwork"
"github.com/lf-edge/eve/pkg/pillar/hardware"
"github.com/... |
package lexer
import (
"bufio"
"bytes"
"io"
"strings"
"github.com/lfkeitel/spartan/config/token"
)
type Lexer struct {
input *bufio.Reader
curCh byte // current char under examination
peekCh byte // peek character
line int // line in source file
column int // column in current line
}
func New(reader... |
package transform
import (
"github.com/kiteco/kiteco/kite-golib/pipeline"
)
// OneInOneOutFn maps a single input sample to a single output sample.
type OneInOneOutFn func(pipeline.Sample) pipeline.Sample
// WrapOneInOneOutFnKeyed wraps a OneInOneOutFn in a pipeline.Keyed
func WrapOneInOneOutFnKeyed(f OneInOneOutFn)... |
package webhook_helper
import (
"bytes"
"encoding/base64"
"encoding/json"
"fmt"
"math/rand"
"net/http"
"time"
log "github.com/sirupsen/logrus"
id_helper "github.com/nayotta/metathings/pkg/common/id"
opt_helper "github.com/nayotta/metathings/pkg/common/option"
passwd_helper "github.com/nayotta/metathings/p... |
package main
import (
"github.com/EndlessCheng/mahjong-helper/util"
"fmt"
"strings"
"github.com/fatih/color"
)
func _printIncShantenResults14(shanten int, results14, incShantenResults14 util.WaitsWithImproves14List) {
if len(incShantenResults14) == 0 {
return
}
if len(results14) > 0 {
bestWaitsCount := re... |
// 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 ... |
// Copyright 2017 Canonical Ltd.
// Licensed under the AGPLv3, see LICENCE file for details.
package proxy
import (
"net"
"net/http"
"net/url"
"strings"
"sync"
"github.com/juju/errors"
proxyutils "github.com/juju/proxy"
)
// ProxyConfig stores the proxy settings that should be used for web
// requests made f... |
// Copyright 2016 The Upspin 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
// This file contains the implementation of the keygen command.
import (
"encoding/binary"
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"path/f... |
package repositories
import (
"testing"
"time"
"github.com/escoteirando/mappa-proxy/backend/types"
"github.com/escoteirando/mappa-proxy/backend/domain/responses"
"gorm.io/gorm"
)
func TestDBRepository_IsValidConnectionString(t *testing.T) {
type fields struct {
BaseRepository BaseRepository
schema ... |
// Copyright (c) 2015, <NAME>. All rights reserved.
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.
package rocksdb
/*
#include "backupableDB.h"
*/
import "C"
import (
"runtime"
)
// Wrap go BackupableDBOptions
type BackupableDBOp... |
/*
Copyright The Kubernetes Authors.
Copyright 2020 Authors of Arktos - file modified.
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 require... |
package main
import (
"errors"
"fmt"
"io/ioutil"
"reflect"
"strings"
)
func genFieldsNew(replaceFieldName string, tpl *Template, fields []FieldDef) string {
var strReplaced []string
for _, f := range fields {
tplType, ok := tpl.Typemap[f.fieldType]
if !ok {
tplType, ok = tpl.Typemap["struct"]
if !ok ... |
// Copyright © 2018 <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribu... |
package main
//go:generate go-bindata ../../templates/...
import (
"fmt"
"html/template"
"log"
"net/http"
"os"
"time"
"github.com/jonfriesen/simple-sso/pkg/providers/memory"
"github.com/gorilla/handlers"
"github.com/gorilla/mux"
weblog "github.com/samitpal/goProbe/log"
"github.com/jonfriesen/simple-sso/... |
// Copyright 2014 The fader 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 i... |
/*
* Copyright 2018 The Service Manager 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 requir... |
package main
import (
"bufio"
"dblogin"
"fmt"
"gopkg.in/mgo.v2"
"gopkg.in/mgo.v2/bson"
"io"
"os"
"strconv"
"strings"
"time"
)
var (
start = time.Now()
// Session for DB
Session, _ = mgo.Dial(dblogin.Bookstore) // mongodb://username:yourpasscode@serverip:27017/database?authSource=admin
// Database for ... |
package presto
import (
"encoding/json"
"testing"
"golang.org/x/net/context"
)
var h *Handler
var defaultSchema *string
func init() {
h = NewHandler(".testdata")
s := "myexcels"
defaultSchema = &s
}
func TestListSchemaNames(t *testing.T) {
sn, err := h.PrestoListSchemaNames(context.Background())
if err != ... |
package svg
import (
"fmt"
"math"
customMath "github.com/knightjdr/cmgo/pkg/math"
"github.com/knightjdr/cmgo/pkg/slice"
)
// Define bidirectional color scales
var twoColor = []string{"blueYellow", "blueRed"}
// biDirection creates a two color hex gradient. The starting color is set using the
// hue and the firs... |
/*
Copyright 2017 The Elasticshift Authors.
*/
package dispatch
import (
"bytes"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strings"
"github.com/sirupsen/logrus"
)
// Methods
const (
GET = "GET"
POST = "POST"
PUT = "PUT"
)
// Content type
const (
JSON = ... |
package broker
import (
"context"
"os"
"time"
"cloud.google.com/go/pubsub"
"github.com/google/uuid"
"github.com/rs/zerolog/log"
"google.golang.org/api/option"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
type pubsubBroker struct {
client *pubsub.Client
options Options
subs []*subs... |
package archive
import (
"archive/tar"
"bytes"
"compress/gzip"
"encoding/base64"
"encoding/json"
"io"
"io/ioutil"
"os"
"path"
"strings"
"time"
"github.com/determined-ai/determined/master/pkg"
)
type (
// Archive contains an ordered list of Item objects, much like a tarball.
Archive []Item
)
var defaul... |
package memcache
import (
"fmt"
"time"
log "github.com/cihub/seelog"
"github.com/hailo-platform/H2O/service/config"
"github.com/hailo-platform/H2O/service/dns"
inst "github.com/hailo-platform/H2O/service/instrumentation"
"github.com/hailo-platform/H2O/gomemcache/memcache"
)
const (
// The default timeout us... |
package state
import (
"context"
"fmt"
"github.com/keboola/keboola-as-code/internal/pkg/filesystem"
"github.com/keboola/keboola-as-code/internal/pkg/filesystem/knownpaths"
"github.com/keboola/keboola-as-code/internal/pkg/local"
"github.com/keboola/keboola-as-code/internal/pkg/log"
"github.com/keboola/keboola-a... |
package molecule
import (
"fmt"
"math"
"reflect"
"unsafe"
"github.com/richardartoul/molecule/src/codec"
)
// Value represents a protobuf value. It contains the original wiretype that the value
// was encoded with as well as a variety of helper methods for interpreting the raw
// value based on the field's actua... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.