text stringlengths 3.08k 10.4k |
|---|
package ff
import (
"bytes"
"errors"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strconv"
"strings"
"time"
"github.com/cheggaaa/pb"
"github.com/jpillora/longestcommon"
)
func (c *concat) ffmpegExec(m *metadata, files mediaFiles, output string) error {
//input files
inputs := []string{}
for _, f := range fi... |
package ovs
import (
"context"
"errors"
"fmt"
"net"
"strconv"
"time"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/log"
flowsv1alpha1 "github.com/netobserv/network-observability-operator/api/v1alpha1"
"github.com/netobserv/netw... |
// Copyright (c) 2019 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 o... |
// Copyright 2018 The Kubeflow Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
package backend
import (
"fmt"
)
// RouterInfo fetches basic information about the I2P router. Uptime, version etc.
type RouterInfo struct {
Status string
Uptime int
Version string
NetBwInbound1s int
NetBwInbound15s int
NetBwOutbound1s int
NetBwOutbound15s int
NetStatus ... |
/*
Copyright 2018 <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... |
package types
import (
"bytes"
"fmt"
"github.com/IBAX-io/go-ibax/packages/common/crypto"
"github.com/IBAX-io/go-ibax/packages/consts"
"github.com/IBAX-io/go-ibax/packages/converter"
"github.com/pkg/errors"
"github.com/vmihailenco/msgpack/v5"
)
const (
minBlockSize = 9
)
var (
ErrMaxBlockSize = func(max int... |
package geocode
import (
"context"
"flag"
"fmt"
"net/url"
"regexp"
"strconv"
"strings"
"time"
"github.com/ViBiOh/exas/pkg/model"
"github.com/ViBiOh/flags"
"github.com/ViBiOh/httputils/v4/pkg/httpjson"
prom "github.com/ViBiOh/httputils/v4/pkg/prometheus"
"github.com/ViBiOh/httputils/v4/pkg/request"
"gith... |
package ipmi
type LUN uint8
// 7.2 BMC IPMB LUNs
const (
IPMB_LUN_BMC LUN = 0x00 // BMC commands and Event Request Messages
IPMB_LUN_OEM_1 LUN = 0x01 // OEM LUN 1
IPMB_LUN_SMS LUN = 0x10 // SMS Message LUN (Intended for messages to System Management Software)
IPMB_LUN_OEM_2 LUN = 0x11 // OEM LUN 2
// the le... |
package main
import (
"fmt"
"sort"
"strings"
"sync"
"github.com/mattermost/mattermost-server/model"
"github.com/mattermost/mattermost-server/plugin"
"github.com/pkg/errors"
)
const (
dmOrPrivateChannelName = "DM"
)
// Plugin is the main struct used by mattermost to interact with this plugin
type Plugin stru... |
// Copyright 2017 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
package wwdb
import (
"context"
"fmt"
"github.com/jmoiron/sqlx"
"github.com/olekukonko/tablewriter"
"github.com/pkg/errors"
"github.com/urfave/cli/v2"
"os"
"time"
)
type Flood struct {
Db *sqlx.DB
Name string
Window time.Duration
Threshold int
}
type FloodHit struct {
Event string ... |
// This file contains modified code from code.google.com/p/go.tools/go/types pacgage.
//
// Oryginal code copyrights:
//
// Copyright (c) 2012 The Go Authors. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditio... |
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package types declares the data structures for representing
// Go types and implements typechecking of an *ast.Package.
//
// PACKAGE UNDER CONSTRUCTION. ANY... |
package stake
import (
"bytes"
"encoding/hex"
"testing"
"github.com/stretchr/testify/require"
abci "github.com/tendermint/abci/types"
crypto "github.com/tendermint/go-crypto"
dbm "github.com/tendermint/tmlibs/db"
"github.com/tendermint/tmlibs/log"
"github.com/cosmos/cosmos-sdk/store"
sdk "github.com/cosmo... |
package backend
import (
"fmt"
"math/cmplx"
"time"
"github.com/chewxy/stl"
"github.com/mjibson/go-dsp/fft"
"github.com/twsnmp/twsnmpfc/datastore"
)
type TimeAnalyzedPollingLog struct {
PX2 int64
TimeH []int64
TimePX2 []int64
DataMapH map[string][]float64
StlMapH map[string]stl.Result
... |
package filecontent
import (
"fmt"
"regexp"
"strings"
"sync"
"talisman/detector/helpers"
"talisman/detector/severity"
"talisman/gitrepo"
"talisman/talismanrc"
log "github.com/Sirupsen/logrus"
)
type fn func(fc *FileContentDetector, word string) string
type FileContentDetector struct {
base64Detector ... |
package prompt
import (
"strings"
"github.com/c-bata/go-prompt/internal/debug"
runewidth "github.com/mattn/go-runewidth"
)
const (
shortenSuffix = "..."
leftPrefix = " "
leftSuffix = " "
rightPrefix = " "
rightSuffix = " "
)
var (
leftMargin = runewidth.StringWidth(leftPrefix + leftSuffix)
... |
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package txn
import (
"encoding/hex"
"hash"
"time"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes"
"github.com/pkg/errors"
"github.com/hyperledger/fabric-protos-go/common"
pb "github.c... |
// +build js
package math
import (
"github.com/gopherjs/gopherjs/js"
)
var math = js.Global.Get("Math")
var zero float64 = 0
var posInf = 1 / zero
var negInf = -1 / zero
var nan = 0 / zero
func Acos(x float64) float64 {
return math.Call("acos", x).Float()
}
func Acosh(x float64) float64 {
return math.Call("acos... |
package influxdb_test
import (
"fmt"
"os"
"testing"
"time"
influxdata "github.com/influxdata/influxdb/client/v2"
"github.com/mainflux/mainflux"
"github.com/mainflux/mainflux/readers"
reader "github.com/mainflux/mainflux/readers/influxdb"
writer "github.com/mainflux/mainflux/writers/influxdb"
log "github.co... |
package dpm
import (
"os"
"os/signal"
"sync"
"syscall"
"time"
"github.com/fsnotify/fsnotify"
"github.com/golang/glog"
pluginapi "k8s.io/kubernetes/pkg/kubelet/apis/deviceplugin/v1beta1"
)
// TODO: Make plugin server start retries configurable.
const (
startPluginServerRetries = 3
startPluginServerRetryW... |
// Copyright 2021 AI Redefined Inc. <<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 o... |
// Copyright 2020 Readium Foundation. All rights reserved.
// Use of this source code is governed by a BSD-style license
// that can be found in the LICENSE file exposed on Github (readium) in the project repository.
package pack
import (
"archive/zip"
"crypto/sha256"
"encoding/hex"
"io"
"io/ioutil"
"log"
"os"... |
// Copyright 2015 The Gogs Authors. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package git
import (
"fmt"
"path"
"path/filepath"
"runtime"
"sort"
"strconv"
"strings"
)
type EntryMode int
// There are only a few file modes in Gi... |
package bootstrap
import (
"context"
"fmt"
"io/ioutil"
"regexp"
"github.com/rancher/fleet/modules/cli/agentmanifest"
fleet "github.com/rancher/fleet/pkg/apis/fleet.cattle.io/v1alpha1"
"github.com/rancher/fleet/pkg/config"
fleetns "github.com/rancher/fleet/pkg/namespace"
"github.com/rancher/wrangler/pkg/apply... |
package main
import (
"github.com/nsf/termbox-go"
"strconv"
"github.com/mattn/go-runewidth"
"os"
)
var logo = []string{
" _______..__ __. ___ .______ .______ ____ ____ ",
" / || \\ | | / \\ | _ \\ | _ \\ \\ \\ / / ",
" | (----`| \\| | / ^ \\ ... |
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-2020 Datadog, Inc.
// +build process
// +build darwin freebsd
package embed
import (
"bufio"... |
// 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 pushtx
import (
"math/rand"
"testing"
"github.com/giangnamnabka/btcd/wire"
"github.com/giangnamnabka/neutrino/blockntfns"
)
// createTx is a helper method to create random transactions that spend
// particular inputs.
func createTx(t *testing.T, numOutputs int, inputs ...wire.OutPoint) *wire.MsgTx {
t.H... |
package trigger
import (
"fmt"
"github.com/alwaysthanks/xcron/core/engine"
"github.com/alwaysthanks/xcron/core/entity"
"github.com/alwaysthanks/xcron/core/global"
"github.com/ouqiang/timewheel"
"github.com/robfig/cron"
"log"
"os"
"strconv"
"sync/atomic"
"time"
)
var trig *Trigger
func Init() error {
trig... |
package graphql_test
import (
"math"
"reflect"
"testing"
"time"
"github.com/GannettDigital/graphql"
)
type intSerializationTest struct {
Value interface{}
Expected interface{}
}
type float64SerializationTest struct {
Value interface{}
Expected interface{}
}
type stringSerializationTest struct {
Val... |
// Copyright © 2021 sealos.
//
// 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... |
package server
import (
"encoding/json"
"net"
"os"
"path/filepath"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/version"
"github.com/cosmos/cosmos-sdk/wire"
tcmd "github.com/tendermint/tendermint/cmd/tendermin... |
// Copyright (c) 2017-2020 Zededa, Inc.
// SPDX-License-Identifier: Apache-2.0
package hypervisor
import (
"fmt"
zconfig "github.com/lf-edge/eve/api/go/config"
"github.com/lf-edge/eve/pkg/pillar/containerd"
"github.com/lf-edge/eve/pkg/pillar/types"
"os"
"time"
log "github.com/sirupsen/logrus"
)
type ctrdCont... |
// *** 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 devtest
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about... |
package keeper
import (
"encoding/binary"
"fmt"
"github.com/tendermint/tendermint/libs/log"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/cosmos/cosmos-sdk/x/capability"
"github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types"
ibctypes "github.com/cosmos/cosmos-sdk/x/... |
/*
Copyright 2018 The Skaffold 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, sof... |
// Copyright 2017 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, ... |
package mux
import (
"github.com/Shopify/sarama"
"github.com/ligato/cn-infra/config"
"github.com/ligato/cn-infra/logging"
"github.com/ligato/cn-infra/messaging/kafka/client"
"github.com/ligato/cn-infra/utils/clienttls"
"time"
)
const (
// DefAddress default kafka address/port (if not specified in config)
DefA... |
// Copyright 2021 The LUCI Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... |
package openweather
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strconv"
"time"
)
type weatherDataResponse struct {
Clouds struct {
All int `json:"all"` // Cloudiness in %
} `json:"clouds"`
Coord struct {
Lat float64 `json:"lat"`
Lon float64 `json:"lon"`
} `json:"coord... |
// Copyright 2017 <NAME>. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.
// Package ffmpeg contains ffmpeg specific types.
package ffmpeg
import (
"encoding/json"
"fmt"
"log"
"net"
"net/http"
"os/exec"
"strconv"
"stri... |
/*
Copyright 2019 Splunk 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 wri... |
package main
import (
"database/sql"
"encoding/json"
"errors"
"flag"
"fmt"
_ "github.com/go-sql-driver/mysql"
"log"
"os"
"strings"
)
var defaults = Configuration{
DbUser: "db_user",
DbPassword: "<PASSWORD>",
DbName: "bd_name",
PkgName: "DbStructs",
TagLabel: "db",
}
var config Configuratio... |
package tracee
import (
"bytes"
"encoding/binary"
"fmt"
"strconv"
"unsafe"
"github.com/aquasecurity/tracee/pkg/external"
)
// context struct contains common metadata that is collected for all types of events
// it is used to unmarshal binary data and therefore should match (bit by bit) to the `context_t` struc... |
package cmd
import (
"fmt"
"github.com/exoscale/egoscale"
"github.com/spf13/cobra"
)
func init() {
firewallRemoveCmd.Flags().BoolP("force", "f", false, "Attempt to remove firewall rule without prompting for confirmation")
firewallRemoveCmd.Flags().BoolP("ipv6", "6", false, "Remove rule with any IPv6 source")
f... |
package main
import (
_ "embed"
"encoding/json"
"fmt"
"html/template"
"log"
"net/http"
"strings"
"codeberg.org/evieDelta/darchive/darchivev3"
"github.com/bwmarrin/discordgo"
"github.com/diamondburned/arikawa/v3/discord"
"github.com/go-chi/chi/v5"
"github.com/starshine-sys/dischtml"
)
//go:embed index.htm... |
package scalers
import (
"context"
"fmt"
"github.com/kedacore/keda/pkg/scalers/azure"
"strconv"
"strings"
kedautil "github.com/kedacore/keda/pkg/util"
v2beta2 "k8s.io/api/autoscaling/v2beta2"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels... |
package v1
import (
"fmt"
"sort"
"github.com/mlab-lattice/lattice/pkg/api/v1"
kubeutil "github.com/mlab-lattice/lattice/pkg/backend/kubernetes/util/kubernetes"
"github.com/mlab-lattice/lattice/pkg/backend/kubernetes/util/latticeutil"
"github.com/mlab-lattice/lattice/pkg/definition"
"github.com/mlab-lattice/lat... |
package keeper
import (
"fmt"
"github.com/cosmos/cosmos-sdk/codec"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/mesg-foundation/engine/hash"
ownershippb "github.com/mesg-foundation/engine/ownership"
"github.com/mesg-foundation/engine/runner"
"githu... |
package dataset
import (
"encoding/json"
"io"
"io/ioutil"
"log"
"net/http"
"os"
"os/exec"
"path/filepath"
"strconv"
"sync"
"github.com/vbauerster/mpb/v6"
"github.com/vbauerster/mpb/v6/decor"
)
var DATASETS_PATH = "./output/datasets"
var ROOTCAS_PATH = "./output/rootCAs"
type Datasets []struct {
Name s... |
// Copyright 2018 The Go Cloud Development Kit 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
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by appli... |
package byzantine
import (
"context"
"crypto/tls"
"fmt"
"io"
"google.golang.org/grpc"
"google.golang.org/grpc/balancer/roundrobin"
"google.golang.org/grpc/resolver"
"google.golang.org/grpc/resolver/manual"
"github.com/oasisprotocol/oasis-core/go/common"
"github.com/oasisprotocol/oasis-core/go/common/crypto... |
// See https://adventofcode.com/2020/day/20 for problem decscription
package main
import (
"bufio"
"flag"
"fmt"
"os"
"regexp"
"strconv"
"strings"
)
var testFileFlag = flag.Bool("t", false, "Use the test file")
const (
width = 10
height = 10
)
const (
deg0Right = iota
deg0Bottom
deg0Left
deg0Top
flip0... |
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
package kls
import (
"fmt"
"strings"
"unicode/utf8"
"github.com/huichen/kunlun/internal/ngram_index"
"github.com/huichen/kunlun/pkg/types"
)
const (
omitAfterChars = 300
)
// 重新绘制右侧的文件内容展示窗口
func (kls *KLS) redrawFileContent() {
if kls.response == nil {
return
}
kls.currentHighlightLineIndex = 0
kls.f... |
// -*- coding: utf-8 -*-
// Copyright (C) 2018 Nippon Telegraph and Telephone Corporation.
//
// 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... |
/*
Copyright 2016 Mirantis
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... |
package hunk
/* Refer to The AmigaDOS Manual (3rd Edition), chapter 10. */
type HunkType uint32
const (
HUNK_NONE HunkType = 0
HUNK_UNIT = 999
HUNK_NAME = 1000
HUNK_CODE = 1001
HUNK_DATA = 1002
HUNK_BSS = 1003
HUNK_R... |
package b1t6_test
import (
"bytes"
"encoding/hex"
"errors"
"strings"
"testing"
"github.com/iotaledger/iota.go/trinary"
"github.com/stretchr/testify/assert"
"github.com/wollac/iota-crypto-demo/pkg/encoding/b1t6"
)
func TestValidEncodings(t *testing.T) {
type args struct {
bytes []byte
trytes trinary.Try... |
/*
Copyright 2017 The Rook Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to ... |
package goif
import (
"bufio"
"bytes"
"errors"
"fmt"
"io"
"regexp"
"sort"
"strings"
)
type formatter struct {
orgGroupPrefix string
importOpened bool
importLines []importLine
}
func NewFormatter(orgGroupPrefix string) *formatter {
return &formatter{
orgGroupPrefix: orgGroupPrefix,
}
}
func (f *f... |
// Copyright 2018 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 ... |
// This file is part of Ark Go Crypto.
//
// (c) Ark Ecosystem <<EMAIL>>
//
// For the full copyright and license information, please view the LICENSE
// file that was distributed with this source code.
package crypto
import (
"bytes"
"crypto/sha256"
"encoding/binary"
"encoding/json"
"log"
"strconv"
"strings"
... |
// Copyright (C) 2019 Orange
//
// This software is distributed under the terms and conditions of the 'Apache License 2.0'
// license which can be found in the file 'License.txt' in this package distribution
// or at 'http://www.apache.org/licenses/LICENSE-2.0'.
//
package dgraph
import (
"context"
"encoding/json... |
package postgres
import (
"time"
"github.com/chef/automate/api/external/applications"
dblib "github.com/chef/automate/lib/db"
"github.com/go-gorp/gorp"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
log "github.com/sirupsen/l... |
/*
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 cloudevent
import (
"context"
"errors"
"fmt"
"time"
cloudevents "github.com/cloudevents/sdk-go/v2"
"github.com/crossplane/crossplane-runtime/pkg/logging"
uuid "github.com/satori/go.uuid"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
cdevents "github.com/cdfoundation/sig-events/cde/sdk/go/pkg/cdf/eve... |
package gcloudcx
import (
"context"
"encoding/json"
"net/url"
"time"
"github.com/gildas/go-core"
"github.com/gildas/go-errors"
"github.com/gildas/go-logger"
"github.com/google/uuid"
)
// ConversationChat describes a Agent-side Chat
type ConversationChat struct {
ID uuid.UUID `json:"id"`... |
// DO NOT EDIT THIS FILE. GENERATED BY svdxgen.
// +build nrf52840
// Package uart provides access to the registers of the UART0 peripheral.
//
// Instances:
// UART0 UART0_BASE - UARTE0_UART0* Universal Asynchronous Receiver/Transmitter
// Registers:
// 0x000 32 TASK_STARTRX Start UART receiver
// 0x004 32 ... |
package keeper
import (
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/fastock/fastock-chain/x/staking/types"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
)
// KickOutAndReturnValidatorSetUpdates shows the main logic when a validator is kicked out of... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: hello.proto
/*
Package hello is a generated protocol buffer package.
It is generated from these files:
hello.proto
It has these top-level messages:
Request
Response
*/
package hello
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import... |
/*
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
*/
/*
THIS FILE IS AUTOGENERATED BY 'rclgo-gen generate'
*/
package example_interfaces_msg
import (
"unsaf... |
package messaging
import (
"crypto/tls"
"errors"
"fmt"
"io/ioutil"
"log"
"net"
"net/http"
"net/url"
"sync"
"time"
)
//var pubnub *Pubnub
var (
errRequestCanceledToResubscribe = errors.New("pubnub worker: request canceled to resubscribe")
errRequestCanceledByUser = errors.New("pubnub worker: reques... |
package cipher
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/base64"
"encoding/pem"
"errors"
"os"
)
var (
// ErrPrivateKey indicates the invalid private key.
ErrPrivateKey = errors.New("private key error")
// ErrPublicKey indicates the invalid public key.
ErrPublicKey = errors.New("failed to ... |
package aws
import (
"math/rand"
"os"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/acm"
"github.com/aws/aws-sdk-go/service/autoscaling"
"github.com/aws/aws-sdk-go/service/cloudformation"
"github.com/aws/aws-sdk-go/service/cloudwatch"
"gith... |
package main
import (
"context"
"crypto/sha512"
"encoding/base64"
"fmt"
"log"
"net/http"
"os"
"path"
"strconv"
"strings"
"sync"
"time"
)
// Global vars
var passwordMap map[int]string
var postCount Counter
var postStats []int64
var shutdown bool
var hs *http.Server
// Syncronized counter
type Counter str... |
package twitch
import (
"encoding/json"
"fmt"
"github.com/gorilla/websocket"
"github.com/lietu/stream-manager/manager"
"log"
"net/http"
"time"
)
type InitCallback func()
type TwitchStreamService struct {
bitsActions BitsActions
manager *manager.Manager
live bool
channelId string
running ... |
/*
Copyright 2020 The Flux 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 fwaas
import (
"fmt"
"strconv"
"testing"
"github.com/Huawei/gophercloud"
"github.com/Huawei/gophercloud/acceptance/tools"
"github.com/Huawei/gophercloud/openstack/networking/v2/extensions/fwaas/firewalls"
"github.com/Huawei/gophercloud/openstack/networking/v2/extensions/fwaas/policies"
"github.com/Hua... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package clouddirectory
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
)
// Please also see https://docs.aws.amazon.com/goto/WebAPI/cl... |
//Copyright (c) 2014 Square, Inc
//Launches metrics collector for postgres databases
package main
import (
"flag"
"fmt"
"log"
"net/http"
"strconv"
"time"
"github.com/square/inspect/metrics"
"github.com/square/inspect/postgres/stat"
)
func main() {
var user, address, conf string
var stepSec int
var server... |
package conn
import (
"fmt"
"reflect"
"time"
json "github.com/intel-go/fastjson"
nats "github.com/nats-io/go-nats"
. "github.com/sencydai/utils/log"
)
//SysMessage 系统消息
type SysMessage struct {
MsgID int
Data []byte
}
//ResponseMessage rpc消息
type ResponseMessage struct {
Subject string... |
package idgen
import (
"crypto/rand"
"crypto/sha256"
"encoding/binary"
"fmt"
"math/bits"
"sync"
"sync/atomic"
"github.com/libp2p/go-libp2p-core/crypto"
"github.com/libp2p/go-libp2p-core/peer"
kbucket "github.com/libp2p/go-libp2p-kbucket"
"golang.org/x/crypto/hkdf"
)
// HydraIdentityGenerator is a shared b... |
// Copyright 2020 Insolar Network Ltd.
// All rights reserved.
// This material is licensed under the Insolar License version 1.0,
// available at https://github.com/insolar/insolar/blob/master/LICENSE.md.
package genesis
import (
"context"
"fmt"
"github.com/insolar/insolar/insolar"
insolarPulse "github.com/inso... |
package compressutil
import (
"bytes"
"compress/gzip"
"compress/lzw"
"fmt"
"io"
"github.com/golang/snappy"
)
const (
// A byte value used as a canary prefix for the compressed information
// which is used to distinguish if a JSON input is compressed or not.
// The value of this constant should not be a firs... |
package exec
import (
"context"
"code.cloudfoundry.org/lager"
"code.cloudfoundry.org/lager/lagerctx"
"github.com/concourse/concourse/atc"
"github.com/concourse/concourse/atc/creds"
"github.com/concourse/concourse/atc/db"
"github.com/concourse/concourse/atc/resource"
"github.com/concourse/concourse/atc/worker"... |
// +build windows
package runner
import (
"context"
"syscall"
"unsafe"
"github.com/itchio/ox/syscallex"
"github.com/itchio/ox/winox/execas"
"github.com/itchio/headway/state"
"github.com/pkg/errors"
)
const magicCompletionKey uint32 = 0xf00d
type processGroup struct {
consumer *state.Consumer
cmd *e... |
// Copyright 2019 The GCR Cleaner 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 ... |
package kv
import (
"context"
"github.com/znbasedb/errors"
"github.com/znbasedb/znbase/pkg/internal/client"
"github.com/znbasedb/znbase/pkg/roachpb"
"github.com/znbasedb/znbase/pkg/storage/engine/enginepb"
"github.com/znbasedb/znbase/pkg/util/uuid"
)
// savepoint captures the state in the TxnCoordSender necess... |
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
// Package cloudformation provides functionality to deploy ECS resources with AWS CloudFormation.
package cloudformation
import (
"errors"
"fmt"
"strings"
"github.com/aws/aws-sdk-go/aws"
awscfn "github.c... |
/*
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, ... |
package binary
import (
"bufio"
"io"
)
type Writer struct {
W io.Writer
wb [MaxVarintLen64]byte
err error
}
func NewWriter(w io.Writer) *Writer {
return &Writer{W: w}
}
func (writer *Writer) Reset(w io.Writer) {
writer.W = w
writer.err = nil
}
func (writer *Writer) Error() error {
return writer.err
}
... |
package visualizer
import (
"github.com/hkparker/Wave/helpers"
"github.com/hkparker/Wave/models"
log "github.com/sirupsen/logrus"
"sort"
"strings"
"sync"
)
const (
DEVICE_ISAP = "IsAP"
DEVICE_MAC = "MAC"
DEVICE_NULLPROBE = "NullProbe"
DEVICE_PROBE = "ProbedFor"
DEVICE_POW... |
/*
* Copyright © 2015-2018 <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 o... |
package easygo
import (
"reflect"
"time"
)
type IGoroutine interface {
Start(function interface{}, args ...interface{})
// StartLater(seconds time.Duration, function interface{}, args ...interface{})
Join(timeout ...time.Duration)
Get(block bool, timeout ...time.Duration) interface{}
// Successful() bool
//... |
package sbac
import (
"fmt"
"sync"
"chainspace.io/chainspace-go/internal/log"
"chainspace.io/chainspace-go/internal/log/fld"
)
type StateSBAC uint8
const (
StateSBACWaiting StateSBAC = iota
StateSBACAccepted
StateSBACRejected
)
func (e StateSBAC) String() string {
switch e {
case StateSBACWaiting:
retur... |
// use modelling code on well-known prostate cancer data, check we get same results.
package cancer
import (
"fmt"
"io/ioutil"
"math"
"os"
"os/exec"
"strings"
"time"
"code.google.com/p/go-uuid/uuid"
"github.com/xoba/goutil/gmath"
"github.com/xoba/goutil/gmath/model"
)
type Tool struct {
}
func (Tool) Name... |
// Copyright 2015-2016 trivago GmbH
//
// 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 ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.