text stringlengths 3.08k 10.4k |
|---|
package aws
import (
"fmt"
"io"
"os"
"sort"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/service/cloudwatchlogs"
"github.com/aws/aws-sdk-go/service/ecs"
"github.com/convox/rack/api/structs"
)
func (p *AWSProvider) LogStream(app string, ... |
package kouplettest
import (
"bytes"
"context"
"fmt"
"io"
"os"
"time"
apiv1alpha1 "github.com/jgwest/kouplet/pkg/apis/api/v1alpha1"
"github.com/jgwest/kouplet/pkg/controller/shared"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
kubeerrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachine... |
/*
* Copyright (c) 2019 WSO2 Inc. (http:www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you 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/license... |
package main
import (
"bytes"
"encoding/hex"
"encoding/json"
"flag"
"fmt"
"io"
"log"
"net/http"
"strings"
"time"
"github.com/chain/txvm/crypto/ed25519"
"github.com/chain/txvm/errors"
"github.com/chain/txvm/protocol/bc"
"github.com/stellar/go/clients/horizon"
"github.com/interstellar/slingshot/slidecha... |
package configs
var RbacModel = `
[request_definition]
r = org, proj, obj, act
[policy_definition]
p = sub, obj, act
[role_definition]
g = _, _
[policy_effect]
e = some(where (p.eft == allow))
[matchers]
# 按角色授权访问权限,动作为 * 的允许所有动作权限(适用于各类管理员)
# (r.org == p.sub || r.proj == p.sub) && r.obj == p.obj && (r.act == p.ac... |
package main
import (
"encoding/json"
"fmt"
"log"
"os"
"time"
"github.com/spf13/pflag"
"github.com/spf13/viper"
)
type consulConfig struct {
URL string `json:"url"`
Token string `json:"token"`
LockKey string `json:"lock-key"`
LockTimeout time.Duration `json:"lock-tim... |
package models
import (
"net"
"strconv"
"net/url"
log "github.com/sirupsen/logrus"
)
// Object to store CIDR
type Prefix struct {
net *net.IPNet
Addr string
PrefixLen int
}
const IP_PREFIX_LENGTH int = 32
/*
* Convert to CIDR strings.
*/
func (p *Prefix) String() string {
return p.net.String()
}
//... |
// Package itftp implements a TFTP server for iPXE binaries.
package itftp
import (
"bytes"
"context"
"fmt"
"io"
"net"
"os"
"path"
"path/filepath"
"regexp"
"github.com/go-logr/logr"
"github.com/pin/tftp"
"github.com/tinkerbell/ipxedust/binary"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/attribu... |
/*
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 tfgen
import (
"encoding/json"
"fmt"
"io/ioutil"
"strings"
"testing"
bf "github.com/russross/blackfriday/v2"
"github.com/stretchr/testify/assert"
)
func TestParseTextSeq(t *testing.T) {
turnaround := func(src string) {
res, err := parseTextSeq(parseNode(src).FirstChild, true)
if err != nil {
t... |
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may... |
package main
import (
"bufio"
"fmt"
"go/ast"
"go/parser"
"go/token"
"os"
"path/filepath"
"regexp"
"strconv"
"strings"
)
const (
cosPkgPath = "github.com/coschain/contentos-go"
)
type statements struct {
BeginLine, BeginCol, EndLine, EndCol int
Count int
}
type coverage struct {
statements
Cover int
}... |
package mux
import (
"net/http"
"strings"
"sync"
)
// HandlerFunc defines a std net/http HandlerFunc, but which returns an error.
type HandlerFunc func(w http.ResponseWriter, r *http.Request) error
// ErrorHandlerFunc defines a HandlerFunc which accepts an error and displays it.
type ErrorHandlerFunc func(w http.... |
package main
import (
"bufio"
"fmt"
"log"
"os"
"strconv"
"github.com/RyanCarrier/dijkstra"
)
type Coordinate struct {
row int
col int
}
type RiskMap [][]int
type BigMap [][]RiskMap
func main() {
riskmap := Loader("input.txt")
Part1(riskmap)
Part2(riskmap)
}
func Part1(riskmap [][]int) {
mapSz := Coord... |
package main
import (
"bytes"
"crypto/hmac"
"crypto/md5"
"crypto/sha1"
"encoding/hex"
"fmt"
"io"
"net/http"
"os"
"sort"
"strings"
"unsafe"
)
const (
FILE_SERVER_SECRET_KEY = "FILE_SERVER_SECRET_KEY"
FILE_SERVER_TOKEN = "FILE_SERVER_TOKEN"
)
var (
// 文件根目录
RootDir = os.Getenv("DATA_DIR")
// 用于文... |
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
/*
*
* Copyright 2017 gRPC 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 agree... |
package main
//go:generate go run github.com/1and1/pg-exporter/gen -i ./collector/models -o collector/models
import (
"context"
"net/http"
"os"
"strconv"
"time"
"github.com/go-pg/pg/v9"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/pro... |
package rgw
/*
#cgo LDFLAGS: -lrgw
#cgo CPPFLAGS: -D_FILE_OFFSET_BITS=64
#include <stdlib.h>
#include <rados/librgw.h>
#include <rados/rgw_file.h>
*/
import "C"
import "fmt"
import "unsafe"
import "strings"
type CephError int
func (e CephError) Error() string {
return fmt.Sprintf("rgw: ret=%d", e)
}
func Create(ar... |
package remote
import (
"bytes"
"cke/log"
"cke/vm/image"
"cke/vm/model"
"encoding/json"
"encoding/xml"
"github.com/libvirt/libvirt-go"
"io/ioutil"
"net/http"
)
/*****************
Author: Chen
Date: 2019/8/9
Comp: ChinaUnicom
****************/
type DiskDriver struct {
Nam... |
package guard
import (
"context"
"encoding/json"
"errors"
"fmt"
"github.com/coreos/etcd/clientv3"
"sync"
"time"
)
var PathError = errors.New("The path cannot be empty ")
var RegisterExistError = errors.New("The current path already exists ")
var NotAllowMultiError = errors.New("The current service does not all... |
package main
import (
"bytes"
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"ssl_scan/certificateutils"
"sync"
"time"
)
type flags struct {
notificationThreshold int
connectionTimeout int
remoteSite string
remoteSiteFile string
publicCertificate string
}
func readFile(fileName string) [... |
// Package awsauth implements AWS request signing using Signed Signature Version 2,
// Signed Signature Version 3, and Signed Signature Version 4. Supports S3 and STS.
package awsauth
import (
"net/http"
"net/url"
"sync"
"time"
)
// Credentials stores the information necessary to authorize with AWS and it
// is f... |
package rowgateway
import (
"fmt"
"github.com/Masterminds/squirrel"
"github.com/extensible-cms/ecms-go/admin/db/provider"
. "github.com/extensible-cms/ecms-go/admin/db/rowproto"
. "github.com/extensible-cms/ecms-go/admin/db/tablegateway"
"github.com/extensible-cms/ecms-go/framework/datautils/io"
"strconv"
"tes... |
package aws
import (
"context"
"sync"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/sns"
"github.com/aws/aws-sdk-go/service/sns/snsiface"
"github.com/aws/aws-sdk-go/service/sqs"
"github.com/aws/aws-sdk-go/service/sqs/sqsiface"
pubsub "github.com/infobloxopen/atlas-pubsub"
)
// Ne... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: attestation.proto
package types
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a comp... |
// Poseidon
// Copyright (c) The Poseidon 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
//
// THIS... |
/*
* Copyright (c) 2002-2019 "Neo4j,"
* Neo4j Sweden AB [http://neo4j.com]
*
* This file is part of Neo4j.
*
* 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.... |
// Copyright 2016 FullStory, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
package sshChannel
import (
"bytes"
"encoding/json"
"fmt"
"github.com/gorilla/websocket"
"golang.org/x/crypto/ssh"
"io"
"log"
"net"
"sync"
"time"
)
// write data to WebSocket
// the data comes from ssh server.
type wsBufferWriter struct {
buffer bytes.Buffer
mu sync.Mutex
}
// connect to ssh server u... |
package maxconnections
import (
"context"
"testing"
"time"
"github.com/openshift/image-registry/pkg/testutil/counter"
)
func TestLimiter(t *testing.T) {
const timeout = 1 * time.Second
maxRunning := 2
maxInQueue := 3
maxWaitInQueue := time.Duration(1) // any non-zero value, we redefine newTimer for this tes... |
package widgets
import (
"errors"
"fmt"
"math"
"io/fs"
"io/ioutil"
"log"
"os"
"sort"
"strconv"
tui "github.com/gizak/termui/v3"
tWidgets "github.com/gizak/termui/v3/widgets"
"github.com/sunghun7511/gotop/core"
"github.com/sunghun7511/gotop/model"
)
func getFormattedString(pid, user, cpu, mem, cmd strin... |
package base
import (
"context"
"strings"
"time"
common "github.com/ShoshinNikita/budget-manager/internal/db"
"github.com/ShoshinNikita/budget-manager/internal/db/base/internal/sqlx"
"github.com/ShoshinNikita/budget-manager/internal/db/base/types"
"github.com/ShoshinNikita/budget-manager/internal/pkg/money"
)
... |
package documents
import (
"bytes"
"context"
"time"
coredocumentpb "github.com/centrifuge/centrifuge-protobufs/gen/go/coredocument"
"github.com/centrifuge/go-centrifuge/errors"
"github.com/centrifuge/go-substrate-rpc-client/v2/scale"
logging "github.com/ipfs/go-log"
"github.com/perlin-network/life/exec"
)
va... |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
package ok
import (
"encoding/csv"
"fmt"
"io"
"reflect"
"strconv"
"strings"
"time"
)
func csvToArgs(types []string, r io.Reader, comma rune) (result [][]interface{}, err error) {
reader := csv.NewReader(r)
reader.Comma = comma
for columns := []string{}; ; {
if columns, err = reader.Read(); err != nil {
... |
package pingfederate
import (
"fmt"
"regexp"
"testing"
"github.com/iwarapter/pingfederate-sdk-go/services/dataStores"
"github.com/stretchr/testify/assert"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terrafor... |
// Copyright 2020 The jackal 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 e2e
import (
"fmt"
"os"
"strings"
"testing"
"time"
osv1 "github.com/openshift/api/route/v1"
osv1sec "github.com/openshift/api/security/v1"
framework "github.com/operator-framework/operator-sdk/pkg/test"
"github.com/operator-framework/operator-sdk/pkg/test/e2eutil"
"github.com/stretchr/testify/assert... |
// Copyright 2015-2016 <NAME>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
package app
import (
"context"
"encoding/json"
"os"
// v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
appsv1 "k8s.io/api/apps/v1"
batchv1 "k8s.io/api/batch/v1"
batchv1beta1 "k8s.io/api/batch/v1beta1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime/serial... |
// Code generated by protoc-gen-go.
// source: pb/money/money.proto
// DO NOT EDIT!
package pbmoney
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
ty... |
package template
import (
"encoding/json"
"fmt"
"reflect"
"regexp"
"strings"
"github.com/mlab-lattice/lattice/pkg/definition/tree"
definitionv1 "github.com/mlab-lattice/lattice/pkg/definition/v1"
)
const parametersField = "$parameters"
var (
variableRegex = regexp.MustCompile(`\$\{([a-zA-Z_$][a-zA-Z_$... |
// Code generated by go-swagger; DO NOT EDIT.
package entitlement
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.... |
// Copyright 2019 <NAME>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute... |
/*
The MIT License (MIT)
Copyright (c) 2020 <NAME> https://github.com/mrngm/infping
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 rig... |
package stats
import (
"bytes"
"context"
"encoding/json"
"fmt"
"log"
"strings"
"vindr-lab-api/entities"
"vindr-lab-api/utils"
"github.com/elastic/go-elasticsearch/v7"
"github.com/elastic/go-elasticsearch/v7/esapi"
"go.uber.org/zap"
)
type kvStr2Inf = map[string]interface{}
type LabelExportES struct {
e... |
/*
* Copyright 2018 - <NAME>
*
* ETCD Client interface
*
*/
package etcdclient
import (
"fmt"
"strconv"
"time"
"github.com/coreos/etcd/client"
"github.com/zieckey/etcdsync"
"golang.org/x/net/context"
)
type Callback func(cl *IntentEtcdClient, index uint64, key, newValue string)
type EtcdClient int... |
package gocipher
import (
"errors"
"sort"
"strings"
)
/*
* Morse code
* https://morsecode.scphillips.com/translator.html
*/
type Morse struct {
textToMorse map[string]string
morseToText map[string]string
textLengths []int // For multi-character tokens like prosigns and CH
morseLengths []int // For multi... |
package transaction
import (
"encoding/hex"
"encoding/json"
"fmt"
"github.com/MinterTeam/minter-go-node/core/code"
"github.com/MinterTeam/minter-go-node/core/commissions"
"github.com/MinterTeam/minter-go-node/core/state"
"github.com/MinterTeam/minter-go-node/core/state/accounts"
"github.com/MinterTeam/minter-g... |
package wms130
import (
"net/url"
"strconv"
"strings"
)
//getMapRequestParameterValue struct
type getMapRequestParameterValue struct {
// Table 8 - The Parameters of a GetMap request
service string `yaml:"service,omitempty"`
baseParameterValueRequest
getMapParameterValueMandatory
getMapParameterValueOptional
... |
package pak
import "fmt"
type Bin struct {
W, H float64
Boxes []*Box
FreeRectangles []*FreeSpaceBox
Heuristic *Base
}
func NewBin(w float64, h float64, s *Base) *Bin {
if s == nil {
s = &Base{&BestAreaFit{}}
}
return &Bin{w, h, nil, []*FreeSpaceBox{{W: w, H: h}}, s}
}
func (b *Bin)... |
package core
import (
"gcloudsync/internal/common"
"gcloudsync/internal/config"
"gcloudsync/internal/fsops"
"gcloudsync/internal/fswatcher"
"gcloudsync/internal/network"
"log"
)
type ClientCore struct {
client network.ITCPClient
watchPath string
eventChan chan common.FsEvent
eventDone chan bool
}
func N... |
// Unless explicitly stated otherwise all files in this repository are licensed
// under the MIT License.
// This product includes software developed at Guance Cloud (https://www.guance.com/).
// Copyright 2021-present Guance, Inc.
// Package ddtrace handle DDTrace APM traces.
package ddtrace
import (
"net/http"
"t... |
package crawler
import (
"errors"
"github.com/RadioCheckerApp/api/model"
"github.com/RadioCheckerApp/crawlers/fetcher"
"reflect"
"testing"
"time"
)
type MockHomeBaseSuccess struct{}
func (api MockHomeBaseSuccess) getLatestTrackRecord(stationId string) (*model.TrackRecord, error) {
return &model.TrackRecord{
... |
package myrevenue
import (
"fmt"
"log"
"net/http"
"net/http/httputil"
"strconv"
"strings"
"time"
)
type Model struct {
NetworkName string `json:"network_id"`
DateTime time.Time `json:"date_time"` // ISO 8601
Name string `json:"name"`
Country string `json:"country"` // 2-letter countr... |
package main
import (
"flag"
"fmt"
"log"
"os"
"os/exec"
"strings"
"time"
"github.com/BurntSushi/xgb"
"github.com/BurntSushi/xgb/screensaver"
"github.com/BurntSushi/xgb/xproto"
"github.com/esiqveland/notify"
"github.com/godbus/dbus"
"github.com/google/shlex"
)
func getSleepTime(con *xgb.Conn, drawable xp... |
//----------------------------------------
// 代码由GenlibVcl工具自动生成。
// Copyright © ying32. All Rights Reserved.
//
//----------------------------------------
package vcl
import (
. "github.com/ying32/govcl/vcl/api"
. "github.com/ying32/govcl/vcl/types"
"unsafe"
)
type TTextAttributes struct {
IObject
... |
/*
Copyright 2018 Turbine Labs, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... |
package electreIII
import (
"encoding/json"
. "github.com/Azbesciak/RealDecisionMaker/lib/model"
"github.com/Azbesciak/RealDecisionMaker/lib/utils"
"testing"
)
var power = "power"
var safety = "safety"
var cost = "cost"
var powerCriterion = &Criterion{Id: power, Type: Gain}
var safetyCriterion = &Criterion{Id: sa... |
/*
Copyright © 2021-2022 <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 to in writing, so... |
package main
import (
"crypto/tls"
"crypto/x509"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"time"
MQTT "github.com/eclipse/paho.mqtt.golang"
"github.com/google/uuid"
"github.com/the-sibyl/goMAX31856"
)
var (
subTopics = []string{
"/cooktroller/charles/smoker/set_temp",
"/cooktroller/charles/smoker/runst... |
package parser
import (
"errors"
"github.com/modern-go/msgfmt/parser/ast"
"github.com/modern-go/parse"
"github.com/modern-go/parse/discard"
"github.com/modern-go/parse/read"
"unicode"
)
type Lexer struct {
leftCurly *leftCurlyToken
literal *literalToken
variable *variableLexer
formatter *... |
package http
import (
"bufio"
"context"
"crypto/tls"
"errors"
"fmt"
"net"
"net/http/httptrace"
"time"
"github.com/anabiozz/rproxy/pkg/log"
)
// Proxy ..
type Proxy struct {
configs map[string]*routerConfig
listeners []net.Listener
donec chan struct{}
err error
ListenFunc func(net, laddr... |
package main
import (
"encoding/json"
"fmt"
"time"
)
var data = `{"ato":40000000,"cong_ctl":{"snd_ssthresh":2147483647,"rcv_ssthresh":43690,"snd_cwnd_bytes":0,"snd_cwnd_segs":10},"flow_ctl":{"rcv_wnd":43690},"last_ack_rcvd":260000000,"last_data_rcvd":1536000000,"last_data_sent":1260000000,"opts":{"sack":true,"tmst... |
// Copyright 2018 GRAIL, Inc. All rights reserved.
// Use of this source code is governed by the Apache 2.0
// license that can be found in the LICENSE file.
package bigslice_test
import (
"reflect"
"sort"
"testing"
"github.com/grailbio/bigslice"
"github.com/grailbio/bigslice/slicetype"
)
// sortedCogroup retu... |
// Copyright (c) 2021, <NAME>.l. All rights reserved.
// <EMAIL>
package nc
import (
"crypto/md5"
"encoding/json"
"fmt"
"net"
"syscall"
"github.com/riccardomanfrin/netconfd/logger"
"github.com/vishvananda/netlink"
)
// PortRange represents rule sport/dport range.
type PortRange struct {
Start uint16
End ... |
package main
import (
"context"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"os/exec"
"time"
"github.com/crackcomm/cloudflare"
"github.com/gin-gonic/gin"
"github.com/joshrendek/proxmox-enhanced-api/proxmox"
"github.com/spf13/viper"
)
const systemdUnit = `
[Unit]
Description=proxmox-enhanced-api
After... |
// Copyright 2020 Cambricon, 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 scan
import (
"fmt"
"net"
"time"
"github.com/42wim/dt/structs"
"github.com/ammario/ipisp"
"github.com/miekg/dns"
)
func getIP(host string, qtype uint16, servers ...string) []net.IP {
var ips []net.IP
for _, server := range servers {
rrset, _, err := queryRRset(host, qtype, server, false)
if err ... |
package main
import (
"log"
"time"
sieve "sieve.client"
)
// The listener is actually a wrapper around the server.
func NewTimeTravelListener(config map[interface{}]interface{}, learnedMask map[string]map[string][]string, configuredMask map[string][]string) *TimeTravelListener {
maskedKeysSet, maskedPathsSet := ... |
// Copyright 2016 The go-vgo Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// https://github.com/go-vgo/robotgo/blob/master/LICENSE
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT lic... |
package main
import (
"fmt"
"github.com/axel-freesp/sge/backend"
"github.com/axel-freesp/sge/freesp"
bh "github.com/axel-freesp/sge/interface/behaviour"
mp "github.com/axel-freesp/sge/interface/mapping"
pf "github.com/axel-freesp/sge/interface/platform"
tr "github.com/axel-freesp/sge/interface/tree"
"github.co... |
package golog
import (
"bytes"
"runtime"
"testing"
"time"
"github.com/alexcesaro/log"
"github.com/alexcesaro/log/logtest"
)
const testMessage = "Test Message!"
func TestOutput(t *testing.T) {
logger, out := createTestLogger(log.Debug)
logger.Emergency(testMessage)
logtest.AssertContains(t, out, "1985-06-1... |
package api_client
import (
"encoding/json"
"fmt"
"html/template"
"io/ioutil"
"log"
"net/http"
"net/url"
"regexp"
"sort"
"strconv"
"strings"
"time"
"github.com/vjeantet/jodaTime"
)
const (
urlIATAPrefix = "https://www.travelpayouts.com/widgets_suggest_params?q="
urlBestPrices = "http://min-prices.avia... |
package contrailcli
import (
"fmt"
"github.com/Juniper/asf/pkg/client"
"github.com/Juniper/asf/pkg/logutil"
"github.com/Juniper/asf/pkg/services"
"github.com/spf13/cobra"
)
var (
filters string
pageLimit int64
pageMarker string
detail bool
count bool
shared bool
excludeHRefs ... |
package netattach
import (
"context"
"net"
"strconv"
"strings"
log "github.com/sirupsen/logrus"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/network"
"github.com/docker/docker/client"
)
type DockerNet struct {
id string
name ... |
package uguisu
import (
"bytes"
"compress/gzip"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"strings"
env "github.com/Netflix/go-env"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/google/uuid"
"github.com/m-mizutani/golambda"
"... |
package gostradamus
import (
"regexp"
"strings"
"time"
)
// All FormatTokens for parsing and formatting with DateTime
const (
YearFull = FormatToken("YYYY")
YearShort = FormatToken("YY")
MonthFull = FormatToken("MMMM")
MonthAbbr = FormatToken("MMM")
MonthZeroPadded = FormatToken("MM")
MonthShor... |
package types
import (
"fmt"
"llvm.org/llvm/bindings/go/llvm"
)
type BasicKind int
const (
Integer BasicKind = iota
Real
Character
Boolean
String
Void
)
var (
IntegerType *BasicType
RealType *BasicType
CharacterType *BasicType
BooleanType *BasicType
StringType *BasicType
VoidType *Ba... |
// Copyright 2022 <NAME>
// All rights reserved.
package gofa
// Constant value and math functions
import "math"
// Const
const (
/* Pi */
DPI = 3.141592653589793238462643
/* 2Pi */
D2PI = 6.283185307179586476925287
/* Pi/2 */
DPI2 = 1.570796326794896619231322
/* Radians to degrees */
DR2D = 57.295779513... |
package ldevents
import (
"gopkg.in/launchdarkly/go-sdk-common.v2/jsonstream"
"gopkg.in/launchdarkly/go-sdk-common.v2/ldtime"
)
// In this file we create the analytics event JSON data that we send to LaunchDarkly. This does not
// always correspond to the shape of the event objects that are fed into EventProcessor.... |
package service
import (
"log"
"net/http"
"strings"
"gorm.io/gorm"
"encoding/json"
)
// HandleRequest is the main function which will handle redirect and analysis.
func HandleRequest(w http.ResponseWriter, r *http.Request) {
requestCounter.Inc()
path := r.URL.Path[len(listenPath):]
if path == "" {
http.... |
package squirrel
import (
"time"
"github.com/lindsaygelle/nook"
"github.com/lindsaygelle/nook/animal"
"github.com/lindsaygelle/nook/character"
"github.com/lindsaygelle/nook/gender"
"github.com/lindsaygelle/nook/personality"
"golang.org/x/text/language"
)
var (
blaireBirthday = nook.Birthday{
Day: 3,
Mo... |
package timescaledb
import (
"context"
"fmt"
"time"
"github.com/jackc/pgx/v4"
"github.com/jackc/pgx/v4/pgxpool"
"github.com/sirupsen/logrus"
"go.k6.io/k6/output"
"go.k6.io/k6/stats"
)
func init() {
output.RegisterExtension("timescaledb", newOutput)
}
var _ interface{ output.WithThresholds } = &Output{}
t... |
package main
import (
"errors"
"fmt"
"log"
"mime/multipart"
"path/filepath"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
"github.com/google/uuid"
)
func GenerateFileNam... |
package main
import (
"os"
"strconv"
sdl "github.com/veandco/go-sdl2/sdl"
beeper "github.com/skatiyar/go-chip8/beeper"
emu "github.com/skatiyar/go-chip8/emulator"
)
// Default Chip8 resolution
const CHIP_8_WIDTH int32 = 64
const CHIP_8_HEIGHT int32 = 32
func main() {
if len(os.Args) < 3 {
panic("Please pro... |
// Copyright 2019 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
// *** 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 storage
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Manages a Container within an Azure Storage Accou... |
package exec
import (
"fmt"
"strings"
"github.com/reg0007/Zn/error"
"github.com/reg0007/Zn/syntax"
)
//// General Value types
// ZnValue - general value interface
type ZnValue interface {
String() string
GetProperty(string) (ZnValue, *error.Error)
SetProperty(string, ZnValue) *error.Error
GetMethod(string) ... |
package index
import (
"context"
"fmt"
"bitbucket.org/kleinnic74/photos/consts"
"bitbucket.org/kleinnic74/photos/library"
"bitbucket.org/kleinnic74/photos/logging"
"bitbucket.org/kleinnic74/photos/tasks"
"go.uber.org/zap"
)
type Indexer struct {
tracker Tracker
executor tasks.TaskExecutor
indexers map[Na... |
package indexes
import (
"fmt"
"strings"
"gopkg.in/mgo.v2/bson"
)
//TODO: implement a trie data structure that stores
//keys of type string and values of type bson.ObjectId
// MAX_VALUES contains the max number of values that can be associated at this
// node before it needs to be converted into a trie node
con... |
package lgres
import (
"io"
"math"
"github.com/inkyblackness/hacked/ss1"
"github.com/inkyblackness/hacked/ss1/resource"
"github.com/inkyblackness/hacked/ss1/resource/lgres/internal/compression"
"github.com/inkyblackness/hacked/ss1/resource/lgres/internal/format"
"github.com/inkyblackness/hacked/ss1/serial"
)
... |
package color
import (
"fmt"
"regexp"
"strconv"
"strings"
)
var patterns = []struct {
pattern *regexp.Regexp
parser func(string) (Format, error)
}{
{
// Matches six and three digit hex colors (#FFFFFF, #FFF)
pattern: regexp.MustCompile(`#([ABCDEFabcdef0-9]{6}|[ABCDEFabcdef0-9]{3})`),
parser: parseHex,
... |
package main
import (
"errors"
"fmt"
"math"
"os"
"time"
)
const (
RSI_PERIODS = 14
)
type StockPrice struct {
open, close, high, low float64
}
type StockInstance struct {
periodTime time.Time
periodType string //This can ... |
// Copyright 2016 The Neugram Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package main
import (
"context"
"flag"
"fmt"
"os"
"os/signal"
"path/filepath"
"time"
"neugram.io/ng/eval/shell"
"neugram.io/ng/gengo"
"neugram.... |
package images
import (
"compress/gzip"
"context"
"fmt"
"io"
"io/ioutil"
"os"
"path"
"sync"
"time"
"github.com/containers/image/v5/pkg/compression/types"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/ulikunitz/xz"
"kubevirt.io/containerdisks/cmd/medius/common"
"kubevirt.io/container... |
package snorlax
import (
"math"
"strconv"
"strings"
"github.com/bwmarrin/discordgo"
"github.com/omarhachach/snorlax/utils"
)
func init() {
helpModule := &Module{
Name: "Help",
Desc: "Help gives information about a command, or displays a list of commands/modules.",
Commands: map[string]*Command{},... |
package validate
import (
"fmt"
"io/ioutil"
"github.com/pkg/errors"
"github.com/solo-io/go-utils/protoutils"
v1 "github.com/solo-io/service-mesh-hub/api/v1"
"github.com/solo-io/service-mesh-hub/pkg/cli/options"
"github.com/solo-io/service-mesh-hub/pkg/render"
"github.com/solo-io/solo-kit/pkg/api/v1/resources/... |
package main
import (
"fmt"
"github.com/Danceiny/go.fastjson"
. "github.com/Danceiny/go.utils"
"github.com/PuerkitoBio/goquery"
"github.com/gocolly/colly"
log "github.com/sirupsen/logrus"
"math/rand"
"os"
"regexp"
"strings"
"sync"
"time"
)
type Dianping struct {
Max... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.