text stringlengths 3.08k 10.4k |
|---|
package v1
import (
"net/http"
"log"
"encoding/json"
"errors"
"mime/multipart"
"reflect"
"strings"
"net/http/httputil"
"bytes"
"net/url"
"io/ioutil"
"fmt"
"encoding"
)
type VOIPClient struct {
URL string
Username string
Password string
Debug bool
}
type StatusResp interface {
GetStatus() st... |
package mods
import (
"context"
"fmt"
"regexp"
"sort"
"strings"
"github.com/Masterminds/semver/v3"
"github.com/davecgh/go-spew/spew"
"github.com/rotisserie/eris"
"github.com/ngld/knossos/packages/server/pkg/db/queries"
"github.com/ngld/knossos/packages/server/pkg/nblog"
)
type (
DependencySnapshot map[st... |
package authz
import (
"context"
"crypto/rsa"
"encoding/json"
"time"
jwt "github.com/cristalhq/jwt/v3"
grpc_auth "github.com/grpc-ecosystem/go-grpc-middleware/auth"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)
const authorizationType = "bearer"
// Config auth de... |
package model
import (
"fmt"
"go-common/library/time"
)
const (
//ModulesNotDelete module not delete
ModulesNotDelete = 0
//ModulesDelete module delete
ModulesDelete = 1
//ModulesValid module is valid
ModulesValid = 1
//ModulesPublishYes module is publish status in MC
ModulesPublishYes = 1
//ModulesPublis... |
package router
import (
"fmt"
"io/ioutil"
"net/http"
"regexp"
"strings"
)
type nodePart string
func (np nodePart) Name() string { return string(np[1:]) }
func (np nodePart) Type() uint8 { return np[0] }
func (np nodePart) String() string {
if np.Type() == '/' {
return fmt.Sprintf("{%s}", np.Name())
}
retu... |
package utils
import (
"context"
"crypto/tls"
"errors"
"fmt"
"github.com/fatih/color"
"io"
"io/ioutil"
"log"
"net"
"net/http"
"net/http/httptrace"
"net/url"
"sort"
"strings"
"time"
)
type headers []string
func (h headers) String() string {
var o []string
for _, v := range h {
o = append(o, "-H "+v... |
// Copyright 2020-2021 <NAME>. All rights reserved. MIT License.
package deno
import (
"context"
"encoding/json"
"fmt"
"log"
"reflect"
"strconv"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/service/sqs"
"github.com/aws/aws-sdk-go-v2/service/sqs/types"
"github.com/cornelk/hashmap"
)
// Q... |
package main
import (
"bufio"
"errors"
"fmt"
"math"
"os"
"strconv"
"strings"
)
type ChemicalReactionSystem struct {
Formulae map[string]*ReactionFormula;
FileName string;
}
type ReactionFormula struct {
ProductId string;
Input []*ReactionProduct;
Output *ReactionProduct;
}
type ReactionProduct struct {
... |
package main
import (
"os"
"regexp"
"strconv"
"strings"
"encoding/csv"
"time"
"github.com/JLRgithub/PrivateDCi2b2/lib"
"github.com/JLRgithub/PrivateDCi2b2/services"
"github.com/btcsuite/goleveldb/leveldb/errors"
"gopkg.in/dedis/onet.v1"
"gopkg.in/dedis/onet.v1/app"
"gopkg.in/dedis/onet.v1/log"
"gopkg.... |
// Copyright 2017 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 main
import (
"dependency-check-server/common"
"flag"
"fmt"
"net/http"
"os"
"path/filepath"
"regexp"
"strings"
"sync"
"time"
"github.com/s3cu1n4/logs"
"gopkg.in/fsnotify.v1"
)
var (
jarPATH string
prjLog sync.Map
jarTemp sync.Map
)
type Watch struct {
watch *fsnotify.Watcher
}
//监控目录
func ... |
// CopyMySql project main.go
package main
import (
"database/sql"
"fmt"
_ "github.com/go-sql-driver/mysql"
"os"
"strings"
)
func checkError(err error) {
if err != nil {
//fmt.Println(err)
panic(err.Error())
}
}
var sql_ip_port string
var sql_user string
var sql_pwd string
var sql_base_src string
var sql_... |
// Copyright 2019 cruzbit developers
// Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.
package miner
import (
"context"
"crypto/tls"
"encoding/json"
"log"
"net/http"
"net/url"
"sync"
"time"
"github.com/cruzbit/cruzbit"
"github.com/gorilla/websocket"
"gola... |
/*
* Copyright 2021 CloudWeGo 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 agre... |
package main
import (
"net"
"net/http"
"os"
"github.com/VantageSports/common/certs"
vscreds "github.com/VantageSports/common/credentials/google"
"github.com/VantageSports/common/env"
"github.com/VantageSports/common/log"
"github.com/VantageSports/common/queue"
"github.com/VantageSports/lolusers"
"github.com... |
/*
Copyright (c) Facebook, Inc. and its affiliates.
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 controllers
import (
"context"
"fmt"
"strconv"
"strings"
"github.com/kubeflow/common/pkg/controller.v... |
/*******************************************************************
* Copyright(c) 2015-2016 Company Name
* All rights reserved.
*
* File :
* Date :
* Author :
* Description:
******************************************************************/
package send
import (
"github.com/pquerna/ffjson/ffjson... |
package main
import (
"bufio"
"database/sql"
"flag"
"fmt"
"irclog-stats/cfg"
"log"
"os"
"path/filepath"
"strings"
"sync"
_ "github.com/lib/pq"
)
var fImportDir = flag.String("dir", "", "directory of log files to import")
var fNetwork = flag.String("network", "", "name of network for logs, eg 'freenode'")
... |
package main
import (
"context"
"flag"
"fmt"
"github.com/WelcomerTeam/Comfy/comfy"
"github.com/WelcomerTeam/Discord/discord"
protobuf "github.com/WelcomerTeam/Sandwich-Daemon/protobuf"
sandwich_structs "github.com/WelcomerTeam/Sandwich-Daemon/structs"
messaging "github.com/WelcomerTeam/Sandwich/messaging"
san... |
package main
import (
"context"
"fmt"
"log"
"net/http"
"os"
"os/signal"
"strconv"
"strings"
"syscall"
"time"
"github.com/dghubble/go-twitter/twitter"
t "github.com/suzutan/syncfollows/internal/pkg/twitter"
)
type contextKey string
const contextClient contextKey = "client"
const contextOwnerID contextKey... |
package main
import (
"context"
"fmt"
"os"
// External
"github.com/dwtechnologies/custom-cf/lib/events"
l "github.com/nuttmeister/llogger"
// External - AWS
"github.com/aws/aws-lambda-go/lambda"
"github.com/aws/aws-sdk-go-v2/aws/external"
"github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider"
)
//... |
// Copyright 2021 The Chromium OS 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 printer
import (
"context"
"time"
"chromiumos/tast/common/testexec"
"chromiumos/tast/ctxutil"
"chromiumos/tast/errors"
"chromiumos/tast... |
package main
import (
"context"
"fmt"
"strings"
"time"
"github.com/capnm/sysinfo"
"github.com/docker/cli/cli-plugins/manager"
"github.com/docker/cli/cli-plugins/plugin"
"github.com/docker/cli/cli/command"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/events"
"github.com/docker/do... |
/*
Copyright 2013 The Camlistore 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 wallet
import (
"bytes"
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"time"
"code.vegaprotocol.io/go-wallet/config/encoding"
"code.vegaprotocol.io/go-wallet/fsutil"
"github.com/zannen/toml"
"go.uber.org/zap"
)
const (
namedLogger = "wallet"... |
// gotmpl is a simple command line tool that will substitute the
// variables from a data file into a Go text template file.
//
// Get it:
// go get -u github.com/msample/gotmpl
//
// Use it:
// gotmpl -d dat.yml cfg.txt.tmpl > cfg.txt
//
// cat dat.yml | gotmpl cfg.txt.tmpl > cfg.txt
//
// c... |
// Copyright 2018-2020 CERN
//
// 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 datautils
import (
"bytes"
"fmt"
)
// FileType is the type URI for files
const FileType = "http://sdr.sul.stanford.edu/models/sdr3-file.jsonld"
// FilesetType is the type URI for filesets
const FilesetType = "http://sdr.sul.stanford.edu/models/sdr3-fileset.jsonld"
// ObjectTypes is the list of object subt... |
package zeusmaster
import (
"fmt"
"net"
"strings"
"sync"
"syscall"
slog "github.com/burke/zeus/go/shinylog"
"github.com/burke/zeus/go/unixsocket"
)
type SlaveNode struct {
ProcessTreeNode
Socket *net.UnixConn
Pid int
Error string
... |
package main
import (
"fmt"
"testing"
"github.com/spf13/cobra"
"github.com/stretchr/testify/assert"
"github.com/ovh/cds/cli"
"github.com/ovh/cds/sdk"
)
func testInitCurrentShell() shellCurrent {
prjs := []sdk.Project{{Key: "prj-1"}, {Key: "prj-2"}}
wkfs := []sdk.Workflow{{Name: "wkf-1"}, {Name: "wkf-2"}}
a... |
package logger
import (
"context"
"errors"
"go.uber.org/zap"
"go.uber.org/zap/buffer"
"go.uber.org/zap/zapcore"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/peer"
)
const encoderName = "mnemosyne-stackdriver"
func init() {
if err := zap.RegisterEncoder(encoderName, func(c... |
package main
import (
"fmt"
"regexp"
"sort"
"github.com/Jeffail/gabs/v2"
envconf "github.com/caarlos0/env/v6"
"github.com/stackpulse/steps-sdk-go/log"
"github.com/stackpulse/steps-sdk-go/step"
"github.com/stackpulse/steps/rabbitmq/queues/base"
)
var CheckValuesDescription = map[string]string{
"memory": ... |
package gosuv
import (
"errors"
"fmt"
"github.com/glycerine/rbuf"
"github.com/wfxiang08/cyutils/utils/atomic2"
"github.com/wfxiang08/cyutils/utils/log"
"sync"
"time"
)
// The new broadcast
type streamWriter struct {
wc *chanStrWriter
stream string
}
type WriteBroadcaster struct {
sync.Mutex
buf *r... |
// Copyright 2013 M-Lab
//
// 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, s... |
//
// Copyright 2021 Layotto 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 ... |
package consul
import (
"fmt"
"sync"
"github.com/allegro/marathon-consul/apps"
"github.com/allegro/marathon-consul/service"
consulapi "github.com/hashicorp/consul/api"
)
// TODO this should be a service registry stub in the service package, requires abstracting from AgentServiceRegistration
type Stub struct {
... |
package command
import (
"context"
"errors"
"os"
"os/signal"
"runtime"
"strings"
"github.com/spf13/cobra"
"github.com/v-byte-cpu/sx/pkg/scan"
"github.com/v-byte-cpu/sx/pkg/scan/arp"
"github.com/v-byte-cpu/sx/pkg/scan/tcp"
)
const (
cliTCPSYNPacketFlag = "syn"
cliTCPACKPacketFlag = "ack"
cliTCPFINPacketF... |
package main
import (
"log"
"time"
"github.com/Optum/dce/pkg/awsiface"
"github.com/Optum/dce/pkg/budget"
"github.com/Optum/dce/pkg/common"
"github.com/Optum/dce/pkg/db"
"github.com/Optum/dce/pkg/usage"
"github.com/aws/aws-sdk-go/service/costexplorer"
"github.com/pkg/errors"
)
type calculateSpendInput struct... |
package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"github.com/MakeNowJust/memefish/pkg/analyzer"
"github.com/MakeNowJust/memefish/pkg/char"
"github.com/MakeNowJust/memefish/pkg/parser"
"github.com/MakeNowJust/memefish/pkg/token"
"github.com/k0kubun/pp"
"github.com/olekukonko/tablewriter"
"gopkg.in... |
package gateway
import (
"bemicro/discovery"
"fmt"
"log"
"reflect"
"sync"
"golang.org/x/net/context"
"google.golang.org/grpc"
)
// ConnContainer is a thread safe conn container. Key is service name, value is grpc.ClientConn
type ConnContainer struct {
// srvName => connection
conns map[string]*grpc.ClientC... |
// Implements a Controller for Texas Instrument's CC253X-based dongles.
//
// For documentation of the serial protocol, please refer to the following
// documents: "ZNP Interface Specification", "Z-Stack Monitor and Test API".
package znp
import (
"errors"
"fmt"
"log"
"sync/atomic"
"time"
"github.com/GreenLight... |
package core
import (
"time"
"github.com/supergiant/supergiant/pkg/kubernetes"
"github.com/supergiant/supergiant/pkg/model"
)
type NodeObserver struct {
core *Core
}
// Perform - Gathers metric information on nodes.
func (s *NodeObserver) Perform() error {
var kubes []*model.Kube
if err := s.core.DB.Where("re... |
/*
Copyright 2017 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 browser
import (
"encoding/json"
"errors"
"fmt"
"sync"
"sync/atomic"
"time"
"github.com/ghetzel/go-stockutil/log"
"github.com/ghetzel/go-stockutil/maputil"
"github.com/gorilla/websocket"
)
var MaxUnreadEvents = 1024
var DefaultReplyTimeout = 30 * time.Second
type RPC struct {
URL s... |
package vote
import (
"io"
"strconv"
"strings"
"github.com/antchfx/htmlquery"
"github.com/gofiber/fiber"
"github.com/wcharczuk/go-chart"
"go.uber.org/zap"
"golang.org/x/net/html"
"bgm38/app/web/res"
"bgm38/app/web/utils/handler"
"bgm38/pkg/fetch"
"bgm38/pkg/model"
"bgm38/pkg/parser"
)
func Group(app *f... |
package model
import (
"time"
)
// RealnameStatus is.
type RealnameStatus int8
const (
// RealnameStatusFalse is.
RealnameStatusFalse RealnameStatus = 0
// RealnameStatusTrue is.
RealnameStatusTrue RealnameStatus = 1
)
// RealnameApplyStatus is.
type RealnameApplyStatus int8
const (
// RealnameApplyStatusPen... |
// Copyright 2015-2018 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... |
package rtc
import (
"../logger"
"../messages"
"encoding/json"
"errors"
"fmt"
"github.com/pion/rtcp"
"github.com/pion/webrtc"
"io"
"strings"
"time"
)
type WebRTCStreamer struct {
peerConnection *webrtc.PeerConnection
send chan OutputMessage
recv chan []byte
WebRtcVideoStream... |
package bdc
import (
"errors"
"net"
"sync"
"time"
)
var (
//ErrMethodUnsupported ErrMethodUnsupported
ErrMethodUnsupported = errors.New("bdc. method unsupported")
//ErrTooLarge ErrTooLarge
ErrTooLarge = errors.New("bdc. too large")
//ErrSizeWrong ErrSizeWrong
ErrSizeWrong = errors.New("bdc. size wrong")
//... |
package main
import (
"encoding/json"
"log"
"github.com/dmwm/das2go/mongo"
)
// DAS structure represent DAS porition of DAS record
type DAS struct {
Expire int64 `json:"expire"`
Instance string `json:"instance"`
PrimaryKey string `json:"primary_key"`
Record int `json:"record"`
Services ... |
// Copyright 2016 <NAME>. All rights reserved.
// Use of this source code is governed by a license that can be found in the LICENSE.txt file.
package qctx
import (
"fmt"
"io"
"net/http"
"runtime"
"time"
)
// WrappedRW wraps http.ResponseWriter, to capture the HTTP status code and
// observe whether or not any d... |
// Copyright 2020 Anapaya Systems
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
package collector
import (
"fmt"
"strings"
"bytes"
"net/http"
log "github.com/sirupsen/logrus"
"github.com/serialx/hashring"
)
const (
INFLUX_DB_DEFAULT = "default_all"
INFLUX_WRITE_URL_TEMPLATE = "%s/write?db=%s"
INFLUX_QUERY_GET_URL_TEMPLATE = "%s/query?db=%s"
... |
package chronomq_test
import (
"math/rand"
"net/url"
"os"
"path"
"time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
. "github.com/chronomq/chronomq/pkg/chronomq"
"github.com/chronomq/chronomq/pkg/persistence"
)
var persister persistence.Persister
var _ = Describe("Test hub", func() {
defer Gink... |
package main
import (
"context"
"fmt"
"log"
"os"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
v1 "k8s.io/api/rbac/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"github.com/orelmisan/k8s-checkup-framework/pkg/checkup"
"github.com/orelm... |
package main
import (
"context"
"encoding/json"
"fmt"
"github.com/golang-jwt/jwt"
"github.com/gorilla/mux"
"google.golang.org/grpc"
"log"
"net/http"
"open-match.dev/open-match/pkg/pb"
"os"
"os/signal"
"strings"
"time"
)
var signingKey = []byte("test123") // todo: implement option to set jwt secret
type ... |
package model_app_data_model
import (
"encoding/json"
"fmt"
"go-eladmin/common"
"go-eladmin/core/mongo"
"go-eladmin/model/a_mongo_index"
"go-eladmin/model/shareDB"
"time"
"gopkg.in/mgo.v2/bson"
)
//应用和数据模型关联
const (
AppDataModelCollection = mongo_index.CollectionAppDataModel
MaxVersion = 42949... |
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"encoding/json"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt"
"github.com/go-opena... |
// Copyright (c) 2016, 2018, 2022, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei... |
package ot
import (
"errors"
"fmt"
"strconv"
"strings"
"github.com/asadovsky/goatee/server/common"
)
func assert(b bool, v ...interface{}) {
if !b {
panic(fmt.Sprint(v...))
}
}
// Op is an operation.
type Op interface {
Encode() string
Apply(s string) (string, error)
}
// Insert represents a text insert... |
package compose
import (
"bytes"
"fmt"
"strings"
"unicode"
)
var (
StandardValidtator *ComposeValidator
StandardConfig map[string]interface{}
badConfig map[string]string
)
func init() {
badConfig = make(map[string]string)
for _, config := range []string{
"container_name",
"cgroup_parent",
... |
package francetv
import (
"context"
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"net/url"
"regexp"
"strconv"
"sync"
"time"
"github.com/simulot/aspiratv/net/myhttp/httptest"
"github.com/simulot/aspiratv/net/myhttp"
"github.com/simulot/aspiratv/providers"
)
// init registers FranceTV provider
func init(... |
package chain
import (
"math/big"
"time"
"PhoenixOracle/core/assets"
)
type (
ChainSpecificConfig struct {
BalanceMonitorEnabled bool
BalanceMonitorBlockDelay uint16
BlockEmissionIdleWarningThreshold time.Duration
BlockHistoryEstimatorBatchSize ... |
package transaction
import (
"crypto/sha256"
"encoding/json"
"fmt"
"math/big"
"github.com/near/borsh-go"
"github.com/textileio/near-api-go/keys"
)
var (
defaultFunctionCallGas uint64 = 30000000000000
defaultFunctionCallDeposit = *((&big.Int{}).SetInt64(0))
)
// Signature asdf.
type Signature stru... |
// Copyright 2021-2022 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 ingester
import (
"encoding/json"
"fmt"
"net/http"
"time"
almHttp "github.com/dinowernli/almanac/pkg/http"
dc "github.com/dinowernli/almanac/pkg/service/discovery"
"github.com/dinowernli/almanac/pkg/util"
pb_almanac "github.com/dinowernli/almanac/proto"
"github.com/prometheus/client_golang/prometheu... |
// Copyright 2017 Monax Industries Limited
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or a... |
package matf
import (
"encoding/binary"
"fmt"
"io"
"math"
"github.com/pkg/errors"
)
// List of all MAT-File Data Types
const (
MiInt8 int = 1
MiUint8 int = 2
MiInt16 int = 3
MiUint16 int = 4
MiInt32 int = 5
MiUint32 int = 6
MiSingle int = 7
MiDouble int = 9
MiInt64 ... |
package luajitter
/*
#include "go_luajit.h"
*/
import "C"
import (
"errors"
"github.com/baohavan/go-pointer"
"unsafe"
)
func outlyingAllocs() int {
return int(C.outlying_allocs())
}
func clearAllocs() {
C.clear_allocs()
}
var luaValueSize C.size_t = C.size_t(unsafe.Sizeof(C.lua_value{}))
var luaReturnSize C.s... |
// -*- Mode: Go; indent-tabs-mode: t -*-
//
// Copyright (C) 2019 IOTech Ltd
//
// SPDX-License-Identifier: Apache-2.0
/* Apache v2 license
* Copyright (C) <2019> Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
package driver
import (
"fmt"
"regexp"
"strconv"
"strings"
"testing"
)
func TestCrea... |
// Package analyzer provides different commit analyzer
package analyzer
import (
"bufio"
"fmt"
"regexp"
"strings"
"github.com/Nightapes/go-semantic-release/internal/shared"
"github.com/Nightapes/go-semantic-release/pkg/config"
log "github.com/sirupsen/logrus"
)
const breakingChangeKeywords = "BREAKING CHANGE"... |
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//
// Modifications Copyright (c) 2010 AFP Authors
// This source code is released under the terms of the
// MIT license. Please see the file LICENSE for license... |
package cphalo
import (
"fmt"
"time"
"github.com/hashicorp/terraform/helper/schema"
"gitlab.com/kiwicom/cphalo-go"
)
func resourceCPHaloServerGroup() *schema.Resource {
return &schema.Resource{
Schema: map[string]*schema.Schema{
"name": {
Type: schema.TypeString,
Required: true,
},
"descr... |
/*
Ethereum blockchain transaction pool crawler.
Execute:
go run main.go -blockchain ethereum -interval 1
*/
package cmd
import (
"encoding/json"
"flag"
"fmt"
"log"
"os"
"strings"
"time"
settings "github.com/bugout-dev/moonstream/crawlers/txpool/configs"
humbug "github.com/bugout-dev/humbug/go/pkg"
"githu... |
/*
Copyright © 2020 Dell Inc. or its subsidiaries. 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 crud
import (
"errors"
"reflect"
"sync"
"go.uber.org/zap"
"gorm.io/gorm"
"gorm.io/gorm/clause"
"github.com/geometry-labs/icon-blocks/models"
"github.com/geometry-labs/icon-blocks/redis"
)
// BlockCountModel - type for address table model
type BlockCountModel struct {
db *gorm.DB
model ... |
// Part of ndt-server-go <https://github.com/m-lab/ndt-server-go>, which
// is free software under the Apache v2.0 License.
// Package protocol includes the NDT protocol elements
package protocol
import (
"bufio"
"encoding/binary"
"encoding/json"
"errors"
"io"
"log"
"strconv"
)
// Spec: https://github.com/ndt... |
// Copyright 2019 <NAME> and <NAME>. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Package admin implements the "Admin" Cloud Function.
package admin
import (
"context"
"crypto/sha256"
"encoding/hex"
"fmt"
"net/http"
"os"
"string... |
package suggest
import (
"strings"
"sync"
)
//Used for the bloom filter
const (
FNV_BASIS_64 = uint64(14695981039346656037)
FNV_PRIME_64 = uint64((1 << 40) + 435)
FNV_MASK_64 = uint64(^uint64(0) >> 1)
NUM_BITS = 64
FNV_BASIS_32 = uint32(0x811c9dc5)
FNV_PRIME_32 = uint32((1 << 24) + 403)
FNV_MASK_32 = ... |
package server
import (
"io"
"time"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"google.golang.org/grpc"
"github.com/openfresh/plasma/config"
"github.com/openfresh/plasma/event"
"github.com/openfresh/plasma/log"
"github.com/openfresh/plasma/manager"
"github.com/openfresh/plasma/metrics"
"github.com/openfr... |
package lang
import (
"runtime"
"time"
"unsafe"
"github.com/zxh0/jvm.go/jvmgo/options"
"github.com/zxh0/jvm.go/jvmgo/rtda"
"github.com/zxh0/jvm.go/jvmgo/rtda/heap"
)
func init() {
_system(arraycopy, "arraycopy", "(Ljava/lang/Object;ILjava/lang/Object;II)V")
_system(currentTimeMillis, "currentTimeMillis", "()... |
package cmd
import (
"bytes"
"fmt"
"go/ast"
"go/format"
"go/parser"
"go/token"
"io"
"strings"
"github.com/kelveny/mockcompose/pkg/gogen"
"github.com/kelveny/mockcompose/pkg/logger"
)
const (
MATCH_NONE matchType = iota
MATCH_CLONE
MATCH_MOCK
)
type matchType int
type classMethodGenerator struct {
clz... |
package blockchain
import (
"bytes"
"encoding/binary"
"io"
"math"
"github.com/ubclaunchpad/cumulus/common/util"
"gopkg.in/fatih/set.v0"
)
// TxHashPointer is a reference to a transaction on the blockchain.
type TxHashPointer struct {
BlockNumber uint32
Hash Hash
Index uint32
}
// Marshal conve... |
package api
import (
"encoding/json"
"net/http"
"regexp"
gosort "sort"
"strconv"
"strings"
apitype "github.com/openshift/sippy/pkg/apis/api"
"github.com/openshift/sippy/pkg/testgridanalysis/testidentification"
v1sippyprocessing "github.com/openshift/sippy/pkg/apis/sippyprocessing/v1"
"github.com/openshift... |
package endpoints
import (
"context"
"errors"
"time"
"github.com/go-kit/kit/circuitbreaker"
"github.com/go-kit/kit/endpoint"
"github.com/go-kit/kit/log"
kitOpentracing "github.com/go-kit/kit/tracing/opentracing"
kitZipkin "github.com/go-kit/kit/tracing/zipkin"
"github.com/baxiang/soldiers-sortie/go-mircosvc/... |
package main
import (
"fmt"
log "github.com/Sirupsen/logrus"
"github.com/gtfierro/cs262-project/common"
gouuid "github.com/nu7hatch/gouuid"
"github.com/tinylib/msgp/msgp"
"io"
"net"
"runtime"
"time"
)
type Server struct {
address *net.TCPAddr
listener *net.TCPListener
metadata *common.MetadataSt... |
package cmd
import (
"fmt"
"github.com/pkg/errors"
"github.com/gabeduke/kubectl-iexec/pkg/iexec"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"k8s.io/cli-runtime/pkg/genericclioptions"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
)
var (
iexecLong = `
IExec is an interactive pod a... |
// Copyright (c) 2018 <NAME> <<EMAIL>>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notice appear in all copies.
//
// THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIM... |
/*
Copyright 2019 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, ... |
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: sync.proto
/*
Package protos is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package protos
import (
"io"
"net/http"
"github.com/golang/protobuf/proto"
"github.com/golang/protobuf/ptypes/empty"
"github.com/grpc-ecosystem/gr... |
// Copyright 2020 xgfone
//
// 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 main
import (
"bufio"
"flag"
"fmt"
"os"
"strconv"
"strings"
)
var (
methodP *string
)
func parseFlags() {
methodP = flag.String("method", "all", "The method/part that should be run, valid are p1,p2 and test")
flag.Parse()
}
func main() {
parseFlags()
switch *methodP {
case "all":
fmt.Println... |
package cmd
import (
"fmt"
"os"
"path/filepath"
"strings"
"github.com/aoisensi/vmf2datasmith/datasmith/udatasmith"
"github.com/aoisensi/vmf2datasmith/datasmith/udsmesh"
"github.com/aoisensi/vmf2datasmith/vmf"
"github.com/spf13/cobra"
"gonum.org/v1/gonum/spatial/r3"
)
var rootCmd = &cobra.Command{
Use: "v... |
package main
import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"time"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
)
type switchReport struct {
Power float64 `json:"power"`
WattPerSec float64 `json:"Ws"`
Relay ... |
// Package chain contains data structures and functions to process genome to genome alignments pairwise alignment that allow gaps in both sequences simultaneously. Chain files alignments starts with a header line, contains one or more alignment data lines, and terminates with a blank line
package chain
import (
"byte... |
package clientstart
import (
"database/sql"
"github.com/tobz/phosphorus/constants"
"github.com/tobz/phosphorus/database/models"
"github.com/tobz/phosphorus/interfaces"
"github.com/tobz/phosphorus/log"
"github.com/tobz/phosphorus/network"
"github.com/tobz/phosphorus/network/handlers"
"time"
)
func init() {
ha... |
package main
import (
"BookmarkManager/routes"
"context"
"embed"
"errors"
"fmt"
"github.com/gin-contrib/cors"
"github.com/gin-contrib/gzip"
"github.com/gin-gonic/gin"
_ "github.com/joho/godotenv/autoload"
"io"
"io/fs"
"log"
"mime"
"net/http"
"os"
"os/signal"
"path"
"strings"
"syscall"
"time"
)
//g... |
/*
Copyright 2021.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed un... |
/*
Package errors adds context to errors while preserving
the original.
The package shadows the standard library's errors.New and
returns a custom error that has its own stack trace beginning
at the call site.
err := errors.New("whoops")
fmt.Print(err)
The above will output something like this:
Error: whoops
... |
package gpsw06
import (
"github.com/Nik-U/pbc"
)
// NewGPSW06 instantiates a GPSW06 from a set of attributes
func NewGPSW06(attrs []Attribute) (*GPSW06, error) {
// Check ordering of attributes
for i := range attrs {
if uint(i) != attrs[i].id {
return nil, ErrBadAttributeList
}
}
pbc.SetCryptoRandom()
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.