text stringlengths 3.08k 10.4k |
|---|
// Copyright 2019 Istio 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 ... |
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build windows
package windriver
// TODO: implement a back buffer.
import (
"image"
"image/color"
"image/draw"
"sync"
"unsafe"
"golang.org/x/exp/sh... |
package lib
import (
"bytes"
"fmt"
"math/rand"
"strconv"
)
// TagItem tag项{"xxx",[1,2,3]}
type TagItem struct {
Key string `json:"type"`
Value []int `json:"list"`
}
//
// Tag 标签,分类处理
//
type Tag struct {
// 名称 tag category
name string
// 标题 标签 分类
title string
// 所有文章列表
articleList []*Article
// 标签列表 ... |
// Copyright (C) MongoDB, Inc. 2014-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 mongostat
import (
"io/ioutil"
"strings... |
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v1beta1
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Creates a tag template. The user should... |
package libnetwork
import (
"sync"
"github.com/docker/docker/pkg/stringid"
"github.com/docker/libnetwork/driverapi"
"github.com/docker/libnetwork/netlabel"
"github.com/docker/libnetwork/options"
"github.com/docker/libnetwork/types"
)
// A Network represents a logical connectivity zone that containers may
// jo... |
// Copyright 2016 The etcd-operator 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... |
package googlesearch
import (
"net/url"
"strings"
)
const (
searchURL = "https://www.google.com/search"
siteTag = "site:"
urlTag = "inurl:"
filetypeTag = "filetype:"
cacheTag = "cache:"
relatedTag = "related:"
extTag = "ext:"
excludeTag = "-"
intitleTag = "intitle:"
intextTa... |
package main
import (
"fmt"
"log"
"os"
"strconv"
"github.com/docopt/docopt-go"
"github.com/fission/fission"
"github.com/fission/fission/buildermgr"
"github.com/fission/fission/controller"
"github.com/fission/fission/executor"
"github.com/fission/fission/kubewatcher"
"github.com/fission/fission/mqtrigger"
... |
package jssdk
import (
"errors"
"math/rand"
"strconv"
"sync/atomic"
"time"
"unsafe"
"github.com/hyacinthus/wechat/mp/core"
)
// jsapi_ticket 中控服务器接口.
type TicketServer interface {
Ticket() (ticket string, err error) // 请求中控服务器返回缓存的 jsapi_ticket
RefreshTicket(currentTicket string) ... |
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use ... |
/*
Copyright 2020 The Vitess 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... |
// Copyright 2021 <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 (
"context"
"encoding/json"
"errors"
"fmt"
"net/http"
"net/url"
"strings"
"time"
"github.com/google/uuid"
"go.mongodb.org/mongo-driver/bson"
... |
// Copyright 2015 Canonical Ltd.
// Licensed under the LGPLv3, see LICENCE file for details.
// 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.golang file.
package filepath
import (
"strings"
)
// The following fu... |
package day7
import (
"fmt"
"sync"
intcode "github.com/jblashki/aoc-intcode-go/v2"
)
const name = "Day 7"
const inputFile = "./day7/program"
// RunDay runs Advent of Code Day 7 Puzzle
func RunDay(verbose bool) {
var maxSignalA int
var maxSignalSeqA []int
var maxSignalB int
var maxSignalSeqB []int
var err er... |
package role
import (
"errors"
"github.com/gogf/gf/os/glog"
"github.com/gogf/gf/text/gstr"
"github.com/gogf/gf/util/gconv"
"gmanager/app/constants"
"gmanager/app/model/role"
"gmanager/app/model/role_menu"
"gmanager/app/service/log"
"gmanager/library"
"gmanager/library/base"
)
// 请求参数
type Request struct {
... |
package main
import (
"errors"
"flag"
"fmt"
"io/ioutil"
"gopkg.in/yaml.v2"
)
// Config is the top-level console configuration.
type Config struct {
APIVersion string `yaml:"apiVersion"`
Kind string `yaml:"kind"`
ServingInfo `yaml:"servingInfo"`
ClusterInfo `yaml:"clusterInfo"`
Auth ... |
/*
Copyright (c) 2009 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 code must retain the above copyright
notice, this list of conditions and the followin... |
/*
* Copyright 2019-2020, Offchain 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 ... |
// Copyright 2020 The Hugo 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 applicable ... |
// Copyright 2020 The LevelDB-Go and Pebble Authors. All rights reserved. Use
// of this source code is governed by a BSD-style license that can be found in
// the LICENSE file.
//go:build jemalloc
// +build jemalloc
package z
/*
#cgo LDFLAGS: /usr/local/lib/libjemalloc.a -L/usr/local/lib -Wl,-rpath,/usr/local/lib -... |
package gumble
import (
"encoding/binary"
"errors"
"io"
"net"
"sync"
"time"
"github.com/golang/protobuf/proto"
"github.com/layeh/gumble/gumble/MumbleProto"
"github.com/layeh/gumble/gumble/varint"
)
// DefaultPort is the default port on which Mumble servers listen.
const DefaultPort = 64738
// Conn represen... |
// Copyright 2015 <NAME>. All rights reserved.
package testutil
import (
"bytes"
"fmt"
"io"
"os/exec"
"strings"
"syscall"
"time"
"github.com/pkg/errors"
)
// TestAppResult is a result of a 'go run' program launch
type TestAppResult struct {
Output string
Err error
}
// StringToBytes takes an input str... |
//go:build integration
// +build integration
package aws
import (
"fmt"
"os"
"testing"
"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/sns"
"github.com/aws/aws-sdk-go/service/sns/snsiface"
"github.... |
package main
import (
"bufio"
"fmt"
"log"
"math"
"os"
"sort"
"strings"
)
const Reset = "\033[0m"
const Red = "\033[31m"
const Green = "\033[32m"
const Yellow = "\033[33m"
func main() {
patterns, outputs, err := Loader("input.txt")
if err != nil {
log.Fatal(err)
}
_ = patterns
_ = outputs
fmt.Printf(... |
package master
import (
"bytes"
"encoding/json"
"errors"
"fmt"
"net/http"
"sort"
"sync"
"time"
"github.com/Focinfi/oncekv/config"
"github.com/Focinfi/oncekv/db/master"
"github.com/Focinfi/oncekv/log"
"github.com/Focinfi/oncekv/meta"
"github.com/Focinfi/oncekv/utils/mock"
"github.com/Focinfi/oncekv/utils... |
package v1alpha1
import (
apiextensionsv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)
const (
kindChart = "Chart"
)
// NewChartCRD returns a new custom resource definition for Chart.
// This might look something like the following.
//
// ... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package iot
import (
"context"
"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 ListAttachedPoliciesInput struct {
_ struct{} `type:"structure"`
// The... |
package helpers
import (
"fmt"
"github.com/clarketm/json"
ign3types "github.com/coreos/ignition/v2/config/v3_2/types"
"github.com/vincent-petithory/dataurl"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
utilrand "k8... |
package instrumentedwriter
/* Original Instpiration comes from https://github.com/mash/go-accesslog/
*/
import (
"bufio"
"fmt"
"net"
"net/http"
"strings"
"time"
"github.com/prometheus/client_golang/prometheus"
)
type LogRecord struct {
Time time.Time
Ip, Method, Uri, ... |
package cmd
/*
Copyright © 2019 <NAME> (aka Dayo)
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions an... |
package countmin_test
import (
"encoding/csv"
"math/rand"
"os"
"sort"
"testing"
"github.com/nfisher/gstream/countmin"
)
func Test_inner_product(t *testing.T) {
td := map[string]struct {
k1 []string
k2 []string
product uint64
}{
"should equal 0 with empty sketch": {[]string{}, []string{}, 0}... |
// This code is a somewhat simplified and changed up version of
// github.com/canonical/go-efilib credits go their authors.
// It allows interaction with the efivarfs via u-root which means
// both read and write support.
package efivarfs
import (
"bytes"
"errors"
"io"
"os"
"strings"
"golang.org/x/sys/unix"
)
... |
/*
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, ... |
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2016-present Datadog, Inc.
//go:build docker
// +build docker
package metrics
import (
"context"
... |
/*
Copyright 2020 The cert-manager 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... |
// This file is part of MinIO Operator
// Copyright (C) 2020, MinIO, Inc.
//
// This code is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License, version 3,
// as published by the Free Software Foundation.
//
// This program is distributed in the hope that... |
package container // import "github.com/demonoid81/moby/integration/container"
import (
"context"
"fmt"
"os/exec"
"regexp"
"sort"
"testing"
"time"
"github.com/demonoid81/moby/api/types"
mounttypes "github.com/demonoid81/moby/api/types/mount"
"github.com/demonoid81/moby/client"
"github.com/demonoid81/moby/i... |
package day13
import (
"advent2019/day02"
"advent2019/day05"
"github.com/nfnt/resize"
"image"
"image/color"
"image/png"
"log"
"math"
"os"
)
type point struct {
x, y int
}
func point_add(a point, b point) point {
return point{a.x+b.x,a.y+b.y}
}
func point_sub(a point, b point) point {
return point{a.x-b.... |
// LianDi - 链滴笔记,连接点滴
// Copyright (c) 2020-present, b3log.org
//
// LianDi is licensed under Mulan PSL v2.
// You can use this software according to the terms and conditions of the Mulan PSL v2.
// You may obtain a copy of Mulan PSL v2 at:
// http://license.coscl.org.cn/MulanPSL2
// THIS SOFTWARE IS PROVIDED O... |
package agent
import (
"fmt"
"log"
"math"
"sync/atomic"
"time"
"github.com/influxdata/telegraf"
"github.com/influxdata/telegraf/internal/models"
)
func NewAccumulator(
inputConfig *models.InputConfig,
metrics chan telegraf.Metric,
) *accumulator {
acc := accumulator{}
acc.metrics = metrics
acc.inputConfi... |
package worker
import (
"crypto/tls"
"log"
"net/url"
"os"
"path"
"time"
"github.com/giongto35/cloud-game/pkg/config"
"github.com/giongto35/cloud-game/pkg/config/worker"
"github.com/giongto35/cloud-game/pkg/util"
"github.com/giongto35/cloud-game/pkg/webrtc"
storage "github.com/giongto35/cloud-game/pkg/work... |
package main
import (
"fmt"
"log"
"net/url"
"strings"
"github.com/MattHodge/go-teedy/evernote"
"github.com/MattHodge/go-teedy/backup"
"github.com/MattHodge/go-teedy/restore"
"github.com/MattHodge/go-teedy/teedy"
"github.com/alexflint/go-arg"
)
// values are replaced by go releaser
var version = "developmen... |
// Copyright 2020 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 perf
import (
"context"
"time"
"chromiumos/tast/errors"
"chromiumos/tast/testing"
)
// Timeline datasources provide periodic performance... |
package slack
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestNewImageBlockElement(t *testing.T) {
imageElement := NewImageBlockElement("https://api.slack.com/img/blocks/bkb_template_images/tripAgentLocationMarker.png", "Location Pin Icon")
assert.Equal(t, string(imageElement.Type), "image")... |
package tendermint
import (
"path/filepath"
"sync"
"github.com/pkg/errors"
"github.com/spf13/viper"
"github.com/tendermint/tendermint/config"
"github.com/tendermint/tendermint/p2p"
"github.com/tendermint/tendermint/p2p/pex"
"github.com/tendermint/tendermint/types"
"github.com/tendermint/tendermint/version"
... |
/*
* 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 ... |
// Copyright 2019 The Fuchsia 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 sl4f
import (
"bytes"
"context"
"encoding/json"
"fmt"
"log"
"net/http"
"os"
"strings"
"sync/atomic"
"time"
"go.fuchsia.dev/fuchsia/too... |
// Copyright 2016-2021 The Libsacloud 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... |
package v2
import (
"context"
"encoding/json"
"fmt"
"net/http"
"sort"
"time"
"github.com/CMSgov/dpc/api/client"
"github.com/CMSgov/dpc/api/conf"
"github.com/CMSgov/dpc/api/fhirror"
"github.com/CMSgov/dpc/api/logger"
"github.com/CMSgov/dpc/api/middleware"
"github.com/CMSgov/dpc/api/model"
"go.uber.org/zap... |
package net
import (
"fmt"
"net/http"
"os"
"strconv"
"strings"
"time"
"github.com/dgrijalva/jwt-go/v4"
)
const (
// Headers keys
Accept = "Accept"
ContentTypeKey = "Content-Type"
CorsOrigin = "Access-Control-Allow-Origin"
CorsHeaders = "Access-Control-Allow-Headers"
CorsMethods = "Acce... |
package postgres
import (
"context"
"github.com/jackc/pgx/v4"
"github.com/jackc/pgx/v4/pgxpool"
"github.com/manabie-com/togo/internal/storages"
"github.com/pkg/errors"
"time"
)
var (
ErrIncorrectUsernameOrPassword = errors.New("username or password is not correct")
ErrUserMaxTodoReached = errors.New(... |
package server
import (
"encoding/json"
"fmt"
"log"
"net/http"
"os"
"os/exec"
"path/filepath"
"strings"
"sync/atomic"
"time"
"github.com/sourcegraph/sourcegraph/internal/gitserver/protocol"
log15 "gopkg.in/inconshreveable/log15.v2"
)
var patchID uint64
func (s *Server) handleCreateCommitFromPatch(w http... |
package hatchery
import (
"fmt"
"os"
"strings"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/efs"
)
type EFS struct {
EFSArn string
FileSystemId string
AccessPointId string
}
func (creds *CREDS) getEFSFileSystem(userName string, s... |
// Package dnsserver implements a DNS server, that uses the given resolvers to
// handle requests.
package dnsserver
import (
"crypto/rand"
"encoding/binary"
"fmt"
"net"
"strings"
"sync"
"github.com/coreos/go-systemd/activation"
"github.com/miekg/dns"
"golang.org/x/net/trace"
"blitiri.com.ar/go/dnss/intern... |
/*
Copyright 2019 The OpenEBS 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 tracker
import (
"errors"
"fmt"
"os"
"path/filepath"
"strings"
"github.com/artifacthub/hub/internal/hub"
"github.com/artifacthub/hub/internal/pkg"
"github.com/artifacthub/hub/internal/repo"
"github.com/rs/zerolog"
)
// Tracker is in charge of tracking the packages available in the repository
// prov... |
package jwit
import (
"crypto"
"net/http"
"time"
"gopkg.in/square/go-jose.v2"
"gopkg.in/square/go-jose.v2/jwt"
)
// Verifier can verify a JWT validity. Don't create verifiers directly, use jwit.NewVerifier*
// helpers instead.
type Verifier struct {
// Issuers a set of trusted issuers, mapped by name (corresp... |
package server
import (
"log"
"net"
"runtime"
"time"
"github.com/ClickHouse-Ninja/ninjato/src/binary"
"github.com/ClickHouse-Ninja/ninjato/src/point"
"github.com/kshvakov/clickhouse"
"github.com/kshvakov/clickhouse/lib/data"
"github.com/pierrec/lz4"
)
const (
BacklogSize = 5000
MaxBlockInQueue = 20
)
... |
package poll
import (
"context"
"math/big"
"time"
"github.com/MeshBoxFoundation/mesh-core/action"
"github.com/MeshBoxFoundation/mesh-core/action/protocol"
"github.com/MeshBoxFoundation/mesh-core/action/protocol/staking"
"github.com/MeshBoxFoundation/mesh-core/state"
"github.com/iotexproject/go-pkgs/hash"
"gi... |
/*
Copyright (c) Facebook, Inc. and its affiliates.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
*/
// Package handlers provided AKA Response handlers for supported AKA subtypes
package handlers
import (
"io"
"log... |
package config_test
import (
"context"
"strings"
"testing"
"github.com/stretchr/testify/assert"
. "github.com/saiya/dsps/server/config"
. "github.com/saiya/dsps/server/testing"
)
func TestChannelWebhookDefaultConfig(t *testing.T) {
configYaml := strings.ReplaceAll(`
channels:
-
regex: 'chat-room-(?P<id>\d+)... |
package gw2api
// PvPStats contains the accounts pvp stats
type PvPStats struct {
PvPRank int `json:"pvp_rank"`
PvPRankPoints int `json:"pvp_rank_points"`
PvPRankRollovers int `json:"pvp_rank_rollovers"`
Aggregate PvPWinLossSta... |
/*
* Copyright 2017-2018 <NAME>, Inc. and Contributors
*
* 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 appli... |
package types
import (
"fmt"
. "github.com/protolambda/zssz/dec"
. "github.com/protolambda/zssz/enc"
. "github.com/protolambda/zssz/htr"
"github.com/protolambda/zssz/merkle"
. "github.com/protolambda/zssz/pretty"
"github.com/protolambda/zssz/util/ptrutil"
"reflect"
"unsafe"
)
type SSZList struct {
alloc ... |
// package live_query implements an interface for storing and
// retrieving live queries.
//
// Design
//
// This package operates by storing a single redis key for host
// targeting information. This key has a known prefix, and the data
// is a bitfield representing _all_ the hosts in fleet.
//
// In this model, a liv... |
/* ****************************************************************************
* Copyright 2020 51 Degrees Mobile Experts Limited (51degrees.com)
*
* 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 Li... |
// Package provides a shifted fibonacci encoding of unsigned integers.
//
// http://en.wikipedia.org/wiki/Fibonacci_coding maps positive integers as
// 1 - 11, 2 - 011, 3 - 0011, 4 - 1011, 5 - 00011
//
// Incrementing input by one to allow for zero gives
// 0 - 11, 1 - 011, 2 - 0011, 3 - 1011, 4 - 00011
//
// The codes... |
package tools
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"os/exec"
"regexp"
"strings"
)
type TestCase struct {
Input string `json:"input"`
Output string `json:"output"`
}
type TestResult struct {
Pass bool
Output string
Predict string
}
const cacheDir = "./.cacheTest/"
func init(... |
// Copyright (c) 2021 Target Brands, Inc. All rights reserved.
//
// Use of this source code is governed by the LICENSE file in this repository.
package pipeline
import (
"fmt"
"github.com/go-vela/cli/action"
"github.com/go-vela/cli/action/pipeline"
"github.com/go-vela/cli/internal"
"github.com/go-vela/server/c... |
// Copyright 2019 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
/*
Copyright 2019 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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
di... |
// Command prom-wrapper provides a wrapper command for Prometheus that
// also handles Sourcegraph configuration changes and making changes to Prometheus.
//
// See https://docs.sourcegraph.com/dev/background-information/observability/prometheus
package main
import (
"context"
"errors"
"fmt"
"net/http"
"net/http/... |
package skademlia
import (
"bytes"
"crypto/rand"
"encoding/hex"
"fmt"
"github.com/perlin-network/noise/identity"
"github.com/perlin-network/noise/internal/edwards25519"
"github.com/pkg/errors"
"golang.org/x/crypto/blake2b"
)
const (
// DefaultC1 is the prefix-matching length for the static crypto puzzle.
De... |
package main
import (
"bufio"
"bytes"
"fmt"
"io/ioutil"
"log"
"math"
"os"
"sort"
"strconv"
"strings"
"./util"
)
var linking_point bool
var lastBeam util.BeamBoundingBox
func main() {
var csvbuf bytes.Buffer
scanner := bufio.NewScanner(os.Stdin)
// line scanner
for scanner.Scan() {
// comment line... |
package main
import (
"errors"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"net/http"
"os"
"os/signal"
"strconv"
"sync"
"time"
"github.com/gorilla/handlers"
"github.com/gorilla/mux"
"github.com/nats-io/go-nats"
)
// MaxRequestSize is the maximum size of the POST body
const MaxRequestSize = 16384
type config ... |
package distribution
import (
"github.com/ALiuGuanyan/distributed-tasks-scheduling/microservices/entities"
myconfig "github.com/ALiuGuanyan/distributed-tasks-scheduling/microservices/tasks-manager-worker-service/config"
myutils "github.com/ALiuGuanyan/distributed-tasks-scheduling/microservices/utils"
"sync"
"time... |
// SPDX-FileCopyrightText: 2020-present Open Networking Foundation <<EMAIL>>
//
// SPDX-License-Identifier: Apache-2.0
package manager
import (
"context"
"github.com/onosproject/onos-lib-go/pkg/logging"
"github.com/onosproject/onos-lib-go/pkg/northbound"
"github.com/onosproject/onos-mlb/pkg/config"
"github.com/... |
package zhihu_bianji
// 基础包
import (
"github.com/justinyaoqi/pholcus/app/downloader/request" //必需
. "github.com/justinyaoqi/pholcus/app/spider" //必需
"github.com/justinyaoqi/pholcus/common/goquery" //DOM解析
// . "github.com/justinyaoqi/pholcus/app/spider/common" //选用
//"github.com/justinyaoqi/... |
// Package router (mux) provides a simple Discord message route multiplexer that
// parses messages and then executes a matching registered handler, if found.
// mux can be used with both Disgord and the DiscordGo library.
package router
import (
"fmt"
"log"
"os"
"regexp"
"strings"
"github.com/bwmarrin/discordg... |
package main
import (
"github.com/cloudflare/xdpcap/internal"
"github.com/cilium/ebpf"
"github.com/cilium/ebpf/perf"
"github.com/pkg/errors"
"golang.org/x/net/bpf"
)
type packet struct {
action xdpAction
data []byte
}
var perfMapSpec = ebpf.MapSpec{
Name: "xdpcap_perf",
Type: ebpf.PerfEventArray,
}
type... |
// Copyright (c) The Thanos Authors.
// Licensed under the Apache License 2.0.
package storecache
import (
"context"
"time"
"github.com/go-kit/kit/log"
"github.com/go-kit/kit/log/level"
"github.com/oklog/ulid"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/pro... |
// 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
// distribut... |
package cluster
import (
"fmt"
"net"
"os"
"path/filepath"
"time"
_ "github.com/mattn/go-sqlite3" // load sqlite3 drivers
"github.com/dihedron/brokerd/log"
"github.com/hashicorp/raft"
raftboltdb "github.com/hashicorp/raft-boltdb"
"go.uber.org/zap"
)
// Cluster represents a raft cluster
type Cluster struct ... |
/*
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 pivx is a pivx specific implementation of the masternode monitor tool.
package pivx
////////////////////////////////////////////////////////////////////////////////
import (
"errors"
"flag"
"fmt"
"path/filepath"
"github.com/sabhiram/gomn/coin"
"github.com/sabhiram/gomn/types"
)
////////////////////... |
/*
* Program to monitor a folder and uploads files from that folder to an HTTP server.
*
* This program, which uses curl to upload files, reads a conf file where the params for the
* program to operate must exist. That conf file (picservice.conf) must exist in the user's
* home folder or be passed as an argumen... |
/*
* Copyright (C) 2018 eeonevision
*
* 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... |
package session
import (
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"sync"
"github.com/DataDog/zstd"
log "github.com/sirupsen/logrus"
"github.com/pion/quic"
"github.com/sdslabs/portkey/pkg/utils"
)
func ReadLoopN(streams []*quic.BidirectionalStream, blockNumber int,receivePath string, wg *sync.WaitGroup) {
defe... |
// Copyright © 2017 mozillazg
//
// 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, distr... |
/*
Copyright 2019 GM Cruise 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 writing, software
dist... |
// Copyright 2019 The gVisor 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... |
// Copyright © 2017 The Things Network
// Use of this source code is governed by the MIT license that can be found in the LICENSE file.
package cmd
import (
"fmt"
"io/ioutil"
"os"
"strings"
"github.com/TheThingsNetwork/api/handler"
"github.com/TheThingsNetwork/go-utils/log"
"github.com/TheThingsNetwork/ttn/tt... |
package nessie
import (
"bytes"
"encoding/json"
"net/http"
"testing"
"text/template"
"time"
"github.com/stretchr/testify/require"
"github.com/treeverse/lakefs/pkg/api"
)
const actionPreMergeYaml = `
name: Test Merge
description: set of checks to verify that branch is good
on:
pre-merge:
branches:
... |
package authorizenet
type TransactionType string
const (
TransactionTypeAuthOnly TransactionType = "authOnlyTransaction"
TransactionTypeVoid TransactionType = "voidTransaction"
TransactionTypePriorAuthCapture TransactionType = "priorAuthCaptureTransaction"
TransactionTypeRefund Trans... |
// Code generated by go-swagger; DO NOT EDIT.
package buckets
// 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.com/... |
package forwarder
import (
"sync/atomic"
l "github.com/Sirupsen/logrus"
"github.com/tsheasha/relayd/config"
)
// Some sane values to default things to
const (
DefaultBufferSize = 100
DefaultKeepAliveInterval = 30
)
var defaultLog = l.WithFields(l.Fields{"app": "relayd", "pkg": "forwarder"})
var forward... |
/*
Copyright (C) 2019 Synopsys, Inc.
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
"... |
package block
import (
"fmt"
"github.com/df-mc/dragonfly/server/block/cube"
"github.com/df-mc/dragonfly/server/internal/nbtconv"
"github.com/df-mc/dragonfly/server/item"
"github.com/df-mc/dragonfly/server/item/inventory"
"github.com/df-mc/dragonfly/server/world"
"github.com/df-mc/dragonfly/server/world/sound"
... |
package main
import (
"github.com/yarntime/data_generator/mkp"
"fmt"
"os"
"bufio"
)
var normalInstances []mkp.InstanceType
var difficultInstances = []string{"UncorrelatedSpannerInstances", "WeaklyCorrelatedSpannerInstances", "StronglyCorrelatedSpannerInstances",
"MultipleStronglyCorrelatedInstances", "ProfitCeil... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.