text stringlengths 3.08k 10.4k |
|---|
/*
Package FDA implements Golang bindings for the OpenFDA API.
Copyright and license is described in LICENSE within this package.
To get an API key, which permits many more requests per hour than with
unauthenticated API use, please see https://open.fda.gov/api/reference/#authentication
To learn how to craft optimal... |
package managers
import (
"fmt"
"regexp"
"github.com/tiniyo/neoms/constant"
"github.com/tiniyo/neoms/config"
"github.com/tiniyo/neoms/helper"
"github.com/tiniyo/neoms/logger"
"github.com/tiniyo/neoms/models"
)
type VoiceAppManagerInterface interface {
getXMLApplication(evHeaderMap map[string]string) *models.... |
/*
Package scientist helps you refactor your Go code with confidence.
Start by creating a new experiment:
experiment := scientist.NewQuickExperiment()
Wrap the current behavior into the control function:
// I wonder why this code is so slow :/
control := func(ctx context.Context) (interface{}, error) {
time.Sl... |
package testSpider
import (
"github.com/PuerkitoBio/goquery"
"bytes"
//"os"
//"practice/http/file"
"errors"
"net/http"
"fmt"
"golang.org/x/text/transform"
"golang.org/x/text/encoding/simplifiedchinese"
"io/ioutil"
"log"
"sync"
"time"
"lesson/gorm/beegoOrm"
"lesson/gorm/beegoOrm/models"
string2 "practic... |
package mcndao
import (
"context"
"sort"
"time"
"go-common/app/interface/main/mcn/conf"
"go-common/app/interface/main/mcn/dao/cache"
"go-common/app/interface/main/mcn/dao/global"
"go-common/app/interface/main/mcn/model/mcnmodel"
"go-common/library/log"
"github.com/bluele/gcache"
)
// RecommendPoolCache .
t... |
package archive
import (
"context"
"errors"
"fmt"
"github.com/frawleyskid/ipfs-bib/config"
"github.com/frawleyskid/ipfs-bib/handler"
"github.com/frawleyskid/ipfs-bib/logging"
"github.com/frawleyskid/ipfs-bib/network"
"github.com/frawleyskid/ipfs-bib/resolver"
"github.com/nickng/bibtex"
"io"
"net/http"
)
va... |
package main
import (
"flag"
"fmt"
"log"
"net/http"
"runtime"
"time"
rehttp "github.com/PuerkitoBio/rehttp"
)
func main() {
var (
pub = flag.Bool("pub", false, "Indicates to initialize te test client as a publisher")
sub = flag.Bool("sub", false, "Indicates to initialize the test client ... |
// Package cmd wraps up all command line interface operations.
package cmd
import (
"context"
"flag"
"fmt"
"os"
"sort"
"strings"
"github.com/rafaelespinoza/notexfr/internal/interactor"
"github.com/rafaelespinoza/notexfr/internal/repo/enex"
)
// An arguments captures inputs, options for the main command and s... |
package storage
import (
"fmt"
"path"
"strings"
"github.com/docker/docker-registry/common"
"github.com/docker/docker-registry/digest"
)
const storagePathVersion = "v2"
// pathMapper maps paths based on "object names" and their ids. The "object
// names" mapped by pathMapper are internal to the storage system.
... |
package webserver
import (
"encoding/json"
"fmt"
"net/http"
routing "github.com/qiangxue/fasthttp-routing"
"github.com/valyala/fasthttp"
"github.com/zekroTJA/shinpuru/internal/core/database"
"github.com/zekroTJA/shinpuru/internal/util"
"github.com/zekroTJA/shinpuru/internal/util/static"
"github.com/zekroTJA/... |
package luatiny
import (
"fmt"
"github.com/camsiabor/golua/lua"
"github.com/camsiabor/golua/luar"
"github.com/camsiabor/qcom/qerr"
"github.com/camsiabor/qcom/util"
"github.com/camsiabor/qservice/impl/tiny/luatiny/lmod"
"github.com/camsiabor/qservice/qtiny"
"github.com/twinj/uuid"
"unsafe"
)
func (o *Luaunit)... |
package e2e
import (
"context"
"fmt"
"time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/openservicemesh/osm/tests/framework"
. "github.com/openservicemesh/osm/tests/framework"
)
// This test originates insecure... |
// Copyright 2022 Teamgram 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 app... |
package face_detector_driver
import (
"io/ioutil"
"path"
"strings"
"sync"
"time"
"github.com/fsnotify/fsnotify"
"github.com/sirupsen/logrus"
opt_helper "github.com/nayotta/metathings/pkg/common/option"
)
type HikvisionFaceDetectorOption struct {
Path string
Watchloop struct {
Interval time.Duration... |
package terminal
import (
"unicode"
"unicode/utf8"
)
const (
MODE_NORMAL = iota
MODE_PRE_ESCAPE = iota
MODE_ESCAPE = iota
MODE_ELEMENT_ESCAPE = iota
)
// Stateful ANSI parser
type parser struct {
mode int
screen *screen
ansi []byte
cursor ... |
package main
import (
"flag"
"fmt"
"os"
"os/signal"
"syscall"
"time"
log "github.com/sirupsen/logrus"
policy "k8s.io/api/policy/v1beta1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/resource"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package cognitoidentityprovider
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
// Represents the request to get user attribute verification.
type GetUserAttributeVerificationCodeInput str... |
/* MIT License
*
* Copyright (c) 2018 <NAME> <mitghi[at]gmail.com>
*
* 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, cop... |
package bitcoind
import "fmt"
//! Standard JSON-RPC 2.0 errors
// RPC_INVALID_REQUEST is internally mapped to HTTP_BAD_REQUEST (400).
// It should not be used for application-layer errors.
var ErrInvalidRequest = fmt.Errorf("RPC_INVALID_REQUEST") // -32600,
// RPC_METHOD_NOT_FOUND is internally mapped to HTTP_NOT_FOU... |
// Copyright 2020, 2021 The Perkeep Authors
//
// SPDX-License-Identifier: Apache-2.0
/*
Copyright 2020 The Perkeep 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.o... |
package code_backdooring
import (
"github.com/threagile/threagile/model"
)
func Category() model.RiskCategory {
return model.RiskCategory{
Id: "code-backdooring",
Title: "Code Backdooring",
Description: "Para cada componente do pipeline de compilaçao, podem surgir riscos de backdooring onde os invasores co... |
package executor
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strconv"
"strings"
"testing"
"time"
hclog "github.com/hashicorp/go-hclog"
"github.com/hashicorp/nomad/client/allocdir"
"github.com/hashicorp/nomad/client/driver/env"
cstructs "github.com/hashicorp/nomad/client/structs"
"github.com/hashicor... |
package errx_test
import (
"fmt"
"io"
"regexp"
"testing"
"github.com/shestakovda/errx"
"github.com/stretchr/testify/suite"
)
// TestErrors - индивидуальные тесты драйверов
func TestErrors(t *testing.T) {
suite.Run(t, new(InterfaceSuite))
}
type InterfaceSuite struct {
suite.Suite
}
func (s *InterfaceSuite)... |
package dao
import (
"platform_report/lib"
"time"
)
type ReportFieldDefines struct {
ActionId int `json:"action_id" xorm:"not null pk autoincr INT(11)"`
Uuid string `json:"uuid"`
Name string `json:"name"`
InTime time.Time `json:"in_time"`
}
type ReportField struct {
ParentId int ... |
package main
import (
"context"
"encoding/base64"
"github.com/BHunter2889/da-fish-alexa/alexa"
"github.com/aws/aws-sdk-go/aws/request"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/kms"
"github.com/aws/aws-xray-sdk-go/xray"
"log"
"os"
"sync"
"gopkg.in/tomb.v2"
)
type BugCasterC... |
package main
import (
"encoding/json"
"flag"
"fmt"
"github.com/gorilla/mux"
"github.com/gorilla/websocket"
"log"
"net/http"
"os"
"strings"
"sync"
"time"
)
type message map[string][]string
type client struct {
conn *websocket.Conn // The websocket connection.
send chan []byte // Buffered channel ... |
/*
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 errors
import (
"mime"
"net"
"net/http"
"strings"
"github.com/golang/gddo/httputil/header"
"github.com/pkg/errors"
"github.com/ory/go-convenience/stringsx"
"github.com/ory/x/errorsx"
)
type (
Whens []When
When struct {
Error []string `json:"error"`
Request *WhenRequest `json:"request"`
... |
package main
import (
"context"
"encoding/json"
"errors"
"fmt"
"time"
"github.com/bwmarrin/discordgo"
"github.com/docopt/docopt-go"
decodepay "github.com/fiatjaf/ln-decodepay"
"github.com/fiatjaf/lntxbot/t"
tgbotapi "github.com/go-telegram-bot-api/telegram-bot-api"
"github.com/tidwall/gjson"
)
func handle... |
package caching
import "math"
/*
Design and implement a data structure for Least Frequently Used (LFU) cache.
It should support the following operations: get and put.
get(key) - Get the value (will always be positive) of the key if the key exists in the cache, otherwise return -1.
put(key, value) - Set or insert th... |
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use p 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
// distrib... |
/***********************************************************************************************************************
*
* MIT License
*
* Copyright (c) 2021 <NAME>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (th... |
// Copyright 2013-2017 The btcsuite developers
// Copyright 2017-2018 Coinbase, 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 th... |
package creeper
import (
"regexp"
"strings"
)
var (
rx_node = regexp.MustCompile(`^(\s*)(@?[a-zA-Z0-9_-]+)\s*(\[]|\*)?\s*:\s*(.+)$`)
rx_page = regexp.MustCompile(`^[a-zA-Z-]`)
rx_fun = regexp.MustCompile(`^($|.)`)
)
type Node struct {
Raw string
Creeper *Creeper
Name string
IsArray bool
IsPrim... |
/*
Copyright 2019 <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 writing, software
distrib... |
// Copyright (C) MongoDB, Inc. 2017-present.
//
// 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 msg
import (
"fmt"
"io"
"github.com/1... |
// Copyright 2016, <NAME> <<EMAIL>>
// See the LICENSE file for more details.
package fizzle
import (
"bytes"
"fmt"
"io/ioutil"
graphics "github.com/tbogdala/fizzle/graphicsprovider"
"github.com/tbogdala/groggy"
)
// RenderShader is an OpenGL shader that is used for easier access
// to uniforms and attributes ... |
package dangerous
import (
"bytes"
"crypto/sha512"
"fmt"
"strings"
)
var (
Sep = []byte(".")
DefaultFallbackSigners = []map[string]interface{}{{"DigestMethod": sha512.New}}
)
type Serializer struct {
Secret string
Salt string
SerializerOP JSONAPI // Can override it ... |
package render
import (
"context"
"fmt"
"net/http"
"strconv"
"time"
"go.uber.org/zap"
"github.com/lomik/graphite-clickhouse/config"
"github.com/lomik/graphite-clickhouse/finder"
"github.com/lomik/graphite-clickhouse/helper/clickhouse"
"github.com/lomik/graphite-clickhouse/helper/point"
"github.com/lomik/g... |
package tcp
import (
"fmt"
"github.com/elastic/libbeat/common"
"github.com/elastic/libbeat/logp"
"github.com/elastic/packetbeat/protos"
"github.com/tsg/gopacket/layers"
)
const TCP_MAX_DATA_IN_STREAM = 10 * 1e6
const (
TcpDirectionReverse = 0
TcpDirectionOriginal = 1
)
type Tcp struct {
id uint32... |
package telebot
import "strconv"
// Recipient is basically any possible endpoint you can send
// messages to. It's usually a distinct user or a chat.
type Recipient interface {
// ID of user or group chat, @Username for channel
Destination() string
}
// User object represents a Telegram user, bot
//
// object repr... |
// Copyright 2019 Radiation Detection and Imaging (RDI), LLC
// Use of this source code is governed by the BSD 3-clause
// license that can be found in the LICENSE file.
package main
import (
"encoding/binary"
"encoding/hex"
"flag"
"fmt"
"io"
"log"
"os"
"time"
"github.com/proio-org/go-proio"
"github.com/rd... |
package leonard
import (
"image"
"image/color"
"math"
)
func gradients(img image.Image, fn func(image.Image, int, int) float64) image.Image {
bounds := img.Bounds()
grads := image.NewGray16(bounds)
// Skip the borders
minX, maxX := bounds.Min.X+1, bounds.Max.X-1
minY, maxY := bounds.Min.Y+1, bounds.Max.Y-1
... |
package main
import (
"fmt"
"path/filepath"
"strings"
"go.mozilla.org/sops/v3/cmd/sops/formats"
"go.mozilla.org/sops/v3/decrypt"
logrus "github.com/sirupsen/logrus"
sopsLogging "go.mozilla.org/sops/v3/logging"
"sigs.k8s.io/kustomize/api/filesys"
"sigs.k8s.io/kustomize/api/ifc"
"sigs.k8s.io/kustomize/api/k... |
package common
import (
"context"
"errors"
"fmt"
"os"
mfclient "github.com/manifestival/controller-runtime-client"
mf "github.com/manifestival/manifestival"
"github.com/operator-framework/operator-sdk/pkg/metrics"
monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"
appsv1... |
// Copyright 2020-2021 <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 writing... |
package main
import (
"flag"
"fmt"
"log"
"os"
"path/filepath"
"time"
coreV1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/resource"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/client-go/informers"
"k8s.io/client-go/kubernetes"
corelisters "k8s.io/client-go/listers/... |
// Package project manage and operate the project information to be generated.
package project
import (
"fmt"
"os"
"path/filepath"
"strings"
"time"
"github.com/fatih/color"
"github.com/nao1215/mkgoprj/v2/internal/gotool"
"github.com/nao1215/mkgoprj/v2/internal/ioutils"
"github.com/nao1215/mkgoprj/v2/internal... |
/*
* Copyright (c) 2016 <NAME>
* Copyright (c) 2012 <NAME>.
* Copyright (c) 2012 The Go Authors.
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source c... |
/*
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
d... |
/*
* Copyright 2020 InfAI (CC SES)
*
* 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 bustime
import (
"fmt"
"log"
"sync"
"transport/lib/jsonhelper"
"transport/lib/network"
"github.com/tidwall/gjson"
)
const (
agenciesEndpoint = "agencies-with-coverage.json"
routesEndpoint = "routes-for-agency"
stopsEndpoint = "stops-for-route"
)
type BusStop struct {
ID string `json:"... |
package ppu
import "nes/tools"
func (self *Ppu) clearSpriteScanline() {
for _, entry := range self.spriteScanline {
entry.Y = 0xFF // y-coord is 255 means it is not visible
entry.X = 0xFF
entry.ID = 0xFF
entry.Attribute = 0xFF
}
self.sprite_count = 0
// self.bSpriteZe... |
package main
import (
"errors"
"fmt"
"sync"
)
// Room contains multiple conversations and a mutex for safety.
type Room struct {
sync.Mutex
// Convos is a map of all active conversations where the key is convoId
Convos map[string]*Convo
}
// IPExists determines whether or not one of the users in the conversati... |
package task
import (
"encoding/json"
"net/http"
"net/url"
"strings"
"time"
"github.com/cloudflare/cloudflare-go"
"github.com/mudkipme/timburr/utils"
log "github.com/sirupsen/logrus"
)
// PurgeExecutor purges the front-end cache by URLs
type PurgeExecutor struct {
expiry time.Duration
entries []utils.Pu... |
package main
import (
"log"
"fmt"
"os"
"net/http"
"path/filepath"
)
const DEFAULT_IP string = ""
const DEFAULT_PORT string = "80"
const DEFAULT_SERVING_DIRECTORY string = "www"
const CMD_LINE_ARG_NAME_IP string = "ip"
const CMD_LINE_ARG_NAME_PORT string = "port"
const CMD_LINE_ARG_NAME_SERVING_D... |
//go:build chimera
// +build chimera
package ch
import "unsafe"
/*
#include <stdlib.h>
#include <stdint.h>
#include <ch.h>
static inline void* aligned64_malloc(size_t size) {
void* result;
#ifdef _WIN32
result = _aligned_malloc(size, 64);
#else
if (posix_memalign(&result, 64, size)) {
result = 0;
}
#endif
r... |
package manager
import (
"encoding/json"
"fmt"
log "github.com/Sirupsen/logrus"
"github.com/rancher/api-filter-proxy/filters"
//to register all filters
_ "github.com/rancher/api-filter-proxy/filters/http"
"github.com/rancher/api-filter-proxy/model"
"github.com/rancher/api-filter-proxy/util"
"github.com/urfave... |
package openapi
import (
"encoding/json"
"github.com/chanced/openapi/yamlutil"
)
const (
// SecuritySchemeTypeAPIKey = "apiKey"
SecuritySchemeTypeAPIKey SecuritySchemeType = "apiKey"
// SecuritySchemeTypeHTTP = "http"
SecuritySchemeTypeHTTP SecuritySchemeType = "http"
// SecuritySchemeTypeMutualTLS = mutualTL... |
package cmd
import (
"fmt"
"strconv"
"strings"
"github.com/jaredbancroft/aoc2020/pkg/helpers"
"github.com/jaredbancroft/aoc2020/pkg/shuttle"
"github.com/spf13/cobra"
)
// day13Cmd represents the day13 command
var day13Cmd = &cobra.Command{
Use: "day13",
Short: "Advent of Code 2020 - Day13: Shuttle Search",... |
package consensus
import (
"strings"
"testing"
"github.com/QOSGroup/cassini/adapter/ports"
"github.com/QOSGroup/cassini/config"
"github.com/QOSGroup/cassini/types"
"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
)
func TestAddMsgToMap(t *testing.T) {
var events, events1, events2 []types.Event
... |
// Package elasticsearch is a wrapper of the original "github.com/elastic/go-elasticsearch".
package elasticsearch
import (
"context"
"encoding/json"
"errors"
"fmt"
"log"
"os"
"reflect"
"strings"
"time"
"github.com/elastic/go-elasticsearch/v7"
"github.com/elastic/go-elasticsearch/v7/esapi"
)
// LogLevel i... |
// Copyright 2017 <NAME>. All rights reserved.
// Use of this source code is governed by Apache 2 LICENSE that can be found in the LICENSE file.
package services
import (
"regexp"
"strings"
"time"
"github.com/OWASP/Amass/config"
eb "github.com/OWASP/Amass/eventbus"
"github.com/OWASP/Amass/graph"
"github.com/O... |
/*
* Copyright (c) 2008-2021, Hazelcast, 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 b... |
package trait
import (
"testing"
"github.com/stretchr/testify/assert"
"gopkg.in/yaml.v2"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
v1 "github.com/apache/camel-k/pkg/apis/camel/v1"
"github.com/apache/camel-k/pkg/util/kubernetes"
)
func TestConfigu... |
/*
Copyright 2019 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
package sqlstore
// Your main or test packages require this import so
// the sql package is properly initialized.
// _ "github.com/mattn/go-sqlite3"
import (
"database/sql"
"sync"
"time"
_ "github.com/mattn/go-sqlite3"
"gitlab.com/jarv/cmdchallenge/internal/runner"
)
const (
insertQuery = `
INSERT INTO challe... |
// Copyright 2016 Mender Software AS
//
// 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... |
package restful
// Copyright 2013 <NAME>. All rights reserved.
// Use of this source code is governed by a license
// that can be found in the LICENSE file.
const (
// PathParameterKind = indicator of Request parameter type "path"
PathParameterKind = iota
// QueryParameterKind = indicator of Request parameter typ... |
package policy
import (
"encoding/json"
"capact.io/capact/pkg/sdk/apis/0.0.1/types"
"github.com/pkg/errors"
"sigs.k8s.io/yaml"
)
const (
// AnyInterfacePath holds a value, which represents any Interface path.
AnyInterfacePath string = "cap.*"
)
// Type is the type of the Policy.
type Type string
// MergeOrde... |
package iso20022
// Information describing how the voting process is organised.
type VoteParameters3 struct {
// Number of holdings required for a vote.
SecuritiesQuantityRequiredToVote *DecimalNumber `xml:"SctiesQtyReqrdToVote,omitempty"`
// Specifies whether it is allowed to only vote on a part of the entire ho... |
package handler
import (
"context"
"github.com/99designs/gqlgen/graphql"
"github.com/99designs/gqlgen/graphql/errcode"
"github.com/vektah/gqlparser/v2/ast"
"github.com/vektah/gqlparser/v2/gqlerror"
"github.com/vektah/gqlparser/v2/parser"
"github.com/vektah/gqlparser/v2/validator"
)
type executor struct {
ope... |
// Package queue provides Vault plugins with a Priority Queue. It can be used
// as an in-memory list of queue.Item sorted by their priority, and offers
// methods to find or remove items by their key. Internally it uses
// container/heap; see Example Priority Queue:
// https://golang.org/pkg/container/heap/#example__... |
package local
import (
"gickup/types"
"net"
"os"
"path"
"strings"
"time"
"github.com/go-git/go-git/v5"
"github.com/go-git/go-git/v5/plumbing/transport"
"github.com/go-git/go-git/v5/plumbing/transport/http"
"github.com/go-git/go-git/v5/plumbing/transport/ssh"
"github.com/melbahja/goph"
"github.com/rs/zerol... |
package filer2
import (
"fmt"
"hash/fnv"
"sort"
"sync"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
)
func TotalSize(chunks []*filer_pb.FileChunk) (size uint64) {
for _, c := range chunks {
t := uint64(c.Offset + int64(c.Size))
if size < t {
size = t
}
}
return
}
func ETag(chunks []*filer_pb.F... |
package email
import (
"strings"
)
// HeaderField represents an individual field in the message header. When taken
// from a parsed header, it will preserve the original field, byte-for-byte.
//
// HeaderField is just for storing information about the field. Otherwise it is
// completely stupid. It provides for stor... |
package cmd
import (
"fmt"
"os"
"runtime"
"strconv"
"strings"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/spf13/cobra"
"github.com/turnerlabs/fargate/console"
ECS "github.com/turnerlabs/fargate/ecs"
"golang.org/x/crypto/ssh/ter... |
package runner
import (
"context"
"fmt"
"io"
"math/rand"
"time"
logging "github.com/ipfs/go-log/v2"
"github.com/multiformats/go-multiaddr"
"github.com/textileio/powergate/api/client"
"github.com/textileio/powergate/ffs"
"github.com/textileio/powergate/health"
"google.golang.org/grpc"
)
var (
log = loggin... |
package coordinator
import (
"bytes"
"crypto/sha256"
"encoding/hex"
"fmt"
"net"
"os"
musig "github.com/aureleoules/musig2-coordinator/musig2"
"go.uber.org/zap"
server "github.com/aureleoules/go-packet-server"
"go.dedis.ch/kyber/v3"
)
func connect(addr string) (*net.TCPConn, error) {
zap.S().Info("Connect... |
package config
import (
"fmt"
"io/ioutil"
"os"
"regexp"
"gopkg.in/yaml.v2"
)
// Environments
const (
EnvironmentVar = "BCD_ENV"
EnvironmentDev = "development"
EnvironmentProd = "production"
EnvironmentYou = "you"
EnvironmentBox = "sandbox"
)
// Config -
type Config struct {
RPC map[string]RP... |
// Copyright 2017 The etcd 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 t... |
package commands
import (
"os"
"strconv"
"github.com/hasura/graphql-engine/cli"
migrate "github.com/hasura/graphql-engine/cli/migrate"
"github.com/pkg/errors"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
func newMigrateApplyCmd(ec *cli.ExecutionContext) *cobra.Command {
v := viper.New()
opts := &migr... |
package chicken
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 (
kenBirthday = nook.Birthday{
Day: 23,
Month... |
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License"). You may
// not use this file except in compliance with the License. A copy of the
// License is located at
//
// http://aws.amazon.com/apache2.0/
//
// or in the "license" file ... |
package main
import (
"fmt"
"log"
"net"
"os"
"time"
"io/ioutil"
"gosilk"
"path"
"github.com/calmh/ipfix"
)
type IP []byte
type UDPAddr struct {
IP IP
Port int
Zone string // IPv6 scoped addressing zone
}
type UDP4Addr struct {
IP [4]byte
Port int
}
func writeData(f os.File, ifs []ipfix.Interpret... |
// 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... |
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: scope.proto
package pb
import (
fmt "fmt"
math "math"
proto "github.com/gogo/protobuf/proto"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// This is a compile-time... |
// Copyright 2020 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.
package opensearch
import (
"errors"
"fmt"
"sort"
"strings"
"sync"
"time"
"github.com/keybase/client/go/libkb"
"github.com/keybase/client/go/protocol/gregor1"
"github.com/keybase/client/g... |
package reflect
import (
lua "github.com/anaminus/gopher-lua"
"github.com/anaminus/rbxmk"
"github.com/anaminus/rbxmk/dump"
"github.com/anaminus/rbxmk/dump/dt"
"github.com/anaminus/rbxmk/rtypes"
"github.com/robloxapi/types"
)
func init() { register(ColorSequence) }
func ColorSequence() rbxmk.Reflector {
return ... |
package main
/**
* This file defines the server struct which servers as something to attach the
* router, templates, handlers, and setonotes services to rather than using them
* as package-level variables. Note that this file is not its own package. It is
* still within the `main` package.
*
* This design is bas... |
package main
import (
"fmt"
"log"
"os"
"os/signal"
"strings"
"sync"
"syscall"
"time"
"github.com/fsnotify/fsnotify"
flag "github.com/ogier/pflag"
)
const defaultSubSymbol = "{}"
var (
reflexes []*Reflex
flagConf string
flagSequential bool
flagDecoration string
decoration Decoration
verbos... |
/*
Copyright 2018 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
// Copyright (c) 2018/2019 The DevCo developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package ltc
import (
"bytes"
"encoding/hex"
"errors"
"fmt"
"github.com/devwarrior777/atomicswap/libs"
"github.com/ltcsuite/ltcd/chaincfg/chainhash"
"github.com/ltc... |
package admin
import (
"bytes"
"encoding/json"
"errors"
"github.com/hexa-org/policy-orchestrator/pkg/hawksupport"
"io"
"log"
"net/http"
"strings"
)
type HTTPClient interface {
Get(url string) (resp *http.Response, err error)
Do(req *http.Request) (*http.Response, error)
}
type orchestratorClient struct {
... |
// *** 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 network
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to access information about... |
package http
import (
"context"
"errors"
"net/http"
"runtime/debug"
"strings"
"sync"
"time"
cmds "github.com/TRON-US/go-btfs-cmds"
logging "github.com/ipfs/go-log"
cors "github.com/rs/cors"
)
var log = logging.Logger("cmds/http")
var (
// ErrNotFound is returned when the endpoint does not exist.
ErrNot... |
package console
import (
"fmt"
"github.com/zhongguo168a/leaf/chanrpc"
"github.com/zhongguo168a/leaf/conf"
"github.com/zhongguo168a/leaf/log"
"os"
"path"
"runtime/pprof"
"time"
)
var commands = []Command{
new(CommandHelp),
new(CommandCPUProf),
new(CommandProf),
}
type Command interface {
// must goroutine... |
// Copyright 2016 TiKV Project 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 agr... |
package server
import (
"bytes"
"fmt"
"io"
"os"
"time"
"github.com/go-x-pkg/bufpool"
"github.com/go-x-pkg/dumpctx"
"github.com/go-x-pkg/fnscli"
"github.com/go-x-pkg/log"
"github.com/go-x-pkg/servers"
"github.com/go-x-pkg/xseelog"
"github.com/spf13/pflag"
)
const (
defaultPathConfig string = "/etc/sample... |
package orm
import (
"log"
"math/big"
"net/url"
"reflect"
"github.com/smartcontractkit/chainlink/core/assets"
"github.com/smartcontractkit/chainlink/core/store/models"
"github.com/ethereum/go-ethereum/common"
)
// ConfigSchema records the schema of configuration at the type level
type ConfigSchema struct {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.