text stringlengths 3.08k 10.4k |
|---|
package loadbalancer
import (
"encoding/json"
"fmt"
"strings"
"github.com/ovn-org/ovn-kubernetes/go-controller/pkg/types"
"github.com/ovn-org/ovn-kubernetes/go-controller/pkg/util"
kapi "k8s.io/api/core/v1"
"k8s.io/klog/v2"
)
// GetOVNKubeLoadBalancer returns the LoadBalancer matching the protocol
// in the ... |
package client
import (
"bytes"
"com/github/graylog-code/config/template"
errorHandler "com/github/graylog-code/error"
"com/github/graylog-code/graylog/api"
"com/github/graylog-code/util"
"encoding/json"
"github.com/google/uuid"
log "github.com/sirupsen/logrus"
"io"
"io/ioutil"
"net/http"
"reflect"
"strin... |
// Copyright 2014 The Cockroach 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 main
import (
"strconv"
"github.com/shurcooL/htmlg"
"golang.org/x/net/html"
"golang.org/x/net/html/atom"
)
func render() *html.Node {
table := &html.Node{Data: atom.Table.String(), Type: html.ElementNode}
// Title
d := &html.Node{
Data: atom.Div.String(),
Type: html.ElementNode,
Attr: []html.A... |
package sqlengine
import (
"database/sql"
"fmt"
"strconv"
"github.com/alphagov/paas-rds-broker/utils"
"github.com/go-sql-driver/mysql"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"code.cloudfoundry.org/lager"
)
func createMysqlDB(connectionString, dbName string) {
db, err := sql.Open("mysql", con... |
package handlers
import (
"fmt"
"net/http"
"net/url"
"github.com/rur/treetop"
"github.com/rur/treetop-demo/ticket/inputs"
)
// newHelpdeskTicket (partial)
// Extends: form
// Method: GET
// Doc: Form designed for creating helpdesk tickets
func NewHelpdeskTicketHandler(rsp treetop.Response, req *http.Request) in... |
package jsonprinter
import (
"fmt"
"github.com/silverstagtech/loggos/jsonmessage"
"github.com/silverstagtech/loggos/overrides"
"github.com/silverstagtech/loggos/shared"
)
// JSONLogger is a logger that implements the functions of this package
type JSONLogger interface {
EnablePrettyPrint(bool)
EnableAuditMode(... |
// Copyright 2017 <NAME>. All rights reserved.
// Copyright 2016 The Upspin Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package errors defines a generalized error handling based on Upspin software.
package errors
import (
"b... |
package handlers
import (
"encoding/json"
"fmt"
"log"
"net/http"
"net/url"
"os"
"path/filepath"
"strings"
id "github.com/google/uuid"
)
// MaxRetries maximum number of retries
const MaxRetries = 5
type ConfigInfo struct {
Indexd IndexdInfo `json:"indexd"`
MetadataService MetadataService... |
package nan0
/**
Service Discovery API
Some features that are implemented here:
DiscoveryService implements Stringer, io.Reader, io.Writer
This API accepts and manages nanoservices
*/
import (
"bufio"
"errors"
"net"
"sync"
"time"
"github.com/yomiji/slog"
"google.golang.org/protobuf/proto"
)
// The Nan0 struct... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: qixue.proto
package cross
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
type ISQiXueDrop... |
package main
// TODO: enable this in production //go:generate build_web -q
//go:generate build_web -q
//go:generate go run github.com/AscensionBlockchain/LandingPage/cmd/server/tools/build_deploy
import (
"crypto/tls"
"fmt"
"net/http"
_ "net/http/pprof"
"os"
"path/filepath"
"runtime"
"strings"
"time"
"gith... |
package gtimer
import (
"testing"
"time"
)
func TestGetTime(t *testing.T) {
tn := time.Now()
t1 := time.Duration(tn.Second()) * time.Millisecond
println(tn.Second())
println(t1)
}
func TestExec(t *testing.T) {
timer := NewTimer()
ntime := time.Now()
qwe := make([]func(), 10)
qwe[0] = func() { print... |
// config-related operations & data
package main
import (
"fmt"
"io"
"io/ioutil"
"os"
"regexp"
"gopkg.in/yaml.v2"
)
var rxList map[string]*regexp.Regexp
// ConfigStruct struct contains main application config
type ConfigStruct struct {
Proxy ProxyConfigStruct `yaml:"proxy,omitempty"`
App AppConfigStruct ... |
// Copyright 2017 <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 cryptica
import (
"bytes"
"fmt"
)
// A wall is an unmovable barrier. Its shape is defined by the Contains
// function.
type Wall interface {
Contains(pos P... |
// Copyright (c) 2020 BlueDino Software (http://bluedino.net)
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
// 1. Redistributions of source code must retain the above copyright notice, this
// list of conditions an... |
// Copyright (c) 2017 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... |
/*
* Copyright 2017 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 i... |
// Package stringext adds extra power to the strings package with helper
// functions
package stringext
import (
"bytes"
"fmt"
"regexp"
"strings"
"unicode"
"unicode/utf8"
)
var (
specialCases = regexp.MustCompile(`(?m)[-.$/:_{}\s]`)
acronyms = regexp.MustCompile(`(Url|Http|Id|Io|Uuid|Api|Uri|Ssl|Cname|Oau... |
// Copyright 2020 WHTCORPS INC, 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 2016 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 burrow
import (
"net/http"
"github.com/gorilla/mux"
)
type Route struct {
Pattern string
Handler HTTPHandler
}
type RouteHandler struct {
Prefix string
Routes []Route
}
func (h *RouteHandler) Subrouter(r *mux.Router) (subrouter *mux.Router) {
subrouter = r.PathPrefix(h.Prefix).Subrouter()
for _, ro... |
/* Package plugin provides tools for loading and registering proxy plugins
*/
// SPDX-License-Identifier: Apache-2.0
package plugin
import (
"fmt"
"plugin"
"strings"
"github.com/luraproject/lura/logging"
luraplugin "github.com/luraproject/lura/plugin"
"github.com/luraproject/lura/register"
)
const (
// Names... |
// +build linux,cgo,!agent
package db
import (
"database/sql"
"fmt"
"github.com/lxc/lxd/lxd/db/query"
"github.com/lxc/lxd/shared/api"
"github.com/pkg/errors"
)
// Code generation directives.
//
//go:generate -command mapper lxd-generate db mapper -t projects.mapper.go
//go:generate mapper reset
//
//go:generat... |
package dns
import (
"bytes"
"ddns-go/config"
"ddns-go/util"
"encoding/json"
"fmt"
"log"
"net/http"
"strconv"
)
const (
zonesAPI string = "https://api.cloudflare.com/client/v4/zones"
)
// Cloudflare Cloudflare实现
type Cloudflare struct {
DNSConfig config.DNSConfig
Domains config.Domains
TTL int
}
... |
// Copyright 2014 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 applicabl... |
// Copyright © 2021 Alibaba Group Holding Ltd.
//
// 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 output
import (
"bytes"
"strings"
"text/template"
"github.com/yoozoo/protoapi/generator/data"
plugin "github.com/golang/protobuf/protoc-gen-go/plugin"
)
/**
* Map go type to ts types
*/
var tsTypes = map[string]string{
"int": "number",
"double": "number",
"float": "number",
"int32": ... |
package entity
import (
"github.com/go-gl/mathgl/mgl64"
"github.com/sunproxy/sunfly/dragonfly/entity/physics"
"github.com/sunproxy/sunfly/dragonfly/world"
"math"
)
// boxes returns the axis aligned bounding box of a block.
func boxes(b world.Block, pos world.BlockPos, w *world.World) []physics.AABB {
return b.Mo... |
// 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-2019 Datadog, Inc.
package obfuscate
import (
"bytes"
"errors"
"github.com/DataDog/datadog... |
package structures
import (
"github.com/seventv/common/utils"
"go.mongodb.org/mongo-driver/bson/primitive"
)
type Role struct {
ID primitive.ObjectID `json:"id" bson:"_id"`
// the role's name
Name string `json:"name" bson:"name"`
// the role's privilege position
Position int32 `json:"position" bson:"position"`... |
package output
import (
"math"
"time"
"github.com/gnames/gnfinder/config"
"github.com/gnames/gnfinder/ent/token"
vlib "github.com/gnames/gnlib/ent/verifier"
)
// Output type is the result of name-finding.
type Output struct {
Meta `json:"metadata"`
InputText string `json:"inputText,omitempty"`
Names ... |
package codec
import (
"time"
"github.com/MadDogTechnology/telegraf/plugins/inputs/zipkin/trace"
"github.com/openzipkin/zipkin-go-opentracing/thrift/gen-go/zipkincore"
)
//now is a mockable time for now
var now = time.Now
// DefaultServiceName when the span does not have any serviceName
const DefaultServiceName ... |
// 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 protocol
import (
"bytes"
"crypto/sha256"
"crypto/x509"
"encoding/base64"
"fmt"
"time"
"github.com/golang-jwt/jwt/v4"
"github.com/mitchellh/mapstructure"
"github.com/go-webauthn/webauthn/metadata"
)
var safetyNetAttestationKey = "android-safetynet"
func init() {
RegisterAttestationFormat(safetyNe... |
// Copyright (C) 2014 The Syncthing Authors.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// You can obtain one at https://mozilla.org/MPL/2.0/.
package main
import (
"bytes"
"compress/gzip"
"fmt"
"io/ioutil"... |
// Copyright 2019-2020 Intel Corporation. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required b... |
// Copyright 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 or agreed ... |
// Copyright 2020 BlueCat Networks. All rights reserved
package bluecat
import (
"fmt"
"strconv"
"strings"
"terraform-provider-bluecat/bluecat/utils"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
)
// ResourceIPAssociation The IP Association
func ResourceIPAssociation() *schema.Resource {
return &... |
package zenutil
import (
"image/color"
"testing"
"golang.org/x/image/colornames"
)
func TestColorEquals(t *testing.T) {
if ColorEquals(nil, nil) == false {
t.Error("ColorEquals(nil, nil) == false")
}
if ColorEquals(nil, color.Black) == true {
t.Error("ColorEquals(nil, color.Black) == true")
}
if ColorEqu... |
package validator
import (
"context"
"encoding"
"fmt"
"reflect"
"regexp"
"unicode/utf8"
"github.com/go-courier/schema/pkg/validator/rules"
)
var (
TargetStringLength = "string length"
)
type StrLenMode string
const (
StrLenModeLength StrLenMode = "length"
StrLenModeRuneCount StrLenMode = "rune_count"
... |
package bashscriptbasedphases
import (
"context"
"errors"
"fmt"
"time"
"github.com/cenkalti/backoff"
"github.com/platform9/nodelet/nodelet/pkg/utils/command"
"github.com/platform9/nodelet/nodelet/pkg/utils/config"
"github.com/platform9/nodelet/nodelet/pkg/utils/constants"
sunpikev1alpha1 "github.com/platform... |
package main
import (
"bufio"
"context"
"encoding/json"
"fmt"
"io/ioutil"
"net"
"strconv"
"strings"
"github.com/adevinta/vulcan-check-sdk"
"github.com/adevinta/vulcan-check-sdk/helpers"
"github.com/adevinta/vulcan-check-sdk/state"
"github.com/adevinta/vulcan-report"
"github.com/sirupsen/logrus"
)
var (
... |
package baggageclaimcmd
import (
"fmt"
"net/http"
"os"
"regexp"
"code.cloudfoundry.org/lager"
"github.com/concourse/concourse/worker/baggageclaim/api"
"github.com/concourse/concourse/worker/baggageclaim/uidgid"
"github.com/concourse/concourse/worker/baggageclaim/volume"
"github.com/concourse/flag"
"github.c... |
/*
Copyright 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, softw... |
// Package worker accepts Jobs and places them in a queue to be executed N at a time.
package worker
import (
"sync"
"time"
)
// MaxJobs is the default amount of jobs to run at a time. This can be changed per Worker object as well.
var MaxJobs = 4
// A Job is an object with a Run() method, which is expected to com... |
package handler
import (
"encoding/json"
"io/ioutil"
"net/http"
"net/url"
"regexp"
"strings"
"sync"
"github.com/neucn/ipgw/pkg/model"
"github.com/neucn/ipgw/pkg/utils"
"github.com/neucn/neugo"
)
var (
once sync.Once
)
type IpgwHandler struct {
info *model.Info
client *http.Client
oriInfo map[strin... |
package k8sworkerpool
import (
"context"
"fmt"
"os"
"strconv"
"sync"
"github.com/go-logr/logr"
"github.com/stolostron/leaf-hub-spec-sync/pkg/controller/rbac"
"k8s.io/client-go/rest"
ctrl "sigs.k8s.io/controller-runtime"
)
const (
envVarK8sClientsPoolSize = "K8S_CLIENTS_POOL_SIZE"
defaultK8sClientsPoolSiz... |
package cmd
import (
"bytes"
"encoding/json"
"fmt"
"github.com/elastic/go-elasticsearch/v7"
"github.com/elastic/go-elasticsearch/v7/esapi"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/toughnoah/blackbean/pkg/es"
"io"
"log"
)
var (
clusterConcurrentRebalanced string
nodeConcurrentRecover... |
package ws
import (
"fmt"
"math/rand"
"reflect"
"testing"
)
func TestCipher(t *testing.T) {
type test struct {
name string
in []byte
mask [4]byte
offset int
}
cases := []test{
{
name: "simple",
in: []byte("Hello, XOR!"),
mask: [4]byte{1, 2, 3, 4},
},
{
name: "simple",
in:... |
package collision
//doubly linked list of arbiters
type ArbiterList struct {
Arbiter *Arbiter
length int
}
//new arbiters are inserted at the front of the list
func (arbList *ArbiterList) Add(arb *Arbiter) {
if arbList.Arbiter != nil {
arbList.Arbiter.Prev = arb
arb.Next = arbList.Arbiter
}
arbList.Arbiter ... |
package backupAndRestore
import (
"reflect"
"strings"
"testing"
"time"
"github.com/google/uuid"
. "github.com/kyma-project/kyma/tests/end-to-end/backup-restore-test/backupe2e"
. "github.com/kyma-project/kyma/tests/end-to-end/backup-restore-test/backupe2e/asset-store"
. "github.com/kyma-project/kyma/tests/end... |
// Copyright © 2021 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unle... |
// Copyright Fuzamei Corp. 2018 All Rights Reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package executor
import (
"encoding/hex"
"github.com/33cn/chain33/common"
"github.com/33cn/chain33/types"
ty "github.com/33cn/plugin/plugin/dapp/... |
// 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... |
// Copyright 2019, OpenTelemetry 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... |
// 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... |
// Copyright 2019 The Cockroach 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 cleanup
import (
"context"
"errors"
"io/ioutil"
"os"
"path"
"time"
"github.com/grafana/grafana/pkg/services/shorturls"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/infra/log"
"github.com/grafana/grafana/pkg/infra/serverlock"
"github.com/grafana/grafana/pkg/models"
"github.... |
package types
import (
"fmt"
. "github.com/protolambda/zssz/dec"
. "github.com/protolambda/zssz/enc"
. "github.com/protolambda/zssz/htr"
"github.com/protolambda/zssz/merkle"
. "github.com/protolambda/zssz/pretty"
"reflect"
"unsafe"
)
type SSZVector struct {
length uint64
elemMemSize uintptr
elemSSZ ... |
package cmd
import (
"io/ioutil"
"net"
"os/user"
"time"
"github.com/Sirupsen/logrus"
"github.com/urfave/cli"
"golang.org/x/crypto/ssh"
)
func SSH() cli.Command {
sshFlags := []cli.Flag{
cli.StringFlag{
Name: "target, t",
Usage: "The IP/Hostname of the target node",
Value: "localhost",
},
cli.... |
/*
* Minio Go Library for Amazon S3 Compatible Cloud Storage (C) 2017 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
... |
package controllers
import (
"context"
"fmt"
"io/ioutil"
"os"
"path"
"strings"
"time"
"github.com/go-logr/logr"
"github.com/txn2/txeh"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
ctrl "sigs.k8s.io/controller-runtime"
"sigs.k8s.io/controller-runtime/pkg/... |
package main
import (
"context"
"encoding/json"
"fmt"
"os"
"syscall"
"time"
"github.com/mtrense/ticker/eventstream/memory"
"github.com/mtrense/ticker/eventstream/base"
"github.com/mtrense/ticker/client"
"github.com/mtrense/ticker/support"
"github.com/mtrense/soil/logging"
"github.com/mtrense/ticker/r... |
package main
import (
"bufio"
"container/list"
"context"
"errors"
"io"
"net/http"
"strconv"
"strings"
"sync"
"time"
"nhooyr.io/websocket"
)
type fileReceiver struct {
w http.ResponseWriter
r *http.Request
cancelWait func()
done chan bool
}
var (
fileCounter uint32 = 0
file... |
// Copyright (C) 2017 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 t... |
package main
import (
"fmt"
"log"
"os"
"time"
//"github.com/pkg/errors"
"github.com/spf13/pflag"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"github.com/imorph/gate-keeper/pkg/server"
"github.com/imorph/gate-keeper/pkg/signals"
"github.com/imorph/gate-keeper/pkg/version"
)
func main() {
if err := run();... |
/*
* Copyright 2019 The NATS 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 main
import (
"database/sql"
"sync"
"time"
"github.com/go-sql-driver/mysql"
)
type database struct {
db *sql.DB
insertban chan *dbInsertBan
deleteban chan *dbDeleteBan
sync.Mutex
}
type dbInsertBan struct {
uid Userid
targetuid Userid
ipaddress *sql.NullString
r... |
package server
import (
"context"
"fmt"
"os"
"os/exec"
"os/signal"
"path/filepath"
"runtime"
"strings"
"sync/atomic"
"syscall"
"time"
"github.com/xiusin/logger"
"github.com/xiusin/pinecms/cmd/util"
"github.com/fsnotify/fsnotify"
"github.com/spf13/cobra"
)
var (
devCmd = &cobra.Command{
Use: "dev... |
// Copyright (c) 2011-2017, HL7, Inc & The MITRE Corporation
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistributions of source code must retain the above copyright notice, ... |
/*
Copyright © 2020 Red Hat, 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 writing, software... |
// Package at24cx provides a driver for the AT24C32/64/128/256/512 2-wire serial EEPROM
//
// Datasheet:
// https://www.openimpulse.com/blog/wp-content/uploads/wpsc/downloadables/24C32-Datasheet.pdf
package at24cx // import "github.com/Nerzal/drivers/at24cx"
import (
"errors"
"time"
"tinygo.org/x/drivers"
)
// De... |
package protocol
import (
"crypto/md5"
"fmt"
"io"
"net"
"github.com/johnshiver/rocky/config"
"github.com/johnshiver/rocky/netcon"
)
func handleAuthentication(backendConfig *config.BackendHostSetting, connection net.Conn, authType int32) bool {
switch authType {
case AuthenticationKerberosV5:
pLogger.Print... |
package main
import (
"bytes"
"encoding/binary"
"strings"
"unicode/utf16"
)
const PlaceHolderString = "==== THIS IS PLACEHOLDER TEXT PLEASE DO NOT TRANSLATE ===="
// TXT represents the text data of the txt1 section
type TXT struct {
Flag uint8
Origin uint8
Alpha uint8
_ ... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package personalize
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type ListDatasetImportJobsInput struct {
_ struct{} `type:"structure"`
// The Amazon Resource Name (ARN) of the datas... |
/*
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
/*
Copyright 2019 NetFoundry, 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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... |
package driver
import "cloudtask/common/models"
import "cloudtask/libtools/gounits/logger"
import (
"fmt"
"strings"
"sync"
"time"
)
//Driver is exported
type Driver struct {
sync.RWMutex
CoreHandler
Root string
jobs map[string]*Job
handler IDriverHandler
}
//NewDirver is exported
func NewDirver(root ... |
package model
import (
"errors"
"fmt"
"io"
"reflect"
"gopkg.in/yaml.v2"
)
//load yaml
//build step order
//
//CF ...
type Metadata struct {
Name string `yaml:"name"`
Type string `yaml:"type"`
Title string `yaml:"title"`
Desc string `yaml:"description"`
}
type Scale struct {
Scale []string
Matrix []st... |
package sqlstore
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
"github.com/grafana/grafana/pkg/components/simplejson"
m "github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/services/search"
)
func insertTestDashboard(title string, orgId int64, tags ...interface{}) *m.Dashbo... |
package client
import (
"context"
"errors"
"fmt"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
"os"
"strings"
)
const (
//masterNodeLabel is the label name associated with master nodes.
masterNodeLabel = "node-role.kubernetes.io/master"
//EnvLiqo... |
package main
import (
"fmt"
"os"
"regexp"
"time"
"github.com/mitchellh/go-homedir"
log "github.com/sirupsen/logrus"
"github.com/jpillora/opts"
hc2 "github.com/theovassiliou/hc2-tools/pkg"
)
//set this via ldflags (see https://stackoverflow.com/q/11354518)
var (
version = hc2.Version
commit string
branc... |
/*
* Copyright (c) 2021 VMware, 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, publish, ... |
// Copyright (c) 2017 <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 main
import (
"go/ast"
"go/types"
"sort"
"strings"
"golang.org/x/tools/go/loader"
)
func fillSwitch(pkg *loader.PackageInfo, lprog *loader.Program, ... |
/*
Package apexovernsq provides a handler for github.com/apex/log.
It's intended to act as a transport to allow log.Entry structs to pass
through nsq and be reconstructed and passed to another handler on the
other side.
*/
package apexovernsq
import (
"fmt"
"math"
"sync"
"time"
"github.com/apex/log"
"github.com... |
package main
import (
"binance-trading-webhook/handler"
"binance-trading-webhook/marketmaker"
"binance-trading-webhook/marketprice"
"binance-trading-webhook/pkg/logger"
"context"
"fmt"
"os"
"os/signal"
"runtime"
"syscall"
"time"
"github.com/adshao/go-binance/v2/futures"
"github.com/gofiber/fiber/v2"
"gi... |
// Copyright © 2018 C45tr0 <<EMAIL>>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish... |
// Copyright 2014 <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 orchestrator
import (
"github.com/andreaskoch/allmark/common/route"
"github.com/andreaskoch/allmark/web/view/viewmodel"
"fmt"
"math"
"net/url"
)
var (
... |
// Copyright 2010 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 utf16_test
import (
"reflect"
"testing"
"unicode"
. "unicode/utf16"
)
// Validate the constants redefined from unicode.
func TestConstants(t *tes... |
package main
import (
"context"
"encoding/xml"
"errors"
"fmt"
"io"
"log"
"os"
"github.com/google/go-containerregistry/pkg/name"
"github.com/google/go-containerregistry/pkg/v1/remote"
"github.com/quay/claircore"
"github.com/quay/zlog"
"github.com/urfave/cli/v2"
"golang.org/x/sync/errgroup"
"github.com/q... |
package projecteuler
// finds number of ways we can choose
// m number of elements from n elements, where n >= m
//
// using pascal triangle for computing so
func binomialCoeff(n int, m int) int {
buffer := make([][]int, n+1)
for i := 0; i < n+1; i++ {
buffer[i] = make([]int, n+1)
buffer[i][0] = 1
}
for i := 0... |
// Copyright 2015 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 gensupport
import (
"encoding/json"
"fmt"
"reflect"
"strings"
)
// MarshalJSON returns a JSON encoding of schema containing only selected fields.
... |
package merr
import (
"bytes"
"errors"
"fmt"
"io"
"os"
"reflect"
"strings"
"sync"
"text/tabwriter"
)
// tabwriter parameter
const (
minWidth = 2
tabwidth = 0
padding = 1
padchar = " "
)
var (
defaultOutput io.Writer = os.Stdout
output io.Writer = defaultOutput
)
var formatter = func(e *errs)... |
package service
import (
"context"
"errors"
"fmt"
pbAS "github.com/go-ocf/cloud/authorization/pb"
"github.com/go-ocf/cloud/coap-gateway/coapconv"
pbCQRS "github.com/go-ocf/cloud/resource-aggregate/pb"
gocoap "github.com/go-ocf/go-coap"
coapCodes "github.com/go-ocf/go-coap/codes"
"github.com/go-ocf/kit/codec/... |
package debug
import (
"bytes"
"fmt"
"io"
"reflect"
"runtime"
"sort"
"strings"
)
// Printf is a wrapper around fmt.Printf to add TRACE tags and file & line info.
// This is very useful for development since we can just search logs for the
// [TRACE] tag, and the file line information make.
//
// WARNING: MAKE ... |
package types
import (
"encoding/json"
sdkerror "github.com/cosmos/cosmos-sdk/types/errors"
"github.com/tendermint/tendermint/crypto"
sdk "github.com/cosmos/cosmos-sdk/types"
)
// ensure Msg interface compliance at compile time
var (
_ sdk.Msg = &MsgCreateValidator{}
_ sdk.Msg = &MsgEditValidator{}
)
//____... |
package chaos
import (
"context"
"fmt"
"strings"
"sync"
"github.com/turbot/steampipe-plugin-sdk/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/plugin"
"github.com/turbot/steampipe-plugin-sdk/plugin/transform"
)
const matrixKeyRegion = "region"
var listCalls int
var hydrateCalls int
var mut sync.Mutex
/... |
// Copyright 2021 The Casdoor 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 ... |
// Package globalstats provides configurable singleton stats instance for ctlstore.
// It is heavily inspired by segmentio/flagon.
package globalstats
import (
"context"
"os"
"path/filepath"
"sync/atomic"
"time"
"github.com/segmentio/ctlstore/pkg/version"
"github.com/segmentio/errors-go"
"github.com/segmentio... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.