text stringlengths 3.08k 10.4k |
|---|
// Copyright 2015 <NAME>. All rights reserved.
// Use of this source code is governed by a MIT
// license that can be found in the LICENSE file.
package main
import (
"errors"
"fmt"
log "github.com/Sirupsen/logrus"
"golang.org/x/oauth2"
drive "google.golang.org/api/drive/v2"
"io"
"net/http... |
package http
import (
"fmt"
"github.com/codingXiang/configer"
"github.com/codingXiang/cxgateway/delivery"
"github.com/codingXiang/cxgateway/middleware"
http2 "github.com/codingXiang/cxgateway/module/auto_register/delivery/http"
"github.com/codingXiang/cxgateway/module/auto_register/repository"
"github.com/codin... |
//nolint:bodyclose // Body is closed in Client.Do, but the response is still returned to provide access to the headers
package gerrit
import (
"context"
"encoding/base64"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"time"
"github.com/inconshreveable/log15"
"golang.org/x/time/rate"
"github.com/sourcegr... |
/*
* errors.go
*
* Copyright 2018-2021 <NAME>
*/
/*
* This file is part of golib.
*
* It is licensed under the MIT license. The full license text can be found
* in the License.txt file at the root of this project.
*/
// Package errors implements functions for advanced error handling.
//
// Errors in this pack... |
// Package api connects to the Unified Feed API interface
package api
import (
"bytes"
"context"
"encoding/xml"
"fmt"
"io/ioutil"
"text/template"
"time"
"github.com/hashicorp/go-retryablehttp"
"github.com/minus5/go-uof-sdk"
)
const (
stagingServer = "stgapi.betradar.com"
productionServer = "api.betrada... |
package gocord
import "fmt"
// Permission holds the bitfield and the permsissions included in it.
type Permission struct {
Bitfield int
Permissions []string
}
// CalculateBitfield returns the Permission interface for that bitfield.
func CalculateBitfield(bitfield int) Permission {
resultingPermission := Permis... |
/*
Author: <NAME>
References for Thomson's construction in C and Golang:
* https://swtch.com/~rsc/regexp/regexp1.html,
* Video by lecturer <NAME>
Refernces used for further understanding of the history behind the algorithm
* https://en.wikipedia.org/wiki/Thompson%27s_construction#Rules
*/
package nfaEngine
im... |
// Copyright 2021 iLogtail 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 ... |
// Copyright 2022 The Kanister 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 report
import (
"strconv"
"strings"
"github.com/Appliscale/cloud-security-audit/configuration"
"github.com/Appliscale/cloud-security-audit/resource"
"github.com/aws/aws-sdk-go/service/s3"
)
const action = "Action"
const effect = "Effect"
const principal = "Principal"
type S3BucketReport struct {
Name ... |
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
//
package aws
import (
"fmt"
"math"
"strings"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/aws/aws-sdk-go/service/s3/s3m... |
// Package billmodel contains the types for schema 'equinox'.
package billmodel
// GENERATED BY XO. DO NOT EDIT.
import (
"database/sql"
"github.com/lib/pq"
)
// Sledger represents a row from 'equinox.sledger'.
type Sledger struct {
Slaccountno sql.NullString `json:"slaccountno"` // slaccountno
Sloutstan... |
package zen_doctor
import (
"math/rand"
"sync"
)
type GameState struct {
level *LevelConfig
player Player
bits BitStream
world World
view View
mu sync.Mutex
complete bool
}
func NewGameState(level Level, mode CompatibilityMode) GameState {
l := GetLevel(level)
return NewGameStateWith... |
package main
import (
"bufio"
"bytes"
"flag"
"fmt"
"io/ioutil"
"log"
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
)
type comandFunc func(string) error
const (
MaxImagePerCam = 10
CaptureFolder = "./Capture"
)
var (
addr = flag.String("addr", "127.0.0.1:1667", "Web Address")
db ... |
package game
import (
cr "crypto/rand"
"errors"
"math"
"math/big"
stupidRand "math/rand"
"github.com/dhendry/kitchen-sink/solitaire/model"
)
var allCards [52]model.Card
// A non-deterministically initialized random - one of the silliest things so far about go
var rand stupidRand.Rand
func init() {
// Setup ... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package clouddirectory
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
)
type CreateFacetInput struct {
_ struct{} `type:"structure"`... |
/*
* Copyright 2019 Armory, 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, ... |
/*
Copyright 2020 TriggerMesh 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, softwar... |
// Copyright (c) 2018 the check_snmp_authors. All rights reserved.
// Use of this source code is governed by ISC-style license
// that can be found in the LICENSE file.
package nagios
import (
"fmt"
"github.com/BFLB/check_synology/synology"
)
type disk struct {
data *synology.Disk
status string
exitcode ... |
// this code is licensed under mit license, see license file in repository root
// Copyright 2021 ilyapashuk
// this package provides some basic types and functions to implement digital braille processing
package braille
import "strconv"
import "errors"
import "fmt"
import "strings"
// this constants contains dot re... |
// Copyright 2016 The Serviced 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... |
// 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 layout_test
import (
_ "embed"
"fmt"
"os"
"strings"
"testing"
"github.com/nikolaydubina/jsonl-graph/graph"
"github.com/nikolaydubina/go-graph-layout/layout"
"github.com/nikolaydubina/go-graph-layout/svg"
)
func parseJSONLGraph(in string) (*graph.Graph, *layout.Graph, error) {
gd, err := graph.NewGr... |
/*
Package quote is free quote downloader library and cli
Downloads daily/weekly/monthly historical price quotes from Yahoo
and daily/intraday data from Google/Tiingo/Bittrex/Binance/Huobi/Kraken
Copyright 2018 <NAME>
Licensed under terms of MIT license (see LICENSE)
*/
package quote
import (
"bufio"
"encoding/jso... |
package vc_ru
import (
"fmt"
"strconv"
"strings"
"time"
"github.com/PuerkitoBio/goquery"
"github.com/headzoo/surf"
"github.com/headzoo/surf/browser"
"github.com/recoilme/dogenews/model"
)
type Vc struct {
HostName string
bow *browser.Browser
}
func New(hostName string) *Vc {
br := surf.NewBrowser()
... |
package kodr
import (
"crypto/rand"
"math"
"github.com/cloud9-tools/go-galoisfield"
)
// A piece of data is nothing but a byte array
type Piece []byte
// Multiple pieces are coded together by performing
// symbol by symbol finite field arithmetic, where
// a single byte is a symbol
//
// `by` is coding coefficie... |
package analyzer
import (
"fmt"
"github.com/spf13/viper"
"sync"
bam "github.com/okex/exchain/libs/cosmos-sdk/baseapp"
sm "github.com/okex/exchain/libs/tendermint/state"
"github.com/okex/exchain/libs/tendermint/trace"
)
const FlagEnableAnalyzer string = "enable-analyzer"
var (
singleAnalys *analyer
openAnaly... |
package main
import (
"bytes"
"flag"
"fmt"
"golang.org/x/net/icmp"
"golang.org/x/net/ipv4"
"golang.org/x/net/ipv6"
"math"
"math/rand"
"net"
"os"
"time"
)
const (
protocolICMP = 1
protocolIPv6ICMP = 58
)
// initPing returns a new ping struct pointer
func initPing() (*ping, error) {
hostname := os.Ar... |
package github
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"testing"
"github.com/stretchr/testify/assert"
"github.com/victorpopkov/go-appcast/appcaster"
)
// workingDir returns a current working directory path. If it's not available
// prints an error to os.Stdout and exits with error status 1.
func work... |
package log
import (
"bytes"
"go.uber.org/zap"
"go.uber.org/zap/zapcore"
"gopkg.in/natefinch/lumberjack.v2"
"log"
"os"
"path"
"sync"
"time"
)
var instance *zap.Logger
var once sync.Once
func Logger(serviceName string) *zap.Logger {
once.Do(func() {
instance = NewLogger(serviceName)
})
return instance
}... |
// Copyright 2015 go-swagger maintainers
//
// 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 agr... |
package hooks
import (
"fmt"
"time"
"github.com/square/p2/pkg/logging"
"github.com/square/p2/pkg/types"
)
// HookType represents the stage in the Hook lifecycle
type HookType string
func (hookType HookType) String() string {
return string(hookType)
}
var (
// BeforeInstall hooks run before the artifact is do... |
package tests_test
import (
"sigs.k8s.io/kustomize/k8sdeps/kunstruct"
"sigs.k8s.io/kustomize/k8sdeps/transformer"
"sigs.k8s.io/kustomize/pkg/fs"
"sigs.k8s.io/kustomize/pkg/loader"
"sigs.k8s.io/kustomize/pkg/resmap"
"sigs.k8s.io/kustomize/pkg/resource"
"sigs.k8s.io/kustomize/pkg/target"
"testing"
)
func writeM... |
package ooxml
import (
"bytes"
"encoding/xml"
"fmt"
"io"
"strings"
"unicode"
"github.com/t-yuki/gooxml/opc"
)
type PresentationSlide struct {
XMLName xml.Name `xml:"sld"`
SlideData SlideData
}
type SlideData struct {
XMLName xml.Name `xml:"cSld"`
ShapeTree GroupShape `xml:"spTree"`
}
type GroupSha... |
package keeper
import (
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/kava-labs/kava/x/cdp/types"
)
const (
// factor for setting the initial value of gov tokens to sell at debt auctions -- assuming stable token is ~1 usd, this starts the auction with a price of $0.01 KAVA
dump = 100
)
// AuctionCollater... |
package client
import (
"context"
"fmt"
"github.com/oasisprotocol/oasis-core/go/common"
"github.com/oasisprotocol/oasis-core/go/common/crypto/hash"
"github.com/oasisprotocol/oasis-core/go/common/service"
"github.com/oasisprotocol/oasis-core/go/epochtime/api"
"github.com/oasisprotocol/oasis-core/go/roothash/api... |
package broker
import (
"context"
"errors"
"github.com/ferris1/meta/meta/codec"
"github.com/ferris1/meta/meta/discovery"
"github.com/ferris1/meta/meta/logger"
nats "github.com/nats-io/nats.go"
"strings"
"sync"
)
// 实现实体
type natsBroker struct {
sync.Once
sync.RWMutex
// indicate if we're connected
connec... |
package bull
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 (
coachBirthday = nook.Birthday{
Day: 29,
Month:... |
package main
import (
"context"
"crypto/tls"
"crypto/x509"
"encoding/json"
"errors"
"github.com/containerd/go-runc"
"github.com/google/gopacket"
"github.com/google/gopacket/layers"
"github.com/google/gopacket/pcap"
"github.com/google/gopacket/pcapgo"
log "github.com/sirupsen/logrus"
"github.com/vishvananda... |
/*
Copyright 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, software
... |
package main
import (
"crypto/rand"
"errors"
"fmt"
"net/http"
"os"
"strconv"
"sync"
"time"
"github.com/gin-gonic/gin"
)
var (
mutex = &sync.Mutex{}
)
type request struct {
Action string `json:"action"`
Message message `json:"message"`
}
type response struct {
Body string `json:"body"`
UUID st... |
/*** Copyright (c) 2016, The BioTeam, Inc. ***
*** For more information please refer to the LICENSE.md file ***/
package gorods
// #include "wrapper.h"
import "C"
import (
"fmt"
"strconv"
"strings"
"time"
"unsafe"
)
// Zone contains information representing an iRODS zone.
type Zone struct... |
package extractor
import (
"regexp"
"github.com/cmdse/core/schema"
"github.com/cmdse/manparse/pim/optdesc/normalize"
"github.com/cmdse/manparse/reporter"
"github.com/cmdse/manparse/reporter/guesses"
)
type optionSynopsis struct {
*reporter.ParseReporter
raw string
expressions []string
description st... |
//
//Copyright [2016] [SnapRoute 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 regexp
import (
"fmt"
"reflect"
"testing"
)
type runesTest struct {
text string
start, end int
re string
expected [][]int
nmax int // Max number of matches
}
// runesTests should work for forward search, and for backwards search
// after expected matches are reversed.
var runesT... |
// Copyright (c) 1996 <NAME>, <NAME>, <NAME>.
// Portions Copyright (c) 2009 The Go Authors.
//
// 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 limit... |
package util
import (
"fmt"
"io/ioutil"
"os"
"os/user"
"path"
"path/filepath"
"reflect"
"sort"
"strings"
"github.com/mitchellh/go-homedir"
funk "github.com/thoas/go-funk"
)
func FindByExtInDirSorted(parentPath string, ext string) ([]string, error) {
var res []string
files, err := ioutil.ReadDir(parentPa... |
package main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"text/template"
)
const (
DefaultBudgetInsightURITemplateWebview = "https://{{.domain}}.biapi.pro/2.0/auth/webview/connect?client_id={{.clientID}}&redirect_uri={{.yourCallbackURI}}"
DefaultBudgetInsightURITemplat... |
package models
import (
"context"
"crypto/md5"
"database/sql"
"fmt"
"io"
"strings"
"time"
bot "github.com/MixinNetwork/bot-api-go-client"
number "github.com/MixinNetwork/go-number"
"github.com/MixinNetwork/supergroup.mixin.one/config"
"github.com/MixinNetwork/supergroup.mixin.one/durable"
"github.com/Mixi... |
package csvx
import (
"bytes"
"encoding/csv"
"fmt"
"io"
"strconv"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestDecoder_Decode(t *testing.T) {
type namedType string
type targetType struct {
String string `csv:"string"`
Int int ... |
package types
import (
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)
// DenominatedPool implements a denominated constant-product liquidity pool
type DenominatedPool struct {
// all pool operations are implemented in a unitless base pool
pool *BasePool
/... |
/*
MIT License
Copyright (c) 2020-2021 <NAME>
This file is part of NGSI Go
https://github.com/lets-fiware/ngsi-go
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 ... |
package tracing
import (
"context"
"fmt"
"github.com/blend/go-sdk/exception"
opentracing "github.com/opentracing/opentracing-go"
)
// These constants are mostly lifted from the datadog/tracing/ext tag values.
const (
// TagKeyEnvironment is the environment (web, dev, etc.)
TagKeyEnvironment = "env"
// TagKeyS... |
package srtp
import (
"crypto/cipher"
"encoding/binary"
"net"
)
// encrypt a SRTP packet in place
func (c *Context) encrypt(m *rtpMsg) bool {
s := c.getSSRCState(m.ssrc)
c.updateRolloverCount(m.sequenceNumber, s)
stream := cipher.NewCTR(c.srtpBlock, c.generateCounter(m.sequenceNumber, s.rolloverCounter, s.ssr... |
/*
Copyright 2020 The Knative 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, soft... |
package zlog
import (
"fmt"
"strings"
"time"
"github.com/macroblock/imed/pkg/zlog/loglevel"
"github.com/macroblock/imed/pkg/zlog/zlogger"
)
// Default -
var defaultLog *TLog
type tNode struct {
state loglevel.TFilter
loggers []*zlogger.TLogger
}
// TLog -
type TLog struct {
node *tNode
name string
}
//... |
package loop
import (
"context"
"fmt"
"strconv"
"strings"
"github.com/btcsuite/btcd/btcec"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/wire"
"github.com/btcsuite/btcutil"
"github.com/lightninglabs/lndclient"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwor... |
package errors
import (
"encoding/json"
"errors"
"reflect"
"github.com/IBM-Cloud/power-go-client/power/models"
)
// start of Placementgroup Messages
const GetPlacementGroupOperationFailed = "failed to perform Get Placement Group Operation for placement group %s with error %w"
const CreatePlacementGroupOperation... |
// Code generated by protoc-gen-go.
// source: peer/configuration.proto
// DO NOT EDIT!
package peer
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
/... |
package serve2
import (
"errors"
"net"
"github.com/kennylevinsen/serve2/utils"
)
const (
// DefaultBytesToCheck default maximum amount of bytes to check
DefaultBytesToCheck = 128
)
// Errors
var (
ErrGreedyHandler = errors.New("remaining handlers too greedy")
)
// Protocol is the protocol detection and handl... |
package driver
import (
"encoding/gob"
"log"
"net/rpc"
"os"
"syscall"
"github.com/hashicorp/go-plugin"
"github.com/hashicorp/nomad/client/driver/executor"
cstructs "github.com/hashicorp/nomad/client/structs"
"github.com/hashicorp/nomad/nomad/structs"
)
// Registering these types since we have to serialize a... |
/*
Copyright 2018 The Knative 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, soft... |
package profile
/*
* 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
*... |
// *** 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 search
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Manages a Search Service.
//
// ## Example Usage
... |
/*
Copyright 2018 Bitnine Co., 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 or agreed to in writing, softwar... |
package geojson
import (
"encoding/json"
"errors"
)
var (
// ErrNoGeometry happens when no Geometry has been specified during, for instance
// a MarshalJSON operation
ErrNoGeometry = errors.New("no geometry specified")
// ErrMultipleGeometries happens when more than one Geometry has been specified
// and usual... |
package rdstail
import (
"bytes"
"crypto/tls"
"crypto/x509"
"errors"
"fmt"
"regexp"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/rds"
"github.com/chrismrivera/backoff"
)
const (
papertrailBackoffMaxWait = time.Minute
papertrailBackoffDeadline = time.Minute * 5
// aws-sdk-go... |
// 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 familylink
import (
"context"
"strconv"
"strings"
"time"
"chromiumos/tast/common/policy"
"chromiumos/tast/common/policy/fakedms"
"chro... |
// Copyright 2020, 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... |
package main
import (
"encoding/binary"
"fmt"
"runtime"
"syscall"
"unsafe"
"github.com/lxn/win"
"golang.org/x/sys/windows"
)
var (
wndClassName = "Pageant"
)
func main() {
inst := win.GetModuleHandle(nil)
WinMain(inst)
}
func WinMain(Inst win.HINSTANCE) int32 {
// RegisterClass
atom := MyRegisterClass(... |
// Copyright 2019 The LUCI Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed... |
// +build integration,perftest
package main
import (
"bytes"
"flag"
"fmt"
"io"
"os"
"path/filepath"
"testing"
"github.com/aws/aws-sdk-go/awstesting/integration"
"github.com/aws/aws-sdk-go/internal/sdkio"
"github.com/aws/aws-sdk-go/service/s3/s3manager"
)
var benchConfig BenchmarkConfig
type BenchmarkConf... |
/*
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 scanner
import (
"context"
"fmt"
"io/ioutil"
"os"
"time"
"github.com/Invoca/nmap-diff/pkg/wrapper"
"github.com/Ullaakut/nmap"
log "github.com/sirupsen/logrus"
)
type scanParser struct {
currentInstances map[string]wrapper.PortMap
previousInstances map[string]wrapper.PortMap
newInstancesExpose... |
package subscribe
import (
"bufio"
"bytes"
"crypto/tls"
"encoding/base64"
"fmt"
"hash/crc32"
"io/ioutil"
"log"
"net/http"
"net/url"
"regexp"
"strings"
"time"
"github.com/nadoo/glider/proxy"
// Register proxys
_ "github.com/nadoo/glider/proxy/ssr"
)
var (
reSSR = regexp.MustCompile(`ssr://(\S+)`... |
// Copyright (C) 2018 <NAME>. All rights reserved.
// Use of this source code is governed by a MIT-style license
// that can be found in the LICENSE file.
package trope_test
// Sadly, github.com/vinzmay/go-rope crashes for initial string sizes
// of less than 5000 with the benchmarks.
import (
"fmt"
"github.com/che... |
package tstcli
import (
"bufio"
"fmt"
"io"
"os"
"strconv"
"strings"
"time"
)
// Program name and flags needed for tests.
const (
// TestCliPath expected to be on the PATH when tests run.
TestCliPath = "testcli"
FlagDisablePrompt = "disable-prompt"
FlagExitOnErr = "exit-on-error"
FlagFailOnStartu... |
package main
import (
"fmt"
"os"
"os/signal"
"time"
"github.com/faiface/beep"
"github.com/faiface/beep/effects"
"github.com/faiface/beep/speaker"
"github.com/faiface/beep/wav"
"github.com/faiface/pixel"
"github.com/faiface/pixel/imdraw"
"github.com/faiface/pixel/pixelgl"
"golang.org/x/image/colornames"
)... |
/*
Copyright 2016 The Kubernetes Authors.
Copyright 2020 Elotl 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 main
import (
"bufio"
"encoding/json"
"fmt"
"log"
"io"
"os"
"strings"
"strconv"
)
type GzipMetaData struct {
FooterLength int `json:"Footer-Length,string"`
DeflateLength int `json:"Deflate-Length,string"`
HeaderLength int `json:"Header-Length,string"`
InflatedLength int `json:"Inflated... |
package query
import (
"bytes"
"encoding/gob"
"log"
"strings"
)
// ReverseReferenceNode creates a reverse reference node representing a one to many relationship or one-to-one
// relationship, depending on whether the foreign key is unique. The other side of the relationship will have
// a matching forward Referen... |
package ui
import (
"fmt"
"strings"
"github.com/ap4y/leaf"
runewidth "github.com/mattn/go-runewidth"
termbox "github.com/nsf/termbox-go"
)
type step int
const (
stepAnswering step = iota
stepScore
stepFinished
)
type align int
const (
alignLeft align = iota
alignCenter
alignRight
)
// TUI implements t... |
// Copyright (c) 2016 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge... |
package valhalla
import (
"bytes"
"encoding/json"
)
type LocateResponse []struct {
InputLon float64 `json:"input_lon"`
InputLat float64 `json:"input_lat"`
Nodes []struct {
TrafficSignal bool `json:"traffic_signal"`
Type string `json:"type"`
Lat float64 `json:"lat"`
NodeID ... |
package main
import "math/rand"
// Type to represent an edge set.
type Edge struct {
From, To int
}
// Represents a node in a graph.
type Node struct {
Id int
Neighbours map[int]*Node
}
// Create a new node.
func NewNode(id int) *Node {
return &Node{
id,
make(map[int]*Node),
}
}
// Represents an u... |
package httpstat
import (
"bytes"
"io"
"net"
"net/http"
"time"
)
// TODO: distinct timeout errors for TLS etc
// DefaultMaxRedirects is the max number of redirects.
var DefaultMaxRedirects = 5
// DefaultClient used for requests.
var DefaultClient = &http.Client{
CheckRedirect: checkRedirect,
Timeout: 1... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: envoy/annotations/resource.proto
package envoy_annotations
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
descriptor "github.com/golang/protobuf/protoc-gen-go/descriptor"
math "math"
)
// Reference imports to suppress errors if they are not... |
// 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, sublicense, and/or sell
//... |
/*
Copyright 2020 <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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distribu... |
package db
import (
"sync/atomic"
"unsafe"
"github.com/rs/zerolog/log"
"gitlab.com/thorchain/midgard/config"
)
var wellKnownChainInfos = []config.ForkInfo{
// Mainnet
{ChainId: "thorchain", EarliestBlockHash: "7D37DEF6E1BE23C912092069325C4A51E66B9EF7DDBDE004FF730CFABC0307B1", EarliestBlockHeight: 1, HardForkHe... |
package util
import (
"fmt"
"io"
"io/ioutil"
"os"
"path"
"path/filepath"
"strings"
"go.uber.org/zap"
)
// Exists returns whether the given file or directory exists
func Exists(path string) (bool, error) {
_, err := os.Stat(path)
if err == nil {
return true, nil
}
if os.IsNotExist(err) {
return false,... |
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
package jobs
import (
"errors"
"fmt"
"time"
"github.com/mattermost/mattermost-server/v6/model"
"github.com/mattermost/mattermost-server/v6/shared/mlog"
)
type Schedulers struct {
stop ... |
package fs
import (
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"github.com/birkland/ocfl"
"github.com/birkland/ocfl/metadata"
"github.com/pkg/errors"
)
// AtomicPrefix is a file prefix for temporary files that are created during
// AtomicWrite
const AtomicPrefix = ".ocfl.atomic."
const ocflRootNamasteConte... |
package internal
import (
"context"
"encoding/json"
"errors"
"fmt"
"io"
"net/url"
"os"
"strings"
"time"
cloudevents "github.com/cloudevents/sdk-go/v2"
"github.com/rs/xid"
kafka "github.com/segmentio/kafka-go"
log "github.com/sirupsen/logrus"
"github.com/vorteil/direktiv-listeners/utils"
)
const (
ka... |
// Copyright 2018 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
package fatzebra
import (
"bytes"
"context"
"crypto/rand"
"encoding/json"
"errors"
"math/big"
"net/http"
"strings"
"time"
"go.uber.org/zap"
)
const (
purchasesV1 = "/v1.0/purchases"
)
// ValidationError represents a purchase validation error.
type ValidationError struct {
Reference string
Errors [... |
/*
Copyright (c) 2016, <NAME>. 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, this list of conditions and the following discl... |
// 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.
/*
* Runtime type representation.
*
* The following files know the exact layout of these
* data structures and must be kept in sync with this file:
*
* ..... |
package commands
import (
"github.com/abassian/huron/src/huron"
"github.com/abassian/huron/src/proxy/dummy"
aproxy "github.com/abassian/huron/src/proxy/socket/app"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
//NewRunCmd returns the command that starts a Huron node
func NewRu... |
/*************************************************************************
*
* COPYRIGHT 2018 Deluxe Entertainment Services Group Inc. and its subsidiaries (“Deluxe”)
* All Rights Reserved.
*
* NOTICE: All information contained herein is, and remains
* the property of Deluxe and its suppliers,
* if any. The... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.