blob_id stringlengths 40 40 | content_id stringlengths 40 40 | repo_name stringlengths 5 114 | path stringlengths 5 318 | language stringclasses 5
values | extension stringclasses 12
values | length_bytes int64 200 200k | license_type stringclasses 2
values | content stringlengths 143 200k |
|---|---|---|---|---|---|---|---|---|
2de2a386a75d19e2daaab7a90f0e6241762849ee | 9beb3cf5637f1d4c5e9c3a38f534302de03180b3 | pantianying/sentinel-golang | /core/stat/base_node.go | Go | go | 2,032 | permissive | package stat
import (
"github.com/sentinel-group/sentinel-golang/core/base"
sbase "github.com/sentinel-group/sentinel-golang/core/stat/base"
"sync/atomic"
)
type BaseStatNode struct {
sampleCount uint32
intervalMs uint32
goroutineNum int32
arr *sbase.BucketLeapArray
metric *sbase.SlidingWindowMetric
}
... |
09f2235dad1262be8d92065b43a8876309135db5 | 41a5cef191514ec9afc00ad6fddeb096bb67fea5 | nguest/Mappo-Web | /utils/files/getFileContents.go | Go | go | 4,291 | no_license | package files
import (
"bufio"
"context"
"encoding/json"
"fmt"
"io/ioutil"
"os"
"strings"
"time"
"github.com/nguest/mappo-web/models"
"github.com/nguest/mappo-web/utils/tracks"
"cloud.google.com/go/storage"
)
//read
func readLocalFile(filepath string) ([]string, error) {
file, err := os.Open(filepath)
... |
ae3607aa76c394816de6731a651a2826f3463017 | 089f8a81e3dda011134cc9588577ff39f352e4f1 | hetianxia/oci-go-sdk | /dts/transfer_job.go | Go | go | 4,472 | permissive | // Copyright (c) 2016, 2018, 2021, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei... |
f6b2a5cc512a9b5ba96f55ce7b11fbd06f6c3d2e | 05b97c96199230e85067b89f5f38dc1ffb3f1893 | 2225377fjs/gostudy | /lib/rsa.go | Go | go | 4,265 | no_license | package lib
import (
"encoding/pem"
"errors"
"crypto/x509"
"fmt"
"crypto/rsa"
"crypto/sha1"
"crypto"
"encoding/base64"
"crypto/rand"
)
// loadPrivateKey loads an parses a PEM encoded private key file.
func loadPrivateKey(path string) (Signer, error) {return parsePrivateKey([]byte(`-----BEGIN RSA PRIVATE K... |
284bab3ed489f93243c5a3482d8dfacdd735fc78 | 1f52d1e243dea2742c6afd19047f21945a61d11d | syukri21/Paperid-Golang-Testcase | /src/middlewares/validations/validate.go | Go | go | 871 | permissive | package validations
import (
"fmt"
"github.com/syukri21/Paperid-Golang-Testcase/src/middlewares/exception"
"github.com/go-playground/validator/v10"
)
// Validate -> function to validate request
func Validate(schema interface{}, errors []map[string]interface{}) {
/**
* create validator instance
*/
validate ... |
cf4adb7c08d0fdaa8b276ed91352a7f845b4eec7 | 550e079a0dcf3372612119d420ec77c30fee6bee | rolends1986/cli | /altsrc/json_command_test.go | Go | go | 8,168 | permissive | package altsrc
import (
"flag"
"io/ioutil"
"os"
"testing"
"urfavecli"
)
const (
fileName = "current.json"
simpleJSON = `{"test": 15}`
nestedJSON = `{"top": {"test": 15}}`
)
func TestCommandJSONFileTest(t *testing.T) {
cleanup := writeTempFile(t, fileName, simpleJSON)
defer cleanup()
app := &cli.App{}
... |
9ea20f489e7309839c8034d769df90d9d0f17c0b | 2abe40c629e7b47b9d29b86f357d7784a266f766 | zyfrank/go-centrifuge | /utils/httputils/utils.go | Go | go | 483 | permissive | package httputils
import (
"net/http"
"github.com/go-chi/render"
)
// HTTPError contains the error message
type HTTPError struct {
Message string `json:"message"`
}
// RespondIfError if err != nil, returns the HTTPError and code as API response
// no-op if the err is nil
func RespondIfError(code *int, err *error... |
536c15e7c0738a7d19dcb739dca16021a9c77bc0 | 373d1eb465065702ed5cbc373d069daec238ecbd | chukuang2004/leetcode | /bytedance/stack.go | Go | go | 2,177 | no_license | package main
import (
"fmt"
)
type Node struct {
pre *Node
next *Node
val int
}
type NodeContainer struct {
pre *NodeContainer
next *NodeContainer
val *Node
}
type MinStack struct {
tail *NodeContainer
minTail *Node
}
/** initialize your data structure here. */
func Constructor() MinStack {
s := ... |
c86727bf2d87f2e30ce959d718e6fd13d30adbf7 | 9237451a7645d746cf8bd854b1e094a42cb038dd | jccisco/terraform-provider-openapi | /openapi/openapi_spec_security_definition_apikey_header_test.go | Go | go | 5,519 | permissive | package openapi
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestNewAPIKeyHeaderSecurityDefinition(t *testing.T) {
Convey("Given a name and an apikey name", t, func() {
name := "name"
apiKeyName := "apiKey_name"
Convey("When newAPIKeyHeaderSecurityDefinition method is called", func... |
28492fc330b7f40b0b10dc2633273106c98da235 | cb82b8a4aa05b4f066035452bb55577436ba2754 | srinivasyadav18/xapian-gsoc-plan | /example-type.go | Go | go | 206 | no_license | package main
import("fmt")
type Integer int
//BOTH THE TYPES int and Integer are now different
func example (a Integer){
fmt.Println(a)
}
func main(){
var x int =10
example(x)
}
|
1e644d6edf9e266b31987d8546d198bca332a3e6 | b111fb1af556db0521f6eb1b2404f647bef057cd | lmsreborn/seaweedfs | /weed/server/volume_server_handlers_read.go | Go | go | 8,908 | permissive | package weed_server
import (
"bytes"
"io"
"mime"
"mime/multipart"
"net/http"
"net/url"
"path"
"strconv"
"strings"
"time"
"encoding/json"
"github.com/chrislusf/seaweedfs/weed/glog"
"github.com/chrislusf/seaweedfs/weed/images"
"github.com/chrislusf/seaweedfs/weed/operation"
"github.com/chrislusf/seaweed... |
2d1b64bb82c4cba82108bd6062c8edf245df877b | 904cc0162d3ebbc20b20194043acbd36e5b714c9 | tqcenglish/peach | /models/protect.go | Go | go | 1,738 | permissive | // Copyright 2015 Unknwon
//
// 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 writ... |
b49872b8d926ac81e7cf5fcb4e958d61bddb21df | efda5642d82670c2f6bd9c9594360f06d851229f | paulormart/samples | /routines.go | Go | go | 258 | no_license | package main
import (
"fmt"
"time"
)
func count(id int) {
for i := 0; i < 10; i++ {
fmt.Println(id, ":", i)
time.Sleep(time.Millisecond * 1000)
}
}
func main() {
for i := 0; i < 10; i++ {
go count(i)
}
time.Sleep(time.Millisecond * 100000)
}
|
61fa5a8c561b5127a5da8c1c797a8f0bb57139e1 | 5959217a66e4b09ecbc556904c759fdd8365a525 | jrmConduce/redishappy | /services/template/writer_test.go | Go | go | 885 | permissive | package template
import (
"fmt"
"testing"
"github.com/jrmConduce/redishappy/types"
)
func TestLoadTempate(t *testing.T) {
path := "../../build/configs/redis-haproxy/haproxy_template.cfg"
collection := types.NewMasterDetailsCollection()
collection.AddOrReplace(&types.MasterDetails{Name: "one", Ip: "10.0.0.1", ... |
e253ab4156388902a2917d297c234a70b1b75c52 | 2d11da4384203b361b13a9171a6abfdd42155af6 | sfomuseum/go-whosonfirst-tiles | /zoom.go | Go | go | 1,362 | permissive | package tiles
import (
"fmt"
"regexp"
"strconv"
"strings"
)
// ZoomLevelsFromString will return a list of uint zoom levels from a string formatted as '1,2,3...' or '1-10'.
func ZoomLevelsFromString(zoom_str string) ([]uint, error) {
var zooms []uint
re_zoom, err := regexp.Compile(`^\d+\-\d+$`)
if err != nil... |
2827c4b4207afacb2c8ab22cea2998fe619a486a | 32317d534dee59ce9926939fffab8b6187217482 | Aimneat/practice-go | /LeetCodetest.go | Go | go | 282 | no_license | package main
import "fmt"
func removeElement(nums []int, val int) int {
for i,v:=range nums{
if v==val{
nums=append(nums[:i],nums[i+1:]...)
i--
}
}
return len(nums)
}
func main(){
nums:=[]int{0,1,2,2,3,0,4,2}
lens:=removeElement(nums,2)
fmt.Println("len=",lens)
} |
f6a65c89b0e5b3a37e82fdc49d1656dd9d91b84d | 28f8abe45d46fc234be6e360ef43c54ab17a369f | NBonaparte/shiori | /internal/webserver/server.go | Go | go | 3,051 | permissive | package webserver
import (
"fmt"
"net/http"
"path"
"time"
"github.com/go-shiori/shiori/internal/database"
"github.com/julienschmidt/httprouter"
cch "github.com/patrickmn/go-cache"
"github.com/sirupsen/logrus"
)
// Config is parameter that used for starting web server
type Config struct {
DB datab... |
2a44b7eb8c9e369214d966b5323e61f80b9bc453 | 3aede4b88dc3e9fb88a0b631e931eda748b4ebbf | sharmasecureservicesusa/onelogin | /terraform/importables/okta_apps_test.go | Go | go | 2,398 | permissive | package tfimportables
import (
"context"
"github.com/okta/okta-sdk-golang/v2/okta"
"github.com/okta/okta-sdk-golang/v2/okta/query"
"github.com/stretchr/testify/assert"
"testing"
)
func TestAssembleOktaAppResourceDefinitions(t *testing.T) {
tests := map[string]struct {
InputApps []okta.App
ExpectedOut []Re... |
40260d8c716073642e9e242bd641654bff3842d7 | 616a5f5aff4d9211faf98d2e4f8887d8e75edfc8 | leaddevops/kubernetes | /pkg/kubectl/describe_test.go | Go | go | 25,336 | permissive | /*
Copyright 2014 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, ... |
61ec5e412d447e203ee11d5e91aa4036ca7544f6 | 08e107740619f765ad028681380a7154636a2813 | iCodeIN/recv | /server/cmd/cli/config.go | Go | go | 947 | permissive | package main
import (
"flag"
"os"
)
type Config struct {
roomCode string
domain string
scheme string
wsscheme string
}
var config *Config
func GetConfig() *Config {
if config == nil {
InitConfig()
}
return config
}
func InitConfig() {
_DOMAIN := "recv.live" // Your website
_SECURE := true /... |
6c9f7a1a6b6236941c3e5ea4d645c538c2626cc1 | b6ee88b0bf8ec45dc039d6632da694fd4e12c3fe | gxiny/mini-UPS | /backend/pb/proto.go | Go | go | 1,235 | no_license | // Package pb contains packages generated from Google Protocol Buffer
// and provides convenience functions for reading/writing protobuf.
package pb
//go:generate protoc --go_out=amz amz.proto
//go:generate protoc --go_out=ups ups.proto
//go:generate protoc --go_out=bridge bridge.proto
//go:generate protoc --go_out=we... |
e0ac4dd1a66af6cdfae889b2d04e43a2f7891e88 | b849223da1a1b35acca8f0376f4c5d346c8ad03d | tsingson/fastpool | /iplimit/peripconn.go | Go | go | 1,750 | permissive | package iplimit
import (
"fmt"
"net"
"sync"
)
type PerIPConnCounter struct {
pool sync.Pool
lock sync.Mutex
m map[uint32]int
}
func (cc *PerIPConnCounter) Register(ip uint32) int {
cc.lock.Lock()
if cc.m == nil {
cc.m = make(map[uint32]int)
}
n := cc.m[ip] + 1
cc.m[ip] = n
cc.lock.Unlock()
return n... |
cf031f560408644374610a3f19c14371c829dcd4 | ff56b74a45d862e09b2814207c974c94c96e8ce6 | azurehongqiang/quic-go | /internal/wire/header_test.go | Go | go | 16,024 | permissive | package wire
import (
"bytes"
"encoding/binary"
"io"
"github.com/lucas-clemente/quic-go/internal/protocol"
"github.com/lucas-clemente/quic-go/internal/qerr"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Header Parsing", func() {
appendVersion := func(data []byte, v protocol.Versio... |
fa91fc52ee2349ee9316603f1d6752ea183dd283 | 1ad33176bebb960142e8d14c20f5bd4663cf20ba | my6889/k8s.yaml | /heapster/vendor/gopkg.in/olivere/elastic.v3/search_queries_exists.go | Go | go | 1,296 | permissive | // Copyright 2012-2015 Oliver Eilhard. All rights reserved.
// Use of this source code is governed by a MIT-license.
// See http://olivere.mit-license.org/license.txt for details.
package elastic
// ExistsQuery is a query that only matches on documents that the field
// has a value in them.
//
// For more de... |
ab62d6bba2777c4e4db4d0f56a7c899f444e0bb0 | eda8ec465d7fb8c9e2d4d42cbdcfd18bdacb8341 | storageos/go-cli | /apiclient/openapi/namespace.go | Go | go | 3,291 | no_license | package openapi
import (
"context"
"github.com/antihax/optional"
openapi "github.com/storageos/go-api/autogenerated"
"code.storageos.net/storageos/c2-cli/apiclient"
"code.storageos.net/storageos/c2-cli/model"
"code.storageos.net/storageos/c2-cli/pkg/id"
"code.storageos.net/storageos/c2-cli/pkg/labels"
)
// ... |
fe9e8a4149acf9001cc05bf40b3c7f92852c0c7b | 0f0ced1bb88b719d42652f0149fff8370bcae643 | pcmoen/device | /bootstrap-api/gateway.go | Go | go | 6,353 | no_license | package bootstrap_api
import (
"encoding/json"
"fmt"
"github.com/go-chi/chi"
"github.com/nais/device/pkg/bootstrap"
"github.com/nais/device/pkg/version"
"github.com/prometheus/client_golang/prometheus"
log "github.com/sirupsen/logrus"
"net/http"
"strings"
"sync"
"time"
)
/*
-> = POST
<- = GET
1. gateway ... |
aae24aaac61328f7957f307533da05140a31d5f7 | c3803bab74dfd64f41dc613ae10b97eb220509c0 | nathanshort/adventofcode2019 | /14/14.go | Go | go | 2,045 | no_license | package main
import (
"bufio"
"fmt"
"math"
"os"
"regexp"
"sort"
"strings"
)
type component struct {
count int64
chemical string
}
func parse(s string) component {
var c = component{}
fmt.Sscanf(s, "%d %s", &c.count, &c.chemical)
return c
}
type reaction struct {
inputs []component
output component
... |
2626be1ef8691ccdf613c00735ff4d249d270d0e | 3f352236043a15c3899f7aae65759a78aa805da3 | toasterlint/DAWS | /common/utils/utils.go | Go | go | 409 | no_license | package utils
import (
"fmt"
"log"
"os"
)
var Logger *log.Logger
func InitLogger() {
Logger = log.New(os.Stdout, "", 0)
Logger.SetPrefix("")
}
func LogToConsole(message string) {
Logger.Printf("\r\033[0K%s", message)
Logger.Printf("\r\033[0KCommand: ")
}
func FailOnError(err error, msg string) {
if err !=... |
049dce2db81d69825fa33cccc9e6cd19d206c651 | 98dcc0435d6c7f5df47e7a6819d514fbe3518ce2 | zn-cn/leetcode | /146.go | Go | go | 1,575 | no_license | package main
type Node struct {
Key int
Val int
Pre *Node
Next *Node
}
type DLinkedList struct {
Head *Node
Tail *Node
}
func (this *DLinkedList) RemoveLast() {
if this.Tail != nil {
this.Remove(this.Tail)
}
}
func (this *DLinkedList) Remove(n *Node) {
if this.Tail == this.Head {
this.Head = nil
t... |
71d7b40bd60c90bfa22f6d1b242b188909b935d4 | 006b3a00b1e9054dfd4d7afdb3225777fff7ee27 | ahmetb/grpc-health-probe | /main.go | Go | go | 10,653 | permissive | // Copyright 2018 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in ... |
3e2e9817819137cb26329419bad5352ea5936308 | f2eec1e468c53781aafc8268be4c4cb7c30075d7 | cmwylie19/submariner-addon | /vendor/github.com/submariner-io/admiral/pkg/log/loglevels.go | Go | go | 1,713 | permissive | /*
SPDX-License-Identifier: Apache-2.0
Copyright Contributors to the Submariner project.
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 requ... |
303d706fa7f2206171953bfaf66755265e67d7e2 | 6c857ad13297a2f4e19467d4cc450f817f1d5c9a | mmcintosh/ddev | /pkg/fileutil/files.go | Go | go | 4,006 | permissive | package fileutil
import (
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
"runtime"
"github.com/drud/ddev/pkg/util"
)
// CopyFile copies the contents of the file named src to the file named
// by dst. The file will be created if it does not already exist. If the
// destination file exists, all it's c... |
22a11529a3904e9bdd1fd5ae14ff1baf70c704b7 | ae8e8f615b7eed007d95815c9e923c4c846a40d3 | algorithm101/gorithm | /pkg/p0671/p0671.go | Go | go | 1,240 | permissive | // Copyright (c) 2018 soren yang
//
// Licensed under the MIT License
// you may not use this file except in complicance with the License.
// You may obtain a copy of the License at
//
// https://opensource.org/licenses/MIT
//
// Unless required by applicable law or agreed to in writing, software
// distributed und... |
9d8323ca66c4ab25231e48424d8d22570a11af48 | d8009d5b221f8a8d2b7592941f94eefc03f092ec | reubenmiller/go-c8y | /pkg/c8y/alarm.go | Go | go | 6,058 | permissive | package c8y
import (
"context"
"github.com/tidwall/gjson"
)
// AlarmService provides api to get/set/delete alarms in Cumulocity
type AlarmService service
// Cumulocity alarm Serverity types
const (
AlarmSeverityCritical = "CRITICAL"
AlarmSeverityMajor = "MAJOR"
AlarmSeverityMinor = "MINOR"
AlarmSeverity... |
281ed3af755bca69a4813a0f05dd610110a12557 | 937228855f4669cf05c90cc7156b0932e64bf3ef | awsassets/prestgo | /conn.go | Go | go | 12,063 | permissive | package prestgo
import (
"bytes"
"database/sql"
"database/sql/driver"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"io"
"math"
"net/http"
"net/url"
"strings"
"time"
)
// Name of the driver to use when calling `sql.Open`
const DriverName = "prestgo"
// Default data source parameters
const (
DefaultP... |
b1f67b14ef68ff025d4378b048e49d50ac9ef36c | ca91582b1368976eef45bab62568250238160cdc | yashwanth-l/sensu-go | /backend/tessend/tessend.go | Go | go | 14,965 | permissive | package tessend
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"strconv"
"sync"
"time"
"github.com/coreos/etcd/clientv3"
"github.com/google/uuid"
corev2 "github.com/sensu/sensu-go/api/core/v2"
"github.com/sensu/sensu-go/backend/messaging"
"github.com/sensu/sensu-go/backend... |
77ee5371a17771acb7e00fa42bd8ac642cebad5a | 70b819f99f4d6f59f8f0010a81ad73f54aa3341c | chewong/test-infra | /prow/cmd/webhook-server/helpers.go | Go | go | 4,038 | permissive | /*
Copyright 2022 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, ... |
e71195bb08d54d7164a5cb886c8a3afa4ef6b323 | 34a98584765b5c5da5b1bc6fb247413e29c31faa | chai2010/walk | /declarative/toolbar.go | Go | go | 2,350 | permissive | // Copyright 2012 The Walk 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 declarative
import (
"github.com/chai2010/walk"
)
type ToolBarButtonStyle int
const (
ToolBarButtonImageOnly ToolBarButtonStyl... |
87c879f1d8871f886dde3e50d8bbdcddcc8be4f3 | fc78f9a9e7715c32cb01cbf5cb00884a348907ab | wangkris03/jxc_example | /api/account.go | Go | go | 2,506 | no_license | package api
import (
"github.com/ymzuiku/gewu_jxc/internal/services/account"
"github.com/ymzuiku/gewu_jxc/pkg/srv"
"github.com/gofiber/fiber/v2"
)
func accountRegisterSendCode(c *fiber.Ctx) error {
var body account.SendCodeBody
err := c.BodyParser(&body)
if err != nil {
return err
}
err = account.Registe... |
71ea972c7aed4a71dd3179478376101a89d6857b | f64a024d8ca33e734e08c6a2b4b40a2f54c753bd | chendong0/myetcd-manage | /myetcd-manage/program/program.go | Go | go | 1,263 | no_license | package program
import (
"myetcd-manage/program/config"
"net/http"
"time"
"fmt"
"os/exec"
"runtime"
"github.com/opentracing/opentracing-go/log"
"myetcd-manage/program/logger"
)
// Program 主程序
type Program struct {
cfg *config.Config
s *http.Server
}
// New 创建主程序
func New() (*Program, error) {
// 配置文件
c... |
fb820c1c9c9e86f4c41fe3255c65a198ed522451 | 2181315a97524a1248a784449dd0bb53c467e302 | go-park-mail-ru/2020_2_Friends | /internal/pkg/review/repository/repository.go | Go | go | 2,155 | no_license | package repository
import (
"database/sql"
"fmt"
"github.com/friends/configs"
"github.com/friends/internal/pkg/models"
"github.com/friends/internal/pkg/review"
)
type ReviewRepository struct {
db *sql.DB
}
func New(db *sql.DB) review.Repository {
return ReviewRepository{
db: db,
}
}
func (r ReviewReposit... |
bf82e460411873dc245151f4367aa315560926d2 | f61fe2e585faa03600fe44970e5f6f7577812f8c | CarlosJordanDev/fuchsia-pine64-pinephone | /src/connectivity/network/netstack/link/bridge/bridge_test.go | Go | go | 31,503 | permissive | // Copyright 2020 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 bridge_test
import (
"bytes"
"errors"
"fmt"
"testing"
"time"
"go.fuchsia.dev/fuchsia/src/connectivity/network/netstack/link/bridge"
"go.fu... |
4f031c3936db443eec2ba8134e12b06f389c365b | 9d91311aa52c9f920e0a649a5244ba33b2d1156c | welfeng2016/cockroach | /roachpb/metadata.go | Go | go | 5,375 | permissive | // Copyright 2014 The Cockroach Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or ag... |
87add28fe79c66a187bf4356a7c5e4098b8e09ac | eb838040ad99e3bd21b4f430d0ffa6398fe72c75 | MisinformedDNA/pulumi-azure-native | /sdk/go/azure/web/v20190801/getWebAppSiteExtensionSlot.go | Go | go | 2,727 | permissive | // *** 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 v20190801
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Site Extension Information.
func LookupWebAppSiteExtensionSlot(ctx *pulumi.Context, a... |
9ca12d627fba112ab3b57cc270f14925a8e7f8f2 | c5bc596c52073283b46f0bef92140f133f96c8f3 | cooper/go-git | /doc.go | Go | go | 520 | permissive | // A highly extensible git implementation in pure Go.
//
// go-git aims to reach the completeness of libgit2 or jgit, nowadays covers the
// majority of the plumbing read operations and some of the main write
// operations, but lacks the main porcelain operations such as merges.
//
// It is highly extensible, we have b... |
d3cb72c3a55901e2993c18fa4a32bb8bd8eb1b67 | 09815d726a2c91283713dd912b4af72c2f776255 | heaths/azure-sdk-for-go | /profiles/preview/batch/mgmt/batch/models.go | Go | go | 31,334 | permissive | //go:build go1.9
// +build go1.9
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// This code was auto-generated by:
// github.com/Azure/azure-sdk-for-go/eng/tools/profileBuilder
package batch
import (
"con... |
3382a549dc80180438dbfe1829da7f284a2796f4 | e1d3a104dbd0e6ef496050ef3387a20cefafe2fc | vipentti/pulumi | /pkg/codegen/internal/test/testdata/external-resource-schema/go/example/component.go | Go | go | 8,126 | permissive | // *** WARNING: this file was generated by test. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package example
import (
"context"
"reflect"
"github.com/pulumi/pulumi-aws/sdk/v3/go/aws/ec2"
"github.com/pulumi/pulumi-kubernetes/sdk/v2/go/kubernetes"
metav1 "github.com/pulum... |
1db8a0f43291d0fc64fa69cba8979c0eafa8c8f7 | df28d035f2b2573e03c9b3c26e5b8617214acb60 | algolia/algoliasearch-client-go | /algolia/search/synonym_regular.go | Go | go | 1,128 | permissive | package search
import (
"encoding/json"
"fmt"
)
type RegularSynonym struct {
objectID string
Synonyms []string
}
func NewRegularSynonym(objectID string, synonyms ...string) RegularSynonym {
return RegularSynonym{objectID, synonyms}
}
func (s RegularSynonym) ObjectID() string { return s.objectID }
func (s Regu... |
4d65f1c11a2838074d8cd79937acd62ab6882c05 | 3ee8eb4665729d64b2e9d5cf11a669e165146bf5 | Blockchains/search | /archive/archivequery.go | Go | go | 8,286 | permissive | // Copyright 2019 dfuse Platform 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 agre... |
148455cfe2e4e0322b0901f154acef74a199f471 | 48b74ba7881388d55c3228c60350f3fd1b53ed69 | f/koding | /go/src/github.com/hashicorp/aws-sdk-go/gen/emr/emr.go | Go | go | 39,039 | permissive | // THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT.
// Package emr provides a client for Amazon Elastic MapReduce.
package emr
import (
"net/http"
"time"
"github.com/hashicorp/aws-sdk-go/aws"
"github.com/hashicorp/aws-sdk-go/gen/endpoints"
)
// EMR is a client for Amazon Elastic MapReduce.
type EMR struct {
... |
0dd45c7c868c67fbeeaa412617ca08509a09833a | edda60f09c729ea55febf227d06205a595d80ebe | Fabian-K/eventing-contrib | /vendor/github.com/apache/camel-k/pkg/apis/camel/v1/camelcatalog_types_support.go | Go | go | 2,227 | permissive | /*
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this fi... |
c227429f9b13fd8340ff9c8dacc0a08f81ab43ae | 7a808ae1fea47a7b98ec83cedd2e43ae311bcbb3 | soloos/solofs | /memstg/fsmutexdriver_locker.go | Go | go | 2,900 | no_license | package memstg
import (
"soloos/common/solofstypes"
"soloos/solodb/offheap"
"sync/atomic"
)
// TODO release solofstypes.INodeRWMutex
// support distributed system
// GetLk returns existing lock information for file
func (p *FsMutexDriver) GetLk(fsINodeIno solofstypes.FsINodeIno, iNodeRWMutexMeta *solofstypes.INod... |
4b770a3e9c8baf643a5a69cf6dbf7325b9a0a0b0 | 278f80b759711f824d42035aa17d8a9ab82120a8 | aktru/cli | /utils/configv3/config_test.go | Go | go | 11,976 | permissive | package configv3_test
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"time"
. "code.cloudfoundry.org/cli/utils/configv3"
. "github.com/onsi/ginkgo"
. "github.com/onsi/ginkgo/extensions/table"
. "github.com/onsi/gomega"
)
var _ = Describe("Config", func() {
var homeDir string
BeforeEach... |
89df3d877b3a03e1e423d0a2b1c07752c0ec7531 | 883b515a9af8ffd16589c90840c711d3bb125f18 | binkkatal/go-sieve | /seive/utils.go | Go | go | 241 | no_license | package seive
import "math"
// isPrime validates if a number is prime or not
func isPrime(value int) bool {
for i := 2; i <= int(math.Floor(math.Sqrt(float64(value)))); i++ {
if value%i == 0 {
return false
}
}
return value > 1
}
|
012df80f323d0e2a213fd7714332d43771bffb69 | a69d2f6baa8eea0006a20869928d7f9d025220a2 | pipizhang/transcode-orchestrator | /provider/mediaconvert/audio_mapping_test.go | Go | go | 4,915 | permissive | package mediaconvert
import (
"reflect"
"testing"
"github.com/aws/aws-sdk-go-v2/service/mediaconvert"
"github.com/aws/aws-sdk-go/aws"
"github.com/cbsinteractive/transcode-orchestrator/db"
"github.com/google/go-cmp/cmp"
)
func Test_mcProvider_audioSelectorFrom(t *testing.T) {
audioSelectorKey := "Audio Selecto... |
c4f9f2bec8f7c68e2ccfd8f04b1ab3e3302a7878 | b0075b14fcdf1d4e0544c48fddb3c2a2dd20cbf9 | wangjian138/wangjian-go-zero | /shorturl/wangjian-zero/etcd/etcdctl/ctlv3/command/make_mirror_command.go | Go | go | 5,941 | permissive | // Copyright 2016 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... |
f26309cb638858dbbd5be9d324685fb71d98c7c3 | 8c1b4cb8835dc3c9e36350d8c3ae3d0597fe560a | AndreasBurger/gardener | /cmd/gardener-extension-provider-local/app/app.go | Go | go | 16,446 | permissive | // Copyright 2021 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.... |
49a286a0e0d76ac9c71410d370a8c084947a3ff7 | f1670407dc3c8dcd8139311ac2049d42525b852d | DataDog/datadog-api-client-go | /api/datadogV1/model_topology_request.go | Go | go | 4,896 | permissive | // Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2019-Present Datadog, Inc.
package datadogV1
import (
"github.com/goccy/go-json"
"github.com/DataDog/datado... |
e3ca552256718f7f9a9b19f6fa1231bff08f854c | 074f25976a0d41d51b4b937e4cd8580aefa56a72 | irisgve/opentelemetry-collector | /processor/processorhelper/processor.go | Go | go | 8,073 | permissive | // Copyright The 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... |
29d9c1a21175321a6778df73c304e2a87426d98c | 704dc60109cd73836b7499c74242826e9d3a6578 | samelias/metallb | /vendor/github.com/ligato/vpp-agent/pkg/idxvpp/nametoidx/inmemory_scenario_test.go | Go | go | 6,977 | permissive | // Copyright (c) 2017 Cisco and/or its affiliates.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at:
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicabl... |
01f422ad94dd9336fab6cd91a7b005e568fb6d62 | 927130a6677b30abf61106dee33ffa18827fcb95 | RajibDas-123/api-gateway | /service/auth/auth.go | Go | go | 1,280 | no_license | package auth
import (
"context"
"encoding/json"
"time"
"github.com/RajibDas-123/ms-grpc-auth/api-gateway/logging"
"github.com/RajibDas-123/ms-grpc-auth/api-gateway/service/auth/pb"
)
// Login : Calls the client
func Login(id string, pass string) (responseData map[string]string, err error) {
ctx, cancel := cont... |
c475298e312dd522cbd07be0efeea59352d321dd | 19bd30e5f8c7285271e5c795ad73018b4812a849 | Electronic-Scavenger/ESGNIC | /orm/gorm.go | Go | go | 372 | permissive | package orm
import (
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/sqlite"
"github.com/sirupsen/logrus"
)
var DB *gorm.DB
func Init() {
db, err := gorm.Open("sqlite3", "data.db")
if err != nil {
logrus.Fatal("failed to connect database")
}
DB = db
initTables()
return
}
func initTables() {
... |
54e4cf357615387de442f225738beea5b5094595 | 51207ae236f293501120a5f55c19ac017c6fb6c6 | bistuzx/onecloud | /pkg/hostman/storageman/storage_base.go | Go | go | 15,483 | permissive | // Copyright 2019 Yunion
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writi... |
e55c6be9ebd2efee205371bd5d88625ad7d270bc | 8995339009d77d7f026fe0ebbb5b634682de2880 | musinit/google-api-go-client | /oslogin/v1beta/oslogin-gen.go | Go | go | 42,850 | permissive | // Copyright 2021 Google LLC.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Code generated file. DO NOT EDIT.
// Package oslogin provides access to the Cloud OS Login API.
//
// This package is DEPRECATED. Use package cloud.google.com/go/oslogin/apiv1 inste... |
37e079f73ec7506c62e2c54a7b1607d7410187e1 | 042ceb317a36d76ac1cb121ad397c064667b14dd | ksimon1/node-feature-discovery | /mockfeaturesource.go | Go | go | 946 | permissive | package main
import (
"github.com/kubernetes-incubator/node-feature-discovery/source"
"github.com/stretchr/testify/mock"
)
type MockFeatureSource struct {
mock.Mock
}
// Name provides a mock function with no input arguments
// and string as return value
func (_m *MockFeatureSource) Name() string {
ret := _m.Call... |
5e07937979e343d6c0a7530f69ff5ef850c30d96 | 6e73d90f0c350e0d1f6b31f2934fe79f0456e681 | opentelekomcloud/gophertelekomcloud | /openstack/dds/v3/instances/ModifySG.go | Go | go | 643 | permissive | package instances
import (
golangsdk "github.com/opentelekomcloud/gophertelekomcloud"
"github.com/opentelekomcloud/gophertelekomcloud/internal/build"
)
type ModifySGOpt struct {
SecurityGroupId string `json:"security_group_id" required:"true"`
InstanceId string `json:"-"`
}
func ModifySG(client *golangsdk.S... |
f83ce989aff5dd29b08d51c416db9eb50c8da360 | 581fbf76cdd649527eb00b2a2a011789ff0d14b9 | multi-io/machine-controller | /pkg/cloudprovider/provider/vsphere/provider.go | Go | go | 21,076 | permissive | /*
Copyright 2019 The Machine Controller 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 w... |
f0e848fcf8f03168d09fc8db35cc7976baae4a8f | 36fdcb30896ee2b973a967340e5331a6211cdb64 | JoshuaAndrew/prometheus-operator | /cmd/operator/main.go | Go | go | 3,040 | permissive | // Copyright 2016 The prometheus-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 ... |
05dbcdee24084e6cf3009f473215f1b07790bb2e | aefd968e234b86ff6d14a75bd159f1b91789866c | Legenddigital/lddld | /wire/msggetcfheaders.go | Go | go | 4,315 | permissive | // Copyright (c) 2017 The btcsuite developers
// Copyright (c) 2017 The Lightning Network Developers
// Copyright (c) 2018 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package wire
import (
"fmt"
"io"
"github.com/Legenddigital/lddld/chain... |
68bc903362197f35720a0bd848a7a9ccc8cb1851 | f92fa8773847fcd28078066edce9bc571be0f849 | micro-community/tutorials | /microservice-in-micro/part5/payment-web/handler/handler.go | Go | go | 1,569 | permissive | package handler
import (
"context"
"encoding/json"
"net/http"
"strconv"
"time"
auth "github.com/micro-in-cn/tutorials/microservice-in-micro/part5/auth/proto/auth"
payS "github.com/micro-in-cn/tutorials/microservice-in-micro/part5/payment-srv/proto/payment"
"github.com/micro/go-micro/client"
"github.com/micro... |
69bebabc27d242db017abac979a8b05bbf772bd9 | 896a253cc263e089ac3405cc407599cff75e8b7e | vikash1976/go-http-server | /go-http-server/main.go | Go | go | 3,723 | no_license | package main
import (
"encoding/json"
"fmt"
"html/template"
"io"
"io/ioutil"
"log"
"net/http"
"path"
"github.com/julienschmidt/httprouter"
)
//Price structure defined
type Price struct {
Tick string `json:"tick"`
Price float64 `json:"price"`
}
//Prices Structure
type Prices struct {
SymbolInfo []Price... |
ebcaf42dfa344a22fafb68bcc80fc6a16a548a7b | 9b1cf3b2d9e75322ebdc51d77ef9bf0a9ad772c3 | Alwaysbai/Fabric0.6-PBFT-Learning | /hyperledger/fabric/consensus/util/events/events.go | Go | go | 9,049 | permissive | /*
Copyright IBM Corp. 2016 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 law or ag... |
dc817c711b9dd257d3aad803c3940bf93cf2a03c | a21582c8f5bd937d38c3ceb8462b876123da4467 | wal-g/wal-g | /internal/databases/postgres/wal_verify_handler_test.go | Go | go | 21,997 | permissive | package postgres_test
import (
"bytes"
"encoding/json"
"fmt"
"reflect"
"testing"
"time"
"github.com/wal-g/wal-g/internal/databases/postgres"
"github.com/spf13/viper"
"github.com/stretchr/testify/assert"
"github.com/wal-g/wal-g/internal"
"github.com/wal-g/wal-g/utility"
)
func init() {
// this setting af... |
e70f60a1f9e3b0bb44a9751f2f7a5c3cf251db42 | 11c5f1079c7c18b34f9cf1df2e56af71d993729b | YRXING/envoyingresscontroller | /mappers/modbus-go/globals/globals.go | Go | go | 929 | permissive | /*
Copyright 2020 The KubeEdge 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, sof... |
0df3f7cf5bcaa4417935471de34a78b7c2c902cf | 7df451b3e918c951419858dfde4d69a97636ba35 | udistritali3plus/collector | /errors.go | Go | go | 364 | no_license | package collector
const (
FileNotFoundError = "file not found"
UnmarshallDefinitionError = "it's not possible parse the definition"
requestCreationFailed = "request creation failed"
requestExecutionFailed = "request execution failed"
contentReadingFailed = "content reading failed"
contentPars... |
38e6be7511fef75cbf84a4f9760fe0c80e579340 | e083336766e023cbcd16f65edfa8cb4077e7763c | junxie6/goexamples | /tlssslcert/cli.go | Go | go | 1,222 | no_license | package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"io/ioutil"
"log"
)
func main() {
cert2_b, _ := ioutil.ReadFile("cert2.pem")
priv2_b, _ := ioutil.ReadFile("cert2.key")
priv2, _ := x509.ParsePKCS1PrivateKey(priv2_b)
cert := tls.Certificate{
Certificate: [][]byte{cert2_b},
PrivateKey: priv2,... |
36590b1d2ccf9fc0b897a1fff0fc7dde4a91f871 | d827e1084343981f2ff83771fc3a9f31275e7632 | andrewsomething/doctl | /commands/displayers/account.go | Go | go | 1,420 | permissive | /*
Copyright 2018 The Doctl 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 law or agreed to ... |
874b12d95d30bd628b6cc707ab28ad12fe2aba35 | d0511b44fb9c4be8e559739c5d83f89c779fe33b | 0xfe/lumen | /vendor/github.com/0xfe/microstellar/tx.go | Go | go | 9,319 | permissive | package microstellar
import (
"net/http"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"github.com/stellar/go/build"
"github.com/stellar/go/clients/horizon"
"github.com/stellar/go/xdr"
)
// Tx represents a unique stellar transaction. This is used by the MicroStellar
// library to abstract away the Horiz... |
806c36790e769c795d2ae14a2c13e18981ff262f | b5bd9e5bad1a35d44dd73fe00937507ac80adae0 | PaddySchmidt/gosl | /rnd/stat.go | Go | go | 6,356 | permissive | // Copyright 2012 Dorival de Moraes Pedroso. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package rnd
import (
"math"
"github.com/cpmech/gosl/chk"
"github.com/cpmech/gosl/la"
)
// StatAve computes the average of x values
// Input:
/... |
b4d61652005a9538e4f715fbea87af18e93acd24 | 5707619a7c5cd828b8785a76ff58d1dcb28f185a | miton18/ovh-models | /me/tag.go | Go | go | 459 | permissive | package me
// GENERATED SDK for me API
// Tag
type Tag struct {
CreationDate string `json:"creationDate,omitempty"`
CustomerCode string `json:"customerCode,omitempty"`
ExpirationDate *string `json:"expirationDate,omitempty"`
Extra *TagExtra `json:"extra,omitempty"`
LastUpdate string ... |
a78208ec86c60781a23ab098c41017f49702ae48 | 4f1d46a6172aa11c105f522ea62424b85cd9bff5 | anarcher/tanka | /cmd/tk/workflow.go | Go | go | 5,000 | permissive | package main
import (
"fmt"
"log"
"os"
"github.com/posener/complete"
"github.com/spf13/pflag"
"github.com/go-clix/cli"
"github.com/grafana/tanka/pkg/process"
"github.com/grafana/tanka/pkg/tanka"
"github.com/grafana/tanka/pkg/term"
)
// special exit codes for tk diff
const (
// no changes
ExitStatusClean... |
78e06c112ce05266e507721847693781a3ad0c34 | f56ef810dcd1ee7a57cac233e72fc082c20667b7 | sheriffio/api-geo | /handlers/handlers.go | Go | go | 1,363 | no_license | package handlers
import (
"context"
"encoding/json"
"log"
"net/http"
"strings"
"googlemaps.github.io/maps"
)
type LatLongByAddressResponse struct {
Address string
Lat float64
Long float64
}
type HTMLError struct {
Err string
Code int
}
func LatLongByAddress(w http.ResponseWriter, req *http.Reque... |
9e828f193780e9725d00397fe26cd3bd885f35f7 | a5c16b1651831765ce92067f0f16760fe1d9975f | levenon/pushgateway | /tcp_handler/misc.go | Go | go | 2,212 | permissive | // Copyright 2017 The Prometheus 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... |
f505d44dde94c178738c4e9d683735952c596f62 | 59d2e5c1d57eeb97d56ed260d8186e4b5f8dedb8 | Romantic-Lei/sparseArray | /main.go | Go | go | 3,547 | no_license | package main
import (
"fmt"
"os"
"bufio"
"io"
"encoding/json"
)
type ValNode struct {
Row int
Col int
Val int
}
func main() {
// 1. 先创建一个原始数组
var chessMap [11][11] int
chessMap[1][2] = 1; // 黑子
chessMap[2][3] = 2; // 蓝子
// 2. 输出看看原始的数组
for _, v := range chessMap {
for _, v2 := range v {
fmt.Print... |
1450279b03ddf0970390e9afac9901879576ca59 | 36e99f23512d9504df016ba04b99ba77fdea5f3f | NikSmith/zabbixRabbitmq | /zabbixRabbitmq.go | Go | go | 10,666 | permissive | package main
import (
"flag"
"strconv"
"sync"
"time"
log "github.com/Sirupsen/logrus"
zabbix "github.com/blacked/go-zabbix"
"github.com/michaelklishin/rabbit-hole"
"github.com/spf13/viper"
)
var (
wg sync.WaitGroup
)
func main() {
var vaultCfg map[string]interface{}
var confFile, rabbitPasswd, rabbitUser... |
b9a506557801d094c769cc9e7003146d85e25921 | fc3147d991193ca4be4871a4d4c4bbe107b52e39 | giantswarm/azure-operator | /service/controller/unhealthynode/handler/terminateunhealthynode/metrics.go | Go | go | 799 | permissive | package terminateunhealthynode
import (
"github.com/prometheus/client_golang/prometheus"
)
const (
gaugeValue float64 = 1
)
var (
nodeAutoRepairTermination = prometheus.NewGaugeVec(
prometheus.GaugeOpts{
Name: "azure_operator_unhealthy_node_termination",
Help: "Gauge representing node termination due to n... |
0a3e85338caa938e9b79a1fb76a546908c1a1739 | b1aea58be6327e5e59970dedd18005de7f4e2632 | Azure-ukgov-paas/paas-cli | /cf/commands/domain/domains.go | Go | go | 2,940 | permissive | package domain
import (
"errors"
"github.com/cloudfoundry/cli/cf/api"
"github.com/cloudfoundry/cli/cf/commandregistry"
"github.com/cloudfoundry/cli/cf/configuration/coreconfig"
"github.com/cloudfoundry/cli/cf/flags"
. "github.com/cloudfoundry/cli/cf/i18n"
"github.com/cloudfoundry/cli/cf/models"
"github.com/cl... |
cbf9f0e4d7af65f9103534e9c62df119d39fb737 | e46f7f749061fe4a1fbcbf83b648c89e190a483a | mind1949/leetcode | /algs/0003.longest_substring_without_repeating_characters.go | Go | go | 957 | permissive | package algs
/*
LengthOfLongestSubstring solves following problem:
Given a string, find the length of the longest substring without repeating characters.
Example 1:
Input: "abcabcbb"
Output: 3
Explanation: The answer is "abc", with the length of 3.
Example 2:
Input: "bbbbb"
Output: 1
Explanation: Th... |
9ac92eb65c728a5fa851e362aaf45213a1c3e046 | 830401a65becc853c3c878ab82739eeb31df94f7 | dmcallejo/xTeVe | /src/hdhr.go | Go | go | 5,232 | permissive | package src
import (
"bytes"
"encoding/json"
"encoding/xml"
"fmt"
)
func makeInteraceFromHDHR(content []byte, playlistName, id string) (channels []interface{}, err error) {
var hdhrData []interface{}
err = json.Unmarshal(content, &hdhrData)
if err == nil {
for _, d := range hdhrData {
var channel = ma... |
da3515c4b9681b074e2f9f68e7f174f4fe37ff50 | 7fec17489b22617dd9597f742731594b82d8f342 | linguohua/sloth-servers | /gosrc/zjmjserver/zjmahjong/splaying.go | Go | go | 24,990 | no_license | package zjmahjong
import (
"mahjong"
"runtime/debug"
"github.com/golang/protobuf/proto"
"github.com/sirupsen/logrus"
)
// SPlaying 正在游戏状态
type SPlaying struct {
taskDiscardReAction *TaskPlayerReAction
taskPlayerAction *TaskPlayerAction
tileMgr *TileMgr
players []*PlayerHolder
room *Room
lctx *Lo... |
ef03a963a464b1898383e02f1cf36886061d4f15 | e0c08ddc7332c713a4208d21efc9b323f651fb6f | crossplane-contrib/provider-terraform-aws | /generated/resources/simpledb_domain/v1alpha1/types.go | Go | go | 2,129 | permissive | /*
Copyright 2019 The Crossplane 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 wri... |
4cf082cc5beb01921fe41328199cfb91a0ae5043 | 19c9ed658bdc893ada83e9c80e64c4952bf871ff | jaredp/podman | /pkg/api/handlers/libpod/networks.go | Go | go | 6,580 | permissive | package libpod
import (
"encoding/json"
"net/http"
"github.com/containers/podman/v3/libpod"
"github.com/containers/podman/v3/libpod/define"
"github.com/containers/podman/v3/libpod/network"
"github.com/containers/podman/v3/pkg/api/handlers/utils"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.co... |
adf7ee9cda7cd5d63c5c93535c5b2b7bdcbd6497 | 381feb4cda41535b471db857c164a136bcc0b428 | marcetin/parallelcoin | /archive/pkg/opts/binary/log.go | Go | go | 1,157 | permissive | package binary
import (
"github.com/p9c/log"
"github.com/p9c/opts/version"
)
var subsystem = log.AddLoggerSubsystem(version.PathBase)
var F, E, W, I, D, T log.LevelPrinter = log.GetLogPrinterSet(subsystem)
func init() {
// to filter out this package, uncomment the following
// var _ = logg.AddFilteredSubsystem(... |
35329e23baa284c26412ac7fafddeda681d0141a | 53d086106ad6029a7afe1d682883e314b317c6bf | weymanf/cf-deployment | /units/tests/semantic_test/semantic_test.go | Go | go | 8,207 | permissive | package standard_test
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"regexp"
"testing"
"github.com/cf-deployment/units/helpers"
"github.com/sergi/go-diff/diffmatchpatch"
yaml "gopkg.in/yaml.v2"
)
type instanceGroup struct {
Name string
Instances *int
AZs []string
Networks []struct {
Nam... |
7c7b9f7bed85ccb8e8bdab1185026a409ac4c9b9 | 118bbbca8184c8ad117891417c61826da0589472 | teamgenerator/teamgenerator | /server/pkg/handler/session.go | Go | go | 2,498 | no_license | package handler
import (
"encoding/json"
"errors"
"net/http"
"github.com/gorilla/mux"
"github.com/teamgenerator/teamgenerator/server/pkg/core"
"github.com/teamgenerator/teamgenerator/server/pkg/models"
)
// SessionHandler handles the HTTP layer for sessions
type SessionHandler struct {
SessionCore core.Sessio... |
49ddf1a1172ce97d2a18ba6d002c9e0767f0a387 | 324ef8f0ae9775ee68b86291e73b58cde340c5f5 | shono09835/bosh-cli | /cloud/factory.go | Go | go | 1,319 | permissive | package cloud
import (
biinstall "github.com/shono09835/bosh-cli/v7/installation"
bosherr "github.com/cloudfoundry/bosh-utils/errors"
boshlog "github.com/cloudfoundry/bosh-utils/logger"
boshsys "github.com/cloudfoundry/bosh-utils/system"
)
type Factory interface {
NewCloud(installation biinstall.Installation, di... |
2338355e122843ebd0925e41de79df2b5ef892d3 | 4699cb1e5a4a10db83c166f51360714386f3c76b | DylanBartels/openlogistics-go | /repo/config.go | Go | go | 12,197 | permissive | package repo
import (
"encoding/json"
"errors"
"github.com/ipfs/go-ipfs/repo"
"github.com/ipfs/go-ipfs/repo/config"
"time"
)
var DefaultBootstrapAddresses = []string{}
var TestnetBootstrapAddresses = []string{}
var DataPushNodes = []string{
"QmY8puEnVx66uEet64gAf4VZRo7oUyMCwG6KdB9KM92EGQ",
"QmPPg2qeF3n2KvTRX... |
1ea15fbb4778d76e95a0772a599703c0313edc56 | 3650f51b80e0b48b4e975b12a0b448bcfa80cdb7 | pamhurd/cli | /command/v2/restage_command_test.go | Go | go | 19,204 | permissive | package v2_test
import (
"errors"
"time"
"code.cloudfoundry.org/cli/actor/sharedaction"
"code.cloudfoundry.org/cli/actor/v2action"
"code.cloudfoundry.org/cli/api/cloudcontroller/ccv2"
"code.cloudfoundry.org/cli/command/commandfakes"
"code.cloudfoundry.org/cli/command/translatableerror"
. "code.cloudfoundry.or... |
9691dc2ddac463e97e0fc657f88caf9d1770fa3d | 37c62a707d074694af1b243834e83f0eb7aab382 | sebymiano/iovisor-ovn | /ovnmonitor/print.go | Go | go | 3,365 | permissive | // Copyright 2016 Politecnico di Torino
//
// 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 ... |
09c3a7120103870cfd36f1348bf573dae60e4c93 | ef8d826de0ae3fdf8caa35f631036edfaf7ee7d6 | gurupras/audiotransport | /transmitter/main.go | Go | go | 2,553 | no_license | package main
/*
#cgo LDFLAGS: -L.. -lalsa -lasound -lpulse -lpulse-simple
*/
import "C"
import (
"fmt"
"os"
"strings"
"time"
log "github.com/Sirupsen/logrus"
"github.com/alecthomas/kingpin"
"github.com/gurupras/audiotransport"
)
var (
name *string
addr *string
proto *string
devi... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.