text stringlengths 3.08k 10.4k |
|---|
package peek
import (
"reflect"
"math/big"
"github.com/zclconf/go-cty/cty"
"github.com/zclconf/go-cty/cty/set"
"github.com/zclconf/go-cty/cty/gocty"
"fmt"
)
type StructPath struct {
Path cty.Path
FieldNames []string
}
type TypeTransformer func(typ Type, path []Val) (newTyp Type, continueWalk bool)
func Tra... |
// Copyright 2018 HouseCanary, 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... |
/*
* 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 writ... |
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/http/httputil"
"net/url"
"os"
"strconv"
"strings"
)
var backendUrl string = os.Getenv("BACKEND_URL")
var grafanaUrl string = os.Getenv("GRAFANA_URL")
func main() {
url, _ := url.Parse(backendUrl)
proxy := httputil.NewS... |
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20210901
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type Extension struct {
pulumi.CustomRe... |
package reactor
import (
"encoding/json"
"io"
"net/http"
"net/url"
"strconv"
"strings"
"github.com/unknowntpo/todos/internal/domain/errors"
"github.com/unknowntpo/todos/pkg/validator"
"github.com/julienschmidt/httprouter"
)
func (rc *Reactor) WriteJSON(w http.ResponseWriter, status int, data interface{}) e... |
package ice
const (
SP = " "
NL = "\n"
)
const ( // MOD
MOD_SP = " "
MOD_NL = "\n"
MOD_DIR = 0750
MOD_FILE = 0640
MOD_CHAN = 16
MOD_TICK = "1s"
MOD_BUFS = 4096
MOD_DATE = "2006-01-02"
MOD_TIME = "2006-01-02 15:04:05"
)
const ( // REPOS
VOLCANOS = "volcanos"
ICEBERGS = "icebergs"
INTSHELL = "intshe... |
/*
Copyright 2019 Cloudera, 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 law or agreed to... |
package transforms
import (
"crypto/tls"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"time"
"github.com/dghubble/sling"
"github.com/edgexfoundry/app-functions-sdk-go/appsdk"
sdkTransforms "github.com/edgexfoundry/app-functions-sdk-go/pkg/transforms"
"github.com/edgexfoundry/go-mod-core-contracts/... |
/*
Copyright (C) 2018 Synopsys, Inc.
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"... |
package ethnode
import (
"bytes"
"context"
"encoding/json"
"fmt"
"strings"
)
var _ EthNode = &parityNode{}
type parityClient struct {
CanHandleLargeRequests bool `json:"can_handle_large_requests"`
Compiler string `json:"compiler"`
Identity string `json:"identity"`
Name ... |
package fetcher
import (
"errors"
"math/big"
"sync/atomic"
"testing"
"time"
"github.com/ethereum/go-ethereum/common"
"github.com/ethereum/go-ethereum/core/types"
"github.com/stretchr/testify/require"
"github.com/Fantom-foundation/lachesis-ex/eventcheck/heavycheck"
"github.com/Fantom-foundation/lachesis-ex/... |
/*
Copyright 2019 NexClipper.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distri... |
// Copyright 2018 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License... |
// Go SDK for the KUSANAGI(tm) framework (http://kusanagi.io)
// Copyright (c) 2016-2021 <NAME>. All rights reserved.
//
// Distributed under the MIT license.
//
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
package kusanagi
import (
"e... |
// Copyright 2016 Amazon.com, Inc. or its affiliates. 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. A copy of the
// License is located at
//
// http://aws.amazon.com/apache2.0/
//
// or in the "license" fil... |
// Copyright (C) The Arvados Authors. All rights reserved.
//
// SPDX-License-Identifier: AGPL-3.0
package main
import (
"crypto/rand"
"errors"
"fmt"
"io"
prand "math/rand"
"os"
"path"
"strings"
"sync/atomic"
"time"
"git.arvados.org/arvados.git/sdk/go/arvados"
"golang.org/x/net/context"
"golang.org/x/n... |
package twitterscraper
import (
"fmt"
"net/http"
"regexp"
"strconv"
"strings"
"time"
"github.com/PuerkitoBio/goquery"
)
const ajaxURL = "https://twitter.com/i/profiles/show/%s/timeline/tweets"
// Video type
type Video struct {
ID string
Preview string
}
// Tweet type
type Tweet struct {
Hashtags ... |
// © Copyright IBM Corporation 2020. 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 ap... |
package polygen
import (
"bytes"
"encoding/gob"
"fmt"
"image"
"io/ioutil"
"log"
"os"
"sort"
"time"
)
// Evolver uses a genetic algorithm to evolve a set of polygons to approximate an image.
type Evolver struct {
refImgRGBA *image.RGBA
dstImgFile string
checkPointFile string... |
package launcher
import (
"fmt"
"log"
"os"
"os/exec"
"os/signal"
"path/filepath"
"strings"
"syscall"
"time"
"github.com/otiai10/copy"
"github.com/screepers/screeps-launcher/v1/install"
// "path/filepath"
// "strings"
)
// Launcher manages server
type Launcher struct {
config *Config
needsInit bool
... |
package main
import (
"flag"
"fmt"
"image"
"image/color"
"image/png"
"math"
"math/cmplx"
"os"
"sync"
"github.com/krasoffski/gomill/htcmap"
)
const (
xmin, ymin = -2.2, -1.2
xmax, ymax = +1.2, +1.2
)
type point struct {
x, y int
}
type pixel struct {
point
c color.Color
}
func xCord(x, width, factor... |
package tools
import (
"bytes"
"crypto/md5"
cr "crypto/rand"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"math"
"math/big"
"math/rand"
"mime/multipart"
"net/http"
"net/url"
"os"
"path/filepath"
"reflect"
"sort"
"strconv"
"strings"
"time"
)
//随机数种子
var Rnd = rand.New(rand.NewS... |
// Package pgtypes contains generated code for schema 'public'.
package pgtypes
// Code generated by xo. DO NOT EDIT.
import (
"context"
"database/sql"
"database/sql/driver"
"encoding/csv"
"fmt"
"io"
"regexp"
"strings"
)
var (
// logf is used by generated code to log SQL queries.
logf = func(string, ...int... |
// Copyright 2020 Contributors to the Veraison project.
// SPDX-License-Identifier: Apache-2.0
package swid
import (
"encoding/json"
"encoding/xml"
"strings"
)
// Roles models the role type
type Roles struct {
val []interface{}
}
/*
entity-entry = {
...
role => $role / [ 2* $role ],
...
}
... |
package filter
import (
"bufio"
"fmt"
"io/fs"
"io/ioutil"
"net/http"
"os"
"path/filepath"
"strings"
"sync"
"github.com/monochromegane/go-gitignore"
"github.com/sahilm/fuzzy"
"github.com/tjmtmmnk/ilse/util"
)
func newFuzzySearch(option *SearchOption) *fuzzySearch {
fuzzy := &fuzzySearch{}
gitIgnorePath... |
/*
* The Plaid API
*
* The Plaid REST API. Please see https://plaid.com/docs/api for more details.
*
* API version: 2020-09-14_1.44.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package plaid
import (
"encoding/json"
)
// Taxform struct for Taxform
type Taxform st... |
package model_helpers
import (
"encoding/json"
"time"
"github.com/cloudfoundry-incubator/bbs/models"
. "github.com/onsi/gomega"
)
func NewValidActualLRP(guid string, index int32) *models.ActualLRP {
actualLRP := &models.ActualLRP{
ActualLRPKey: models.NewActualLRPKey(guid, index, "some-domain"),
Act... |
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
package userentity
import (
"encoding/json"
"errors"
"fmt"
"time"
"github.com/mattermost/mattermost-load-test-ng/loadtest/store/memstore"
"github.com/mattermost/mattermost-load-test-ng/loadtest/user/... |
package main
import (
"fmt"
"io"
"math/rand"
"os"
"strconv"
"strings"
"sync"
"time"
"cloud.google.com/go/storage"
_ "github.com/gliderlabs/logspout/adapters/syslog"
"github.com/gliderlabs/logspout/router"
_ "github.com/gliderlabs/logspout/transports/tcp"
_ "github.com/gliderlabs/logspout/transports/tls"... |
package controllers
import (
"context"
"log"
"net/http"
"os"
"os/user"
"strconv"
"github.com/go-chi/chi/v5"
"github.com/go-chi/render"
"github.com/imgabe/todo/pkg/errors"
"github.com/imgabe/todo/pkg/models"
"github.com/imgabe/todo/pkg/store"
"github.com/jmoiron/sqlx"
_ "github.com/mattn/go-sqlite3"
)
//... |
package pipeline
import (
"context"
"fmt"
"github.com/gorilla/mux"
"github.com/iancoleman/strcase"
"github.com/prometheus/client_golang/prometheus"
"github.com/sirupsen/logrus"
"github.com/seznam/slo-exporter/pkg/config"
"strings"
"time"
)
var (
eventProcessingDurationSeconds = prometheus.NewHistogramVec(
... |
package main
import (
"io/ioutil"
"log"
"fmt"
"os/exec"
"strings"
"strconv"
"os"
"runtime"
"time"
"syscall"
)
func main(){
DiffTestCheckConfigs()
index := 0
lastTime := int64(CreateTimeLimit)
for _,dir := range checkDirs {
files, _ := ioutil.ReadDir(dir)
for _,file := range files {
if(!file.IsD... |
package lib
import (
"fmt"
"log"
"os"
"os/user"
"runtime"
)
const (
hashiURL = "https://releases.hashicorp.com/terraform/"
installFile = "terraform"
installVersion = "terraform_"
installPath = "/.terraform.versions/"
recentFile = "RECENT"
)
var (
installLocation = "/tmp"
)
// initialize :... |
package service
import (
"context"
"errors"
"net/url"
"strings"
"github.com/fabric8-services/fabric8-auth/rest"
"github.com/fabric8-services/fabric8-auth/application/service"
"github.com/fabric8-services/fabric8-auth/application/service/base"
servicecontext "github.com/fabric8-services/fabric8-auth/applicati... |
/*
* Copyright (c) 2018 QLC Chain Team
*
* This software is released under the MIT License.
* https://opensource.org/licenses/MIT
*/
// Package common contains various helper functions.
package util
import (
"bytes"
"encoding/binary"
"encoding/gob"
"encoding/hex"
"math"
)
// FromHex returns the bytes repre... |
// Copyright 2015 The Vanadium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package servicetest
import (
"bytes"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"testing"
"v.io/v23"
"v.io/v23/context"
"v.io/v23/options"
"v.io/x... |
package engine
import (
"github.com/keybase/client/go/libkb"
"github.com/keybase/client/go/protocol/keybase1"
)
type LoginOffline struct {
libkb.Contextified
}
func NewLoginOffline(g *libkb.GlobalContext) *LoginOffline {
return &LoginOffline{
Contextified: libkb.NewContextified(g),
}
}
// Name is the unique ... |
// 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 server
import (
"log"
"regexp"
"strconv"
"strings"
)
type BloodMoon struct {
Frequency int `json:"frequency"`
Last *GameTime `json:"last"`
Next *GameTime `json:"next"`
Countdown *GameTime `json:"countdown"`
}
// World is a thing
type World struct {
Players []*Player `json... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: proto/simple.proto
package simplepb
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 ... |
package wal
import (
"bufio"
"context"
"encoding/binary"
log "github.com/sirupsen/logrus"
"os"
"time"
)
type Reader struct {
Tag string
segmentPtr
wal *Wal
// Temporary buffers
header []byte
body []byte
reader *bufio.Reader
}
func (wal *Wal) NewReader(tag string, offset Offset) (r *Reader, err erro... |
package websocket
import (
"bytes"
"crypto/sha1"
"encoding/base64"
"fmt"
"github.com/valyala/fasthttp"
"log"
"net"
"strings"
)
var (
globalUID = []byte("258EAFA5-E914-47DA-95CA-C5AB0DC85B11")
strUpgrade = []byte("Upgrade")
strConnection = []byte("Connection")
strstr... |
// Copyright 2018 Drone.IO 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 ... |
package manager
import (
"context"
"sync/atomic"
"time"
v1 "github.com/stackrox/rox/generated/api/v1"
"github.com/stackrox/rox/generated/internalapi/sensor"
"github.com/stackrox/rox/generated/storage"
"github.com/stackrox/rox/pkg/images/types"
"github.com/stackrox/rox/pkg/protoconv/resources"
"github.com/sta... |
package kalman
import (
"fmt"
"testing"
"github.com/konimarti/lti"
"gonum.org/v1/gonum/mat"
)
// Testing based on example on page 145 in book "Kalman Filter" by <NAME>, 2017
//newContext
func newContext() *Context {
// define current context
ctx := Context{
X: mat.NewVecDense(4, []float64{976.32452, 0, 0.09... |
package internal
// Node for the query structure. The query structure allows us to navigate the
// trapezoid set efficiently, and can be built in O(nlog(n)) time. (TODO: There
// is a preprocessing loop you can use to get this to O(nlog*n) time. Implement
// this once tests are passing).
//
// This algorithm has been ... |
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package startcmd
import (
"crypto/tls"
"net/http"
"strconv"
"strings"
"github.com/gorilla/mux"
"github.com/spf13/cobra"
cmdutils "github.com/trustbloc/edge-core/pkg/utils/cmd"
tlsutils "github.com/trustbloc/... |
// Copyright 2022 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package controllers
import (
"context"
"github.com/go-logr/logr"
corev1 "k8s.io/api/core/v1"
k8serror "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/types"
cl... |
// Copyright © 2020 wego 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 ... |
// Copyright (c) 2019 Cisco and/or its affiliates.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicabl... |
package main
import (
"fmt"
"github.com/DomBlack/advent-of-code-2018/lib/elf_code"
"github.com/DomBlack/advent-of-code-2018/lib"
"log"
"reflect"
"strings"
)
func main() {
input := lib.InputAsStrings("day-16")
samples, program := parseInput(input)
fmt.Println("Part 1", part1(samples))
fmt.Println("Part 2", ... |
// Copyright 2016 The lime Authors.
// Use of this source code is governed by a 2-clause
// BSD-style license that can be found in the LICENSE file.
package backend
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"path/filepath"
"strings"
"github.com/limetext/backend/log"
"github.com/limetext/text"
)
typ... |
package orb
import (
"context"
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"regexp"
"strings"
"gopkg.in/yaml.v3"
"github.com/caos/orbos/internal/helpers"
"github.com/caos/orbos/internal/ssh"
"github.com/caos/orbos/internal/stores/github"
"github.com/caos/orbos/mntr"
"github.com/caos/orbos/pkg/git"
... |
package sdp
import (
"bufio"
"strconv"
"strings"
"github.com/pkg/errors"
)
type attributeStatus struct {
seen bool
value string
allowMultiple bool
}
// Detect if the current attribute is ok to be read (detect out of order errors)
// or if it has already been set
func attributeValid(statuses ... |
// 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 agreed to i... |
// Copyright 2021 Chaos Mesh Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to... |
package main
import (
"bytes"
"context"
_ "embed"
"encoding/json"
"fmt"
"github.com/getkin/kin-openapi/openapi3"
"github.com/getkin/kin-openapi/openapi3filter"
openapi3_routers "github.com/getkin/kin-openapi/routers"
openapi3_legacy "github.com/getkin/kin-openapi/routers/legacy"
"github.com/stretchr/testify/... |
package code
// package code implements the bytecode instruction set for our virtual
// machine that will execute monkey-lan source code.
import (
"bytes"
"encoding/binary"
"fmt"
)
type Definition struct {
Name string
OperandWidths []int
}
type Instructions []byte
func (ins Instructions) String() str... |
// Code generated by the Pulumi SDK Generator DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package appintegrations
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Resource Type definition for AWS::Ap... |
// +build windows
/*
Copyright 2016 Google Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writi... |
// Copyright 2016 <NAME>, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in... |
package automate
import (
"testing"
"gopkg.in/yaml.v2"
)
func parseAction(data string, t *testing.T) *Action {
a := new(Action)
if err := yaml.Unmarshal([]byte(data), a); err != nil {
t.Fatalf("error trying to parse action: %v - [action YML: %v]", err, string(data))
}
return a
}
func TestParseActionAdd(t *t... |
// Copyright 2019 the orbs-ethereum-contracts authors
// This file is part of the orbs-ethereum-contracts library in the Orbs project.
//
// This source code is licensed under the MIT license found in the LICENSE file in the root directory of this source tree.
// The above notice should be included in all copies or sub... |
// Copyright 2019 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... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: contact.proto
/*
Package pb is a generated protocol buffer package.
It is generated from these files:
contact.proto
document.proto
section.proto
It has these top-level messages:
UnlockedContact
LockedContact
UnlockedDocument
LockedDocument
UnlockedS... |
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"strconv"
"strings"
"time"
engagevoice "github.com/grokify/go-ringcentral-client/engagevoice/v1/client"
engagevoiceutil "github.com/grokify/go-ringcentral-client/engagevoice/v1/util"
"github.com/grokify/simplego/config"
"github.com/grokify/simple... |
package benchmarks
import (
"context"
"fmt"
"os"
"path/filepath"
"time"
"github.com/evergreen-ci/poplar"
"github.com/evergreen-ci/timber"
"github.com/mongodb/grip"
"github.com/mongodb/grip/level"
"github.com/mongodb/grip/message"
"github.com/pkg/errors"
)
const (
confFile = "cedarconf.yaml"
rpcAddress... |
package openpgp
import (
"crypto"
"errors"
"fmt"
"golang.org/x/crypto/openpgp"
"golang.org/x/crypto/openpgp/armor"
"golang.org/x/crypto/openpgp/packet"
"strings"
"time"
)
var headers = map[string]string{
"Version": "fast-openpgp",
}
var messageHeader = "PGP MESSAGE"
var signatureHeader = "PGP SIGNATURE"
fun... |
package keychain
import (
"crypto/ed25519"
"crypto/sha1"
"golang.org/x/crypto/pbkdf2"
"errors"
db "github.com/FleekHQ/space-daemon/core/store"
"github.com/libp2p/go-libp2p-core/crypto"
)
const PrivateKeyStoreKey = "private_key"
const PublicKeyStoreKey = "public_key"
var (
ErrKeyPairNotFound = errors.New("N... |
package datadog
import (
"fmt"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/plugins/processors"
)
const sampleConfig = `
`
type Datadog struct {
}
func (r *Datadog) SampleConfig() string {
return sampleConfig
}
func (r *Datadog) Description() string {
return "Rename host measurements with ... |
package engine
import (
"encoding/json"
"fmt"
"github.com/datenente/device-bitflow-stream/internal/communication"
contract "github.com/edgexfoundry/go-mod-core-contracts/models"
"sync"
)
var (
// these values are set in commands/device-bitflow-stream/engine/main.go
Config = configuration{}
valueDescriptors ... |
package lgtm
import (
"fmt"
"time"
sdk "gitee.com/openeuler/go-gitee/gitee"
"github.com/sirupsen/logrus"
"k8s.io/test-infra/prow/commentpruner"
prowConfig "k8s.io/test-infra/prow/config"
plugins "k8s.io/test-infra/prow/gitee-plugins"
"k8s.io/test-infra/prow/github"
"k8s.io/test-infra/prow/pluginhelp"
origin... |
package xmlstream
import (
"context"
"encoding/xml"
"fmt"
)
const (
// XMLNS is the XML namespace of this package
XMLNS = "https://github.com/andaru/xmlstream"
)
var (
// CBTokenize is the callback called during tokenization.
CBTokenize = xml.Name{Space: XMLNS, Local: "callback-tokenize"}
// CBStartElement i... |
package main
import (
"bytes"
"fmt"
"go/ast"
"reflect"
"strings"
)
type Encoder struct {
p packet
prefix string
buf *bytes.Buffer
tmpPrefix string
tmpCount int
}
func NewEncoder(p packet, b *bytes.Buffer) *Encoder {
return &Encoder{
p: p,
prefix: "t", // func (t *T) ...
buf: b,
... |
package jsonschema
import (
"bytes"
"encoding/json"
"io"
"reflect"
"strings"
jsonpointer "github.com/rnd42/go-jsonpointer"
)
var validatorMap = map[string]reflect.Type{
// Numbers
"maximum": reflect.TypeOf(maximum{}),
"minimum": reflect.TypeOf(minimum{}),
"multipleOf": reflect.TypeOf(multipleOf(0)),
... |
// Copyright (c) 2017 Yandex LLC. All rights reserved.
// Use of this source code is governed by a MPL 2.0
// license that can be found in the LICENSE file.
// Author: <NAME> <<EMAIL>>
package phttp
import (
"crypto/tls"
"net"
"net/http"
"time"
"go.uber.org/zap"
"golang.org/x/net/http2"
"github.com/pkg/error... |
// Copyright (c) 2016 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge... |
package e2e
import (
"context"
"crypto/rsa"
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
"net/http"
"os"
"testing"
"time"
retry "github.com/avast/retry-go"
"github.com/kyma-incubator/compass/components/director/pkg/graphql"
"github.com/kyma-incubator/compass/tests/end-to-end/pkg/connector"
"github.com/k... |
package api
type TokenType int64
const (
// since iota starts with 0, the first value
// defined here will be the default
UNDEFINED TokenType = iota
// Single-character tokens.
LEFT_PAREN // "("
RIGHT_PAREN
LEFT_BRACE // "{"
RIGHT_BRACE
LEFT_BRACKET // "["
RIGHT_BRACKET
COMMA
SEMICOLON
DOT
MINUS
PLUS
... |
package main
import "flag"
import (
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/rds"
"log"
"fmt"
"crypto/hmac"
"crypto/sha256"
"time"
"github.com/google/go-querystring/query"
"net/http"
"io"
"os"
"encoding/hex"
"path/filepath"
"github.com/aws/aws-sdk-go/aws"
"github.com/aw... |
package main
import (
"bytes"
"encoding/hex"
"fmt"
"io"
"os"
. "github.com/flynn/noise"
)
func main() {
for _, cipher := range []CipherFunc{CipherAESGCM, CipherChaChaPoly} {
for _, hash := range []HashFunc{HashSHA256, HashSHA512, HashBLAKE2b, HashBLAKE2s} {
for _, handshake := range []HandshakePattern{
... |
package shellco
// 📑 https://docs.microsoft.com/en-us/windows/win32/com/dropeffect-constants
type DROPEFFECT uint32
const (
DROPEFFECT_NONE DROPEFFECT = 0
DROPEFFECT_COPY DROPEFFECT = 1
DROPEFFECT_MOVE DROPEFFECT = 2
DROPEFFECT_LINK DROPEFFECT = 4
DROPEFFECT_SCROLL DROPEFFECT = 0x80000000
)
... |
package opa
import (
"context"
"encoding/json"
"log"
"os"
"path/filepath"
"strings"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
restclient "k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
cont... |
package spotify
import (
"errors"
"fmt"
"time"
sp "github.com/fabiofalci/go-libspotify/spotify"
"sconsify/infrastructure"
"sconsify/sconsify"
"sconsify/webapi"
"github.com/gordonklaus/portaudio"
webspotify "github.com/zmb3/spotify"
)
type Spotify struct {
currentTrack *sconsify.Track
paused ... |
package main
import (
"flag"
"fmt"
"io/ioutil"
"os"
"os/exec"
log "github.com/Sirupsen/logrus"
)
func runQemu(args []string) {
qemuFlags := flag.NewFlagSet("qemu", flag.ExitOnError)
qemuFlags.Usage = func() {
fmt.Printf("USAGE: %s run qemu [options] prefix\n\n", os.Args[0])
fmt.Printf("'prefix' specifies... |
// +build unit
package tcp
import (
"bufio"
"context"
"fmt"
"io"
"net"
"net/http"
"strings"
"testing"
"time"
mock3 "github.com/consensys/orchestrate/pkg/toolkit/app/metrics/mock"
"github.com/consensys/orchestrate/pkg/toolkit/tcp/metrics"
mock2 "github.com/consensys/orchestrate/pkg/toolkit/tcp/metrics/moc... |
package aws
import (
"fmt"
"strings"
"github.com/aws/aws-sdk-go/service/ec2"
aws "github.com/nikhilsbhat/neuron-cloudy/cloud/aws/interface"
)
// VpcResponse is a struct that will be the response type of almost all the VPC related activities under cloud/operations.
type VpcResponse struct {
// Name of the networ... |
package rip
import (
"bufio"
"bytes"
"io"
"runtime"
"sync"
)
type ParallelReader struct {
Concurrency int
ChunkSize int
ChunkBoundary string
ChunkBoundaryStart string
RequireBoundary bool
chunks chan *chunk
pool *Pool
}
func NewParallelReader() *ParallelR... |
package thorchain
import (
"errors"
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
"gitlab.com/thorchain/thornode/common"
"gitlab.com/thorchain/thornode/constants"
)
// validateStakeMessage is to do some validation, and make sure it is legit
func validateStakeMessage(ctx sdk.Context, keeper Keeper, asset commo... |
package db
import (
"context"
"errors"
log "github.com/sirupsen/logrus"
"go.mongodb.org/mongo-driver/bson"
"go.mongodb.org/mongo-driver/mongo"
"go.mongodb.org/mongo-driver/mongo/options"
)
var (
ErrClientIsNotInitialised = errors.New("client is not initialised")
ErrDatabaseDoesntExist = errors.New("databas... |
package main
import (
"bufio"
"context"
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"os/signal"
"strings"
"syscall"
"time"
"crypto/tls"
"crypto/x509"
"github.com/Shopify/sarama"
)
var (
command string
hosts string
topic string
partition int
offset int64
saslEnable bool
username stri... |
package main
import (
"encoding/hex"
"flag"
"fmt"
"log"
"strconv"
"strings"
"time"
"github.com/nmelo/smartcard/nxp/mifare"
"github.com/nmelo/smartcard/nxp/mifare/samav2"
"github.com/nmelo/smartcard/pcsc"
MQTT "github.com/eclipse/paho.mqtt.golang"
)
var keyS string
var keyNbr int
var urlBroker string
var r... |
package curve
import (
"errors"
"fmt"
"math/big"
GF "github.com/armfazh/hash-to-curve-ref/go-h2c/field"
)
// TECurve is a twisted Edwards curve
type TECurve struct{ *params }
type T = *TECurve
func (e *TECurve) String() string {
return fmt.Sprintf("Ax^2+y^2=1+Dx^2y^2\nF: %v\nA: %v\nD: %v\n", e.F, e.A, e.D)
}
... |
package console
import (
"net/http"
"strings"
"text/template"
"github.com/gliderlabs/cmd/lib/access"
"github.com/gliderlabs/cmd/lib/slack"
"github.com/gliderlabs/cmd/lib/web"
"github.com/gliderlabs/cmd/pkg/auth0"
"github.com/gliderlabs/comlab/pkg/log"
)
func (c *Component) WebTemplateFuncMap(r *http.Request)... |
package ui
import (
"fmt"
"github.com/veandco/go-sdl2/sdl"
"github.com/veandco/go-sdl2/ttf"
"github.com/torlenor/asciiventure/components"
"github.com/torlenor/asciiventure/entity"
"github.com/torlenor/asciiventure/renderers"
)
// TODO: Come up with a nice UI layout
// UI holds all functions and data related ... |
package main
import (
"bufio"
"encoding/json"
"errors"
"fmt"
pr "github.com/fclairamb/m2mp/go/m2mp-protocol"
"net"
"os"
"strings"
"time"
)
type Client struct {
Conn *pr.ProtoHandler
Recv chan interface{}
Send chan interface{}
Connected bool
ticker *time.Ticker
Ident string
status... |
package scan
import (
"strconv"
"unicode"
"github.com/cdkini/Okra/src/interpreter/ast"
"github.com/cdkini/Okra/src/okraerr"
)
// A Scanner takes in some stream of characters and tokenizes them based on Okra's syntax.
type Scanner struct {
source []rune // Source file written in Okra
tokens []ast.Token // ... |
// 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... |
package tc
import (
"fmt"
"io"
"log"
"os"
"os/exec"
"os/signal"
"syscall"
"github.com/creack/pty"
"golang.org/x/term"
)
// Termcorder holds all values required to record a command run.
type Termcorder struct {
cmd *exec.Cmd
pty *os.File
tty *os.File
outputWriters io.Writer
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.