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 |
|---|---|---|---|---|---|---|---|---|
896469c9b2c4dd17826b2ab084920eef5d66f6ba | 3be036b71b877c3b39b1c941d5f7e45cd56f3a88 | cossacklabs/acra | /keystore/v2/keystore/filesystem/backend/memory_test.go | Go | go | 917 | permissive | /*
* Copyright 2020, Cossack Labs Limited
*
* 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... |
ba6a38e7452164ccd89d63a1d263939e597f4cb1 | 0ca0789518e4e908b7c8eb5f09a7974163fb6129 | dyslexicanaboko/meeting-location | /MeetingLocation.Go/City.go | Go | go | 600 | permissive | package main
import (
"fmt"
"time"
)
//City Representation of a City in one of the United States of America
//Each object maintains the number of times used and when it was used
type City struct {
CityId int
StateId int
Name string
UseCounter int
LastUsed *time.Time
CreatedOn time.Time
State State
}
/... |
91e203e148536870975aab50d85ab3a54320c764 | ab60a2b01f3cba4b57647ef6dd56f261ba1abb2a | chaobinlu/plugin | /vendor/github.com/33cn/chain33/p2p/nat/natupnp.go | Go | go | 5,561 | permissive | // Copyright 2015 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License... |
e3f270c570b6e2247673b3a2388d5cc08a2dde2b | 314aa675aa7c81fa103b67a865457b81fa2ed6a2 | jangocheng/go-elasticsearch | /typedapi/types/queries.go | Go | go | 1,326 | permissive | // 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 ... |
3471ce2a77f2a7bf789243eec94d2576c304d090 | dfc2f3086d877ef7f4ce4b694076230482f972d0 | francoispqt/drone | /model/const.go | Go | go | 493 | permissive | package model
const (
EventPush = "push"
EventPull = "pull_request"
EventTag = "tag"
EventDeploy = "deployment"
)
const (
StatusSkipped = "skipped"
StatusPending = "pending"
StatusRunning = "running"
StatusSuccess = "success"
StatusFailure = "failure"
StatusKilled = "killed"
StatusError = ... |
68f169706bec4ae9f5ad0bf162005e40b8e2ed3c | 6e629b9d3d146496f4a8c0a44dcc6e64bfbeda21 | akapril/go-admin | /plugins/admin/modules/table/table.go | Go | go | 17,545 | permissive | package table
import (
"fmt"
"github.com/chenhg5/go-admin/modules/db"
"github.com/chenhg5/go-admin/modules/db/dialect"
"github.com/chenhg5/go-admin/plugins/admin/modules"
"github.com/chenhg5/go-admin/plugins/admin/modules/form"
"github.com/chenhg5/go-admin/plugins/admin/modules/paginator"
"github.com/chenhg5/go... |
cacb114d62a780702e99cb503816ba61aee66d3e | 5922750e81cd584034538c0f89be09259d9f64d5 | wyfish/grpc-go | /internal/transport/http2_client.go | Go | go | 43,683 | permissive | /*
*
* Copyright 2014 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... |
50fd3e7ac2a3449106ae7f1a9e49b9676dccbd04 | cf2fd91b8b3884190967023455ade045a18c9624 | v8lab/baudfs | /util/tools/getmd5.go | Go | go | 1,282 | permissive | package main
import (
"flag"
"os"
"fmt"
"io"
"hash/crc32"
)
const (
BlockHeaderInoSize = 8
BlockHeaderCrcSize = PerBlockCrcSize * BlockCount
BlockHeaderCrcIndex = BlockHeaderInoSize
BlockHeaderDelMarkSize = 1
BlockHeaderSize = BlockHeaderInoSize + BlockHeaderCrcSize + BlockHeaderDelMarkSiz... |
2fdf703ba44efaf1785ce7a0e52d59735a7df611 | a959f6ee3f3c241b0bbc1b09703d77be7af25a97 | MrEhbr/pkg | /debug/debug.go | Go | go | 4,257 | no_license | package debug
import (
"context"
"net"
"net/http"
nhpprof "net/http/pprof"
"net/url"
"runtime/pprof"
"strings"
"github.com/alecthomas/template"
"github.com/pkg/errors"
"go.uber.org/zap"
)
// Server is the debug server struct. It should be created through StartServer.
type Server struct {
serv *http.S... |
55c86dbff04ed6c016f6ddc587910a7acd7a222b | b7a097faaf202b2062d82feab0ea51f93693508c | pradaelli/cerberus-go-client | /v3/auth/token_test.go | Go | go | 7,666 | permissive | /*
Copyright 2017 Nike 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
distrib... |
a10a054bcd2ea3c39551d8beea89306e1117ee48 | 9271fa84c381d25116b7e79783bf42b8126a3a9a | believening/tools-wings | /cmd/sgo/main.go | Go | go | 2,192 | no_license | // sgo used to switch go version
package main
import (
"fmt"
"log"
"os"
"os/exec"
"path/filepath"
"sort"
"strings"
)
var (
goroot string = "/usr/local/go"
currentVersion, currentShort string = currentGo()
supportVersions map[string]struct{} = map[string]struct{}{}
shortSupportVe... |
43befd9ca5acc84ba6c5f5054654687c0a5d9370 | 6e874fa9cd2c4d874602f541931c170656ff83e6 | Sunilnk17/ic-indexer-service | /app/api/dataaccessor/ice_cream_data_accessor.go | Go | go | 5,286 | no_license | package dataaccessor
import (
"context"
"encoding/json"
"github.com/olivere/elastic"
"ic-indexer-service/app/builder"
"ic-indexer-service/app/config"
"ic-indexer-service/app/helpers/es"
"ic-indexer-service/app/model/bo"
"ic-indexer-service/app/model/request"
"ic-indexer-service/app/model/response"
"log"
"ne... |
8b72f953112f5cd622ae32e4ad534182b7fe90b8 | 5856ce910650bba686b3e97d1314815d978a5358 | Matt3o12/dict-cc | /plusTesting/http.go | Go | go | 668 | permissive | package plusTesting
import (
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strings"
)
// GetHTTPResponse creates a new mocked http response for the given status and content.
func GetHTTPResponse(status int, uri *url.URL, content string) *http.Response {
contentReader := ioutil.NopCloser(strings.NewReader(content))
... |
1fb28d6417aaa4b6ef8288fd1f7546ebfa5c94fa | cd827a0ebfaf42ab430d6758b367860cd80d71c6 | mikemadden42/slacklings | /chkjenkins/chkjenkins.go | Go | go | 1,354 | permissive | package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"os"
"github.com/urfave/cli"
gojenkins "github.com/yosida95/golang-jenkins"
)
type jsonObject struct {
Config configType
}
type configType struct {
User string
Token string
URL string
}
func main() {
app := cli.NewApp()
app.Version = "0.0.1"
a... |
615f16c4a713c2954f5f0721d6fc121b774fce53 | 00592cea1974c216b3c128d5be6858774b1a6447 | phpyandong/opentaobao | /model/scbp/AlibabaScbpEffectKeywordListResponse.go | Go | go | 970 | permissive | package scbp
import (
"encoding/xml"
"github.com/bububa/opentaobao/model"
)
/*
关键词报表 APIResponse
alibaba.scbp.effect.keyword.list
关键词报表
*/
type AlibabaScbpEffectKeywordListAPIResponse struct {
model.CommonResponse
AlibabaScbpEffectKeywordListResponse
}
type AlibabaScbpEffectKeywordListResponse str... |
c5d3c5d187354e2c776d6b135525ba3e2b83f757 | 12bf582c3c2876466d8095d99aa1baef75aa472a | Howie59/tidb | /br/pkg/lightning/restore/table_restore.go | Go | go | 33,220 | permissive | // Copyright 2021 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... |
9a79def60a7fa06c083ae5d1b8fa909ea2fa89cc | ba07fbf62f45bf8951df1d14a5a3dd750f0329a4 | ernesto-jimenez/ch_deviceatlas | /proxy/proxy.go | Go | go | 1,987 | no_license | package proxy
import "errors"
import "net"
import "net/http"
import "fmt"
import "io/ioutil"
import "strings"
type Config struct {
Listen string
AppendHeaders func(*http.Request)
}
func StartProxy(targetHost string, config *Config) {
l, err := net.Listen("tcp", config.Listen)
if err != nil {
panic(err)
... |
576d3f18f5ee4de85034302ba692de54ce2e731d | 5193f31cda620ccdfe2e2e8eb7cb42e84b36b031 | priyavp/devops-handson | /app/app.go | Go | go | 240 | no_license | package main
import (
"fmt"
"net/http"
)
func helloWorld(w http.ResponseWriter, r *http.Request){
fmt.Fprintf(w, "Hello DevOps v4")
}
func main() {
http.HandleFunc("/", helloWorld)
http.ListenAndServe(":8081", nil)
}
|
2c71da13f82f8112f89cc0e5308d5a7c99f72f9b | 8e09c6979ffcfeca345e60f39b4a7bd08bacc0a0 | DorianRust/Newmonitor | /alerts/getnowblockalert.go | Go | go | 13,481 | no_license | package alerts
import (
"encoding/json"
"fmt"
"github.com/astaxie/beego/logs"
"github.com/influxdata/platform/kit/errors"
"github.com/sasaxie/monitor/common/database/influxdb"
"github.com/sasaxie/monitor/dingding"
"github.com/sasaxie/monitor/models"
"strings"
"time"
"github.com/aliyun/alibaba-cloud-sdk-go/sd... |
bace77307740107adcf7746bb8fd4a10441842e2 | a337f2cede409a801dbb753e1c8d7cb4e6909dde | lzhlyle/golang-zero | /src/ch2/constant_test/constant_test.go | Go | go | 629 | permissive | package constant_test
import "testing"
const (
Monday = iota + 1
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
)
const (
Open = 1 << iota // 第 1 位为 1,其他为 0
Close // 第 2 位为 1,其他为 0
Pending // 第 3 位为 1,其他为 0
)
const (
Readable = 1 << iota
Writable
Executable
)
func TestC... |
f780bb06cda44de83c8f1a0281763baebf8b388a | 5ad96fe59be1e8bb4c9a1d438be4420f3d548c58 | clickyab/exchange | /commands/fswatch/fswatch.go | Go | go | 7,890 | permissive | package main
import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"os"
"os/signal"
"path/filepath"
"regexp"
"runtime"
"strconv"
"strings"
"syscall"
"time"
log "github.com/gobuild/log"
"github.com/howeyc/fsnotify"
)
const windows = "windows"
var verbose = flag.Bool("v", false, "show verbose")
func init(... |
132a33046767b82e5aa580403c1e74c8493d6c1a | adecc62482712b4f81bbf3789aaf23ba9e422a08 | ObrookO/blog | /models/account.go | Go | go | 686 | no_license | package models
// IsAccountExist 判断账号是否存在
func IsAccountExist(filter map[string]interface{}) bool {
return concatFilter("account", filter).Exist()
}
// GetOneAccount 获取账号信息
func GetOneAccount(filter map[string]interface{}, field ...string) (Account, error) {
var account Account
err := concatFilter("account", filt... |
3df00a5c1b2dbd4733626247f1c35799c44eb5eb | bbda1bdf8d5194339049216338bcd627c197493b | exoscale/packer-post-processor-exoscale-import | /vendor/github.com/hashicorp/packer/packer/provisioner.go | Go | go | 8,156 | permissive | package packer
import (
"context"
"fmt"
"log"
"sync"
"time"
"github.com/hashicorp/hcl/v2/hcldec"
"github.com/hashicorp/packer/helper/common"
)
// A provisioner is responsible for installing and configuring software
// on a machine prior to building the actual image.
type Provisioner interface {
HCL2Speccer
... |
588d56084abc2853385a56585496d7d8f0ae94b8 | d692fb827df99dc98d4c7f6460b8a4bb3749d4b9 | thantai574/g-pay-test | /vendor/github.com/mattn/go-sqlite3/sqlite3.go | Go | go | 62,427 | permissive | // Copyright (C) 2019 Yasuhiro Matsumoto <mattn.jp@gmail.com>.
// Copyright (C) 2018 G.J.R. Timmer <gjr.timmer@gmail.com>.
//
// Use of this source code is governed by an MIT-style
// license that can be found in the LICENSE file.
// +build cgo
package sqlite3
/*
#cgo CFLAGS: -std=gnu99
#cgo CFLAGS: -DSQLITE_ENABLE_... |
67d53421be3c418cd7bc3f90ff7ecdf8380a6259 | c1e8e1c01b90e5ecf9562e914323afd9d54ab01d | narenvist/bosh-backup-and-restore | /orchestrator/backup_upload_executable_test.go | Go | go | 3,601 | permissive | package orchestrator_test
import (
"github.com/cloudfoundry-incubator/bosh-backup-and-restore/orchestrator"
"bytes"
"fmt"
"github.com/cloudfoundry-incubator/bosh-backup-and-restore/executor"
"github.com/cloudfoundry-incubator/bosh-backup-and-restore/orchestrator/fakes"
. "github.com/onsi/ginkgo"
. "github.com/... |
9d9e267a403a2ac72e9a3777f7532f9315cece90 | 39fc656e64e57e4bc2f95a29b105a5e498bb58a7 | ywsfay/awsls | /aws/aws_cloudwatch_log_group.go | Go | go | 937 | permissive | // Code is generated. DO NOT EDIT.
package aws
import (
"context"
"time"
"github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs"
"github.com/jckuester/awstools-lib/aws"
"github.com/jckuester/awstools-lib/terraform"
)
func ListCloudwatchLogGroup(ctx context.Context, client *aws.Client) ([]terraform.Resource, erro... |
855053028f061a3d3b5bd998144713bb8f161919 | 1a18c09daa1f6ad29908c0ea24dcfe342d09858b | okdewit/golang-excercises | /src/exercises/helpers/helpers.go | Go | go | 487 | no_license | package helpers
import (
"image"
"github.com/google/gxui"
"github.com/google/gxui/themes/dark"
"github.com/google/gxui/drivers/gl"
)
var width, height = 256, 256
func ImageViewer(image image.Image) {
gl.StartDriver(func(driver gxui.Driver) {
theme := dark.CreateTheme(driver)
img := theme.CreateImage()
img... |
85e013d0b4a5d6ca101ec60b29c2630729d13d4a | 589faeb563585ac6f6fdd95f01238a74cd4fa888 | shafiurrahmanA/Assignment-2 | /zigzagmatrix2.go | Go | go | 593 | no_license | package main
import (
"fmt"
)
func zigzag(n int) []int {
zz := make([]int, n*n)
i := 0
n2 := n * 2
for p := 1; p <= n2; p++ {
x := p - n
if x < 0 {
x = 0
}
y := p - 1
if y > n-1 {
y = n - 1
}
j := n2 - p
if j > p {
j = p
}
for k := 0; k < j; k++ {
if p&1 ==... |
17b11514e9aba2dba0cc98b7284b6f175ebe72ca | 342f9dc3988b3bc89f3f58f7b4754495caf4bccd | tenther/infinicache | /client/ecRedis.go | Go | go | 11,161 | no_license | package client
import (
"bytes"
"errors"
"github.com/ScottMansfield/nanolog"
"github.com/cespare/xxhash"
"github.com/google/uuid"
"github.com/mason-leap-lab/infinicache/common/logger"
"github.com/mason-leap-lab/redeo/resp"
"io"
"math/rand"
"net"
"strconv"
"sync"
"time"
)
const (
// This setting will avo... |
995cb7b2de25338120ec45290c46d2278e9858b8 | b4d116e1298c440102d13b95658bf3fb39cf5114 | ParadeTo/studygolang | /src/http/controller/feed.go | Go | go | 2,508 | permissive | // Copyright 2016 The StudyGolang Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// http://studygolang.com
// Author: polaris polaris@studygolang.com
package controller
import (
"fmt"
"logic"
"model"
"net/http"
"time"
. "htt... |
26622b5da90e05902ba920f6790ce3b95cf3e927 | ca3a49d1e2bbca318d80da7b03f7168d551616ab | Excalibur0w0/go- | /slice/slice.go | Go | go | 1,252 | no_license | package main
import (
"fmt";
"reflect";
)
func pTypeof(_var interface{}) {
fmt.Printf("%T", _var)
}
func typeof(_var interface{}) string {
return reflect.TypeOf(_var).String()
}
func n() {
fmt.Println()
}
func main() {
var slice1 []int = make([]int, 10)
//equal
slice2 := make([]int, 10)
fmt.Println("切片数组1... |
f37ae8b34c3f5f0c5d864a1a300b177c89d0010b | ea6e25823e357bf9ce2ff0fedce05697e59b3779 | onestay/MarathonTools-HW | /gateway/api.go | Go | go | 1,233 | no_license | package gateway
import (
"fmt"
"net/http"
"net/url"
"github.com/onestay/MarathonTools-HW/serial"
)
var (
state = 0
)
func HandleButtonCommand(bc <-chan serial.ButtonCommand, apiURL string) {
for {
but := <-bc
if but.Command == "PRESSED" {
timerCommand(but.Config, apiURL)
}
}
}
func timerCommand(con... |
1c03518a129c6def59d87600868be6850f2c7e88 | 8eef86f1fe943940d54f5b048d76b0c1ffc47ddb | benburwell/todos | /src/config.go | Go | go | 2,389 | permissive | package main
import (
"errors"
"os"
"path"
"strings"
"github.com/BurntSushi/toml"
"github.com/mitchellh/go-homedir"
)
type Config struct {
IncludeExtensions []string `toml:"include_extensions"`
ExcludeDirectories []string `toml:"exclude_directories"`
Name string `toml:"name"`
includeExten... |
0476f1a766d9aa664b7d79ebef2ac7e0fb11b473 | b436157cf193516b9b7b3cf448917879125716a4 | jayvib/go-functional-programming | /decoratorpattern/decorator/v1.1/simple_log.go | Go | go | 878 | no_license | package decorator
import (
"log"
"io"
"os"
)
var (
Debug *log.Logger
Info *log.Logger
Error *log.Logger
InfoHandler io.Writer
)
func InitLog(
traceFileName string,
debugHandler io.Writer,
infoHandler io.Writer,
errorHandler io.Writer,
) {
if len(traceFileName) > 0 {
_ = os.Remove(traceFileName)
file,... |
df6b0444653d1bac1f461078ef78b7ab3dad7d56 | 9068c1d80985910db295213b1c7524f8df80c05d | wesleywang/lxd | /shared/api/container.go | Go | go | 2,893 | permissive | package api
import (
"time"
)
// ContainersPost represents the fields available for a new LXD container
type ContainersPost struct {
ContainerPut `yaml:",inline"`
Name string `json:"name"`
Source ContainerSource `json:"source"`
}
// ContainerPost represents the fields required to rename/move a LXD co... |
08fc7c310c1f7b56101cc905ec1fa28182b68694 | c0a1db2237284af97c567333654459294bddb32c | olivere/sparta-serverless-demo | /cmd/table_create/main.go | Go | go | 373 | permissive | package main
import (
"github.com/sburke-at-ziprecruiter/sparta-serverless-demo/pkg/config"
"github.com/sburke-at-ziprecruiter/sparta-serverless-demo/pkg/table"
"fmt"
"os"
)
func main() {
out, err := table.CreateTable()
if err != nil {
fmt.Println(err.Error())
os.Exit(1)
}
fmt.Println("Created the Dynam... |
2272198187ff73015daf1ea1a07c1e5b512020c1 | 7c82676e4f5cc00e5a2f90c3e564c7b25cfdd033 | Myriad-Dreamin/market | /service/statistic.go | Go | go | 555 | no_license | package service
import (
"github.com/Myriad-Dreamin/market/control"
statisticservice "github.com/Myriad-Dreamin/market/service/statistic"
"github.com/Myriad-Dreamin/minimum-lib/module"
)
// go:generate go run github.com/Myriad-Dreamin/minimum-lib/code-gen/test-gen -source ./ -destination ../../test/
type Statisti... |
9be81cce22af3105d41145346e677352609dba42 | 60dd6e5ec4ee221b7ee4463fcf7cc21d9334fcea | xjbdjay/gogo | /src/rpc/client.go | Go | go | 2,718 | no_license | package rpc
import (
"io"
"log"
"net"
"sync/atomic"
"time"
)
// TcpClient : tcp client
type TcpClient struct {
address string
protocol ITransProtocol
invokeNum int32
reqPool chan *ReqMsg
}
// worker conf
var (
MaxReqCap = 10000
MaxWorkerNum = 50
)
// NewTcpClient :
func NewTcpClient(address strin... |
1fd62120ad0b0c7fa248b0850befc9db325ac01f | b69cb576efad940127064fbe5631e01e55dfa51b | melhin/tagrelease | /tagrelease/format.go | Go | go | 3,857 | permissive | package tagrelease
import (
"fmt"
log "github.com/sirupsen/logrus"
"strconv"
"strings"
"text/template"
)
type Formatter struct {
converter *Converter
version *Version
}
func NewFormatter(converter *Converter) *Formatter {
return &Formatter{
converter: converter,
version: converter.Detect(),
}
}
//a... |
2b1816e5d0d9d07b3bdc89269dfda6fc38580ea7 | 5150a96bd0d6fc842f632dd3b64e361a1f06b77b | rafaeldias/mobilitee-back-end-developer | /internal/pkg/adding/device/repository_test.go | Go | go | 4,762 | no_license | package device
import (
"errors"
"reflect"
"testing"
"time"
"github.com/DATA-DOG/go-sqlmock"
"github.com/jinzhu/gorm"
)
func setupDB(t *testing.T) (*gorm.DB, sqlmock.Sqlmock) {
db, mock, err := sqlmock.New()
if err != nil {
t.Fatalf("got error while calling sqlmock.New(): %s, want nil", err.Error())
}
g... |
e29d02d3472cf8645822e8e85750bf80ee842901 | 6cdd1f37154f547a6651a96626c09f6882a1bcb1 | bdshadow/kubernetes-client-android | /kubernetes-model/vendor/k8s.io/kubernetes/pkg/apis/admissionregistration/v1beta1/defaults.go | Go | go | 1,748 | permissive | /**
* Copyright (C) 2015 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... |
a14710e5ca52313e011273ba72a729ed0bc11679 | 856d5adb56a3730cfac204eb769663c9da05e599 | master-coder-ll/v2ray-web-manager | /v2ray-jdk/src/main/proto/v2ray.com/core/app/router/router_test.go | Go | go | 1,030 | permissive | package router_test
import (
"context"
"testing"
"v2ray.com/core"
"v2ray.com/core/app/dispatcher"
"v2ray.com/core/app/proxyman"
_ "v2ray.com/core/app/proxyman/outbound"
. "v2ray.com/core/app/router"
"v2ray.com/core/common"
"v2ray.com/core/common/net"
"v2ray.com/core/common/serial"
"v2ray.com/core/proxy"
.... |
3cc948e0a097a06318e82ea9b2272d7f7ea1b6d8 | 9fd72f20629f032622155b55a102e88072c8bc95 | rocknrollMarc/justcms | /admin/column.go | Go | go | 2,180 | no_license | package admin
import (
"fmt"
"net/http"
"github.com/smtc/goutils"
"github.com/smtc/justcms/models"
"github.com/zenazn/goji/web"
)
func ColumnList(c web.C, w http.ResponseWriter, r *http.Request) {
h := goutils.HttpHandler(c, w, r)
var (
id = h.Param.GetInt64("table_id", 0)
err error
table *models.... |
357654d186a8c2369718bb501e3b6e2349463663 | bf753fbda65f5d7172e47dae52c5d9c281e1bfa4 | Scythril/EggContractor | /cmd/serve.go | Go | go | 785 | permissive | package cmd
import (
"github.com/spf13/cobra"
"github.com/fanaticscripter/EggContractor/web"
)
var (
_serveDevMode bool
_serveBindAddr string
)
var _serveCommand = &cobra.Command{
Use: "serve",
Short: "Run web server",
Args: cobra.NoArgs,
PreRunE: subcommandPreRunE,
Run: func(cmd *cobra.Command, ... |
57dc503deaa1c86c9a9094eeb19cb0421c9c5ab1 | e3a0f055b4099027ccc5ce7885ee4bdb6d2b5c6f | asalkeld/cluster-baremetal-operator | /vendor/sigs.k8s.io/kustomize/kustomize/v3/commands/edit/set/setnamespace.go | Go | go | 1,816 | permissive | // Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package set
import (
"errors"
"fmt"
"strings"
"github.com/spf13/cobra"
"sigs.k8s.io/kustomize/api/filesys"
"sigs.k8s.io/kustomize/api/ifc"
"sigs.k8s.io/kustomize/kustomize/v3/commands/internal/kustfile"
)
type setNamespaceOption... |
fcd3e1e3107decbb64d362f2a6bac51b72ecd728 | 31ce2e0611e81afa31f57e45e10aafb2e1d51cf9 | Dragonbuf/grpc-lb | /pkg/hystrix/hystrix.go | Go | go | 1,266 | no_license | package hystrix
import (
"context"
"fmt"
"github.com/afex/hystrix-go/hystrix"
"github.com/pkg/errors"
"grpc-lb/api/protobuf-spec/template"
"grpc-lb/internal/template/service"
"math/rand"
"time"
)
var Name = "seckill"
func init() {
hystrix.ConfigureCommand(Name, hystrix.CommandConfig{
Timeout: ... |
736376ea74c2fe76c7d17cbb66a54c2ee07396ec | ce7e99a11ee3b72fb2b2fd722e306b6b8f0dc0f0 | icodus/go-mysqldumper | /config.go | Go | go | 2,351 | no_license | package mysqldumper
import (
"encoding/json"
"strings"
)
type Config struct {
Tables map[string]string `json:"tables"`
Columns map[string]string `json:"columns"`
Size struct {
Gt *Size `json:"gt"`
Filters map[string]string `json:"filters"`
} `json:"size"`
Replacements map[string]string... |
ee427b7ef351593be97afa127624ebc8d92f3d38 | ab67e5ff1580290effbdecedc4e236d8b8735315 | signaux-faibles/libwekan | /comments.go | Go | go | 349 | permissive | package libwekan
import "time"
type CommentID string
type Comment struct {
ID CommentID `bson:"_id"`
BoardID BoardID `bson:"boardId"`
CardID CardID `bson:"cardId"`
CreatedAt time.Time `bson:"createdAt"`
ModifiedAt time.Time `bson:"modifiedAt"`
Text string `bson:"text"`
UserID ... |
ab3ed285ca32a2bd028b8415b7f6571be250eec7 | 48554193699f7c1888787ffc50a4801088b2f94e | hesidoryn/clusterH | /main.go | Go | go | 475 | no_license | package main
import (
"clusterH/clusterDO"
"clusterH/clusterInterface"
"clusterH/clusterLocal"
"clusterH/store"
"github.com/urfave/cli"
)
func main() {
defer store.Close()
currentClusterType := store.GetCurrentClusterType()
var currentInterface []cli.Command
if currentClusterType == "local" {
currentInt... |
32c2db39f39a7ab59b8e08755f2a942b9c19a261 | da959f93d10c7ecd89c56582f4e16cd9d79fe84e | vdice/cnab-to-oci | /vendor/github.com/deislabs/cnab-go/bundle/parameters.go | Go | go | 742 | permissive | package bundle
type ParametersDefinition struct {
Fields map[string]ParameterDefinition `json:"fields" mapstructure:"fields"`
Required []string `json:"required,omitempty" mapstructure:"required,omitempty"`
}
// ParameterDefinition defines a single parameter for a CNAB bundle
type ParameterDe... |
e32a9bede291557a1a72a51cb616d760d9bad605 | b590cbe145f7973aae4d8ed446f17f89ec7e35e6 | chengchaos/goinaction-practice | /p5/practice_embed_test.go | Go | go | 455 | no_license | package p5
import "testing"
func TestEmbedUser(t *testing.T) {
ad := EmbedAdmin{
EmbedUser: EmbedUser{
Name: "John Smith",
Email: "john.smith@126.com",
},
level: "super",
}
// 我们可以直接访问内部类型的方法
ad.EmbedUser.notify()
// 内部类型的方法也被提升到了外部类型
ad.noti... |
5099e07b245b35e1b4570494e70dd49cd4546b36 | bdf426aee8525efcc9c611249eb9b7d49c4d6092 | daveallie/pgweb | /pkg/api/api.go | Go | go | 6,371 | permissive | package api
import (
"encoding/base64"
"errors"
"fmt"
"strings"
"time"
"github.com/gin-gonic/gin"
"github.com/daveallie/pgweb/pkg/bookmarks"
"github.com/daveallie/pgweb/pkg/client"
"github.com/daveallie/pgweb/pkg/command"
"github.com/daveallie/pgweb/pkg/connection"
"github.com/daveallie/pgweb/pkg/shared"
)... |
6c2b048c6174324677f998daf74778c7efa068d2 | 22c399ade3d423ed56ba24c6b19750e6d96434ca | teamhephy/workflow-cli | /executable/executable.go | Go | go | 3,099 | permissive | package executable
import (
"os"
"path"
"regexp"
"strings"
)
var name string
var stripped string
var env string
var remote string
var config string
var extensions = []string{"app", "bat", "com", "exe", "sh"}
// Name returns the canonical name of the running executable. For example, if
// invocated as `/usr/local... |
9d549d267f45365d6526318f8272ae0db4dc3be0 | 72ebdacac4d2cf35c4addbc67af3fac7e3f0cffb | briancappello/marketstore | /plugins/trigger/trigger.go | Go | go | 4,105 | permissive | // Package trigger provides interface for trigger plugins.
// A trigger plugin has to implement the following function.
// - NewTrigger(config map[string]interface{}) (Trigger, error)
//
// The trigger instance returned by this function will be called on Fire()
// with the filePath (relative to root directory) and inde... |
4d41aa69a710c351d632f1cbd136fadc362c0aea | 2b12770f2ed8909414a4cabba197c935074db5b9 | durgeshsanagaram/argo | /saas/common/src/applatix.io/retry/retry.go | Go | go | 1,633 | permissive | package retry
import (
"applatix.io/axerror"
"math"
"time"
)
type RetryConfig struct {
retryTimeout int64 // 0 indicates no timeout
retryInterval int64 // Minimum 1
retryIntervalMax int64 // 0 indicates no maximum interval
retryExponentialFactor int64 ... |
d1d3e545dcfd24e5b0a5ed0bc2ebfe533c00b0db | ab113e78789be873bc7ffc692a4e56b104ea542c | tnqn/antrea | /pkg/agent/controller/networkpolicy/audit_logging_test.go | Go | go | 13,069 | permissive | // Copyright 2021 Antrea 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 ... |
845fc7a897d5a2ebc74909cd12f4f270bdda857d | f8ff15efb935ebaf8c369136c9814e5c13ec0e3b | wagoodman/origin | /test/extended/builds/digest.go | Go | go | 2,664 | permissive | package builds
import (
"fmt"
g "github.com/onsi/ginkgo"
o "github.com/onsi/gomega"
exutil "github.com/openshift/origin/test/extended/util"
"k8s.io/apimachinery/pkg/apis/meta/v1"
)
var _ = g.Describe("[Feature:Builds][Slow] completed builds should have digest of the image in their status", func() {
defer g.Gi... |
05e7020fb49e3ca9ff527e03e8ef0815b370e138 | 0fca17f623f621c4dd7879631ca7865c9e1e4696 | En1s0o/buffer | /pkg/bytes/v2/buffer.go | Go | go | 1,761 | no_license | package v2
import (
"bytes"
"io"
"github.com/En1s0o/buffer/pkg/sync"
)
type Buffer struct {
inner *bytes.Buffer
sync.RefCountable
sync.Releasable
}
func (b *Buffer) Bytes() []byte {
return b.inner.Bytes()
}
func (b *Buffer) String() string {
return b.inner.String()
}
func (b *Buffer) Len() int {
return b... |
095d27ca6b148c2c12ae66a2a229d416bec51d7f | b27d3df6e8f3f946c383c86c13d35d437329dfa4 | thebevrishot/pg | /orm/select_test.go | Go | go | 12,047 | permissive | package orm
import (
"time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
type User struct {
tableName struct{} `sql:"user"`
}
type User2 struct {
tableName struct{} `sql:"select:user,alias:user"`
}
type SelectModel struct {
Id int
Name string
HasOne *HasOneModel
HasOneId int
HasMan... |
a763ccd195ee507ad1d5a4ebea3fa59f061a8ae3 | 489094634d26d6ffb5cb1d769ae6edfd6492c56d | tonytanCoder/website-fetcher | /url.go | Go | go | 2,471 | no_license | package main
import (
"errors"
"net/http"
"net/url"
"path"
"sort"
"strings"
"crypto/tls"
)
// 增强URL
type URL struct {
*url.URL
FilePath string // 生成的静态文件相对于工作目录的路径
}
// ParseURL 将s转化为增强URL,host为默认的域名(如果s没有指定域名)
func ParseURL(s, host string) (*URL, error) {
u, err := url.Parse(s)
if err != nil {
return n... |
49a8d17cda5e4893bf49b6759127665653733f2e | 2ed7e0cef58bbd62cb4429cafeb37bcc5262f253 | cloudawan/cloudone | /notification/storage_cassandra_test.go | Go | go | 2,049 | permissive | // Copyright 2015 CloudAwan 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 i... |
0b6c64e4b524a9ce37b4c98f7a0bd5a6ac8c81d9 | 8567eec146b9d1be8e01d800c47bb585ff8e4464 | bcbchain/xwallet | /src/common/wal/wal.go | Go | go | 6,299 | no_license | package wal
import (
"blockchain/algorithm"
"bytes"
"common/fs"
"common/sig"
"common/utils"
"errors"
"fmt"
"io/ioutil"
"path/filepath"
"os"
"regexp"
"strings"
"unicode"
"github.com/tendermint/go-amino"
"github.com/tendermint/go-crypto"
cmn "github.com/tendermint/tmlibs/common"
"golang.org/x/crypto/s... |
e555b6f19bfae6f3b997f07565c5e45c236ac677 | 195a5bb27fe7a7112e4347f7ebfa1f366ac8830b | GoLandr/seaweedfs | /weed/mount/weedfs.go | Go | go | 5,970 | permissive | package mount
import (
"context"
"github.com/chrislusf/seaweedfs/weed/filer"
"github.com/chrislusf/seaweedfs/weed/mount/meta_cache"
"github.com/chrislusf/seaweedfs/weed/pb"
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/storage/types"
"github.com/chrislusf/seaweedfs/weed/... |
38325f449ca973c6c98cfc3381c426301efa856f | c97cdcc90b824ce55a7a8e4593ace336c7561f06 | mpwusr/quarks-operator | /e2e/kube/examples_test.go | Go | go | 13,554 | permissive | package kube_test
import (
b64 "encoding/base64"
"fmt"
"path"
"strings"
"time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"k8s.io/apimachinery/pkg/util/wait"
cmdHelper "code.cloudfoundry.org/quarks-utils/testing"
)
var _ = Describe("Examples Directory", func() {
var (
example string
y... |
b31558b2887ab8a03d552b65da0cd6b08095fcef | 82a8937cbf6fe87ef66961fc13d7af41c999b666 | algohell/ALGOHELL | /118/ljh.go | Go | go | 479 | no_license | func generate(numRows int) [][]int {
var res [][]int
if numRows == 0 {
return res
}
row := []int{1}
res = append(res, row)
for i:=0;i<numRows-1;i++ {
temp := []int{1}
for j:=0;j<len(row);j++ {
if j + 1 == len(row) {
break
}
... |
79a13cb78c295accb81ff2adb53f7e8162d0e157 | 3219b42618d0ee00f2e7112437e54b5ec5e7a809 | tony24681379/402 | /main.go | Go | go | 1,055 | no_license | package main
import (
"net/http"
"os"
"os/signal"
"time"
"github.com/gin-gonic/gin"
"github.com/golang/glog"
"github.com/tony24681379/402/config"
"github.com/tony24681379/402/middleware"
"github.com/tony24681379/402/route"
)
func main() {
config := config.Config()
g := gin.New()
g.Use(gin.Recovery())
g.... |
38b6df6a5e2f27469161a77407df503a3e7c980d | 2b724137fc3e3ec54f08ae97513d5b0fcd688f2f | isabella232/cf-acceptance-tests | /cats_suite_test.go | Go | go | 6,539 | permissive | package cats_test
import (
"fmt"
"io/ioutil"
"os"
"os/exec"
"testing"
"time"
. "github.com/cloudfoundry/cf-acceptance-tests/cats_suite_helpers"
"github.com/cloudfoundry/cf-acceptance-tests/helpers/assets"
"github.com/mholt/archiver"
_ "github.com/cloudfoundry/cf-acceptance-tests/apps"
_ "github.com/cloudf... |
ed5f91243e0038daab1805db6c4ddfd619478013 | 714d257057b48baafad387fc153f6a9b5417021a | timkelleher/ferry-bot | /pkg/wsdot/schedule.go | Go | go | 1,838 | no_license | package wsdot
import (
"encoding/json"
"fmt"
"time"
)
type ScheduleEndpoint struct{}
func (e ScheduleEndpoint) url(date time.Time, from, to int) string {
day := date.Format("2006-01-02")
return fmt.Sprintf("schedule/%s/%d/%d?apiaccesscode=%s",
day,
from,
to,
apiKey,
)
}
func (e ScheduleEndpoint) Paylo... |
b0441132226f8e984556f2e742f52114794843f0 | ef7d08dfbce3f5f6c2c28da0dedea9c9fc12015d | trananhkma/go-study | /day5/dichso.go | Go | go | 3,250 | no_license | package day5
import (
"fmt"
)
var phatAm, donVi = initMap()
func Dichso() {
var ntest int
fmt.Print("Ntest: ")
fmt.Scan(&ntest)
for i := 0; i < ntest; i++ {
fmt.Print("X < 1000ti: ")
var x string
fmt.Scan(&x)
x = cut0(x)
fmt.Printf("Test %d: %s\n", i+1, d... |
e63af12a08292617824603162e1ef6bc28f20fb0 | 0919473f695171914b69cf9387edc3af6a6644f3 | discoltk/btcd | /database/driver_test.go | Go | go | 4,312 | permissive | // Copyright (c) 2015-2016 The btcsuite developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package database_test
import (
"fmt"
"testing"
"github.com/discoltk/btcd/database"
_ "github.com/discoltk/btcd/database/ffldb"
)
var (
// ignoreDbTypes are types... |
333530dbeff9184a5b4dd339501acd2e09c7f07c | aae546032bc1ef1123267cde8fe61b802aa79e20 | znobrega/file-storage | /pkg/dto/file_response.go | Go | go | 617 | no_license | package dto
import (
"time"
)
type FilePublic struct {
File
URL string `json:"url"`
}
type File struct {
FileID string `json:"fileId"`
Name string `json:"name"`
Path string `json:"path"`
Extension string `json:"extension"`
Directory string `json:"directory"`
FileSize string `... |
fb0f7b615057d7ae54c204d295837095f3660491 | ce0581da478b68bdafc80177396dc1ae36b09d48 | scp1513/san | /gate/network/network.go | Go | go | 2,077 | no_license | // 封装网络相关操作
package network
import (
"log"
"time"
"github.com/scp1513/ec/serial"
)
const (
statusInvalid = iota
statusConnecting
statusRunning
statusStopping
statusReconnect
)
var (
status = statusInvalid
sendClientBegin = make(chan struct{}, 0)
sendShutdown = make(chan uint32, 1)
recvSeria... |
68ff13cdf72174c2810025d95d0423f4eed912bb | 0dd12960967c84610862c50e50c957c141cc1a16 | 80d000/go-ipfs | /core/coreapi/interface/options/unixfs.go | Go | go | 7,858 | permissive | package options
import (
"errors"
"fmt"
cid "gx/ipfs/QmR8BauakNcBa3RbE4nbQu76PDiJgoQgz8AJdhJuiU4TAw/go-cid"
dag "gx/ipfs/QmUtsx89yiCY6F8mbpP6ecXckiSzCBH7EvkKZuZEHBcr1m/go-merkledag"
mh "gx/ipfs/QmerPMzPk1mJVowm8KgmoknWa4yCYvvugMPsgWmDNUvDLW/go-multihash"
)
type Layout int
const (
BalancedLayout Layout = iota
... |
ca1d689409ef7f112a505f3fafe700dcaf3ff9ee | 73febc71e35e4b6fd22721c5d42e5698b3eccc5e | cyh97106428/api.lottery.thirdparty | /handler/base/o_db.go | Go | go | 1,418 | no_license | package base
import (
"mycommon/logs"
"mycommon/mathstr"
"mycommon/utils"
"api.lottery.thirdparty/global"
"api.lottery.thirdparty/model"
)
func SaveSSC(tablename string, lottery interface{}, mode int) {
defer func() {
if e := recover(); e != nil {
logs.Error(e)
}
}()
orm := global.GetNewOrm()
defer g... |
cf10cede503db4f647cb753b5f07eaa1add8668f | 930cd9d380128ec05c8c12786a2efcefd6aef931 | theblackturtle/ffuf | /pkg/filter/lines.go | Go | go | 1,786 | permissive | package filter
import (
"fmt"
"strconv"
"strings"
jsoniter "github.com/json-iterator/go"
"github.com/theblackturtle/ffuf/pkg/ffuf"
)
type LineFilter struct {
Value []ffuf.ValueRange
}
func NewLineFilter(value string) (ffuf.FilterProvider, error) {
var intranges []ffuf.ValueRange
for ... |
0cd88c59e75b33592c13d76904fb27b6b99f5401 | fc32bc040eca0eb54e84c0ffde71f5a4d6a2fa0f | ltcsuite/lnd | /routing/pathfind_test.go | Go | go | 93,755 | permissive | package routing
import (
"bytes"
"crypto/sha256"
"encoding/binary"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"math"
"math/big"
"net"
"os"
"reflect"
"strings"
"testing"
"time"
"github.com/ltcsuite/lnd/channeldb"
"github.com/ltcsuite/lnd/htlcswitch"
"github.com/ltcsuite/lnd/kvdb"
"gi... |
83dc9ef3358f7bc6de10f72912f1b16924846f5f | 8eadcb5e6d3e868222b39788894ed1c088be57bd | sjeandeaux/toolators | /information/information_test.go | Go | go | 243 | permissive | // Package information on project
package information_test
import (
"testing"
"github.com/sjeandeaux/toolators/information"
"github.com/stretchr/testify/assert"
)
func TestPrint(t *testing.T) {
assert.NotEmpty(t, information.Print())
}
|
26b81ab53071d07e279592a6654c683b10fd8693 | 2bb792c421289ccdace51f54419c2e4a03501b7d | yext/vitess | /go/vt/vttablet/tabletmanager/rpc_server.go | Go | go | 3,413 | permissive | /*
Copyright 2019 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... |
f9f1a1436da3ccea4f2555c598a656cb2090fa6b | c980a4a0f2e3488119d374acb61149d7475ce9bd | aantono/gogstash | /filter/kv/filterkv.go | Go | go | 3,346 | permissive | package kv
import (
"context"
"github.com/tsaikd/gogstash/config"
"github.com/tsaikd/gogstash/config/logevent"
"strconv"
"strings"
)
// ModuleName is the name used in the config file
const ModuleName = "kv"
// FilterConfig holds the configuration json fields and internal objects
type FilterConfig struct {
conf... |
a26d7f5cbf9711872d95435a2a83041eefb4bb29 | 6258b544cb4dfcbf2d24755ca82d607ba56b22b9 | Aceix/hello-go | /prog-14.go | Go | go | 521 | no_license | /*
* a package can have multiple init() functions
* which will be called by go in their order of declaration
*
*/
package main
import "fmt"
// this variable is initialized first due to
// order of declaration
var initCounter int
func init() {
fmt.Println("Called First in Order of Declaration")
initCounter++
}... |
28d0534bbe1128e4c4d800232764b8b98817cf02 | 3ad4e4dd47316ac482077d31be4b830e3d2067b4 | jaydenwen123/mosn | /pkg/upstream/servicediscovery/dubbod/pub.go | Go | go | 3,358 | 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 ... |
9af67d906d3871383f7f44e8173f5b517d8f08dc | 13b86f9a721e7c984401e0d9ee40e09f38f5cbfe | dpb587/go-sitemap | /xmlencoding/atomfeed/default.go | Go | go | 563 | permissive | package atomfeed
import (
"encoding/xml"
"io"
"go.dpb.io/sitemap/data"
"go.dpb.io/sitemap/xmlencoding"
)
// DefaultDecoder is the standard decoder for the <feed /> root element.
var DefaultDecoder = FeedDecoder()
// DefaultDecoderSet allows processing a standard Atom feed.
var DefaultDecoderSet = xmlencoding.Ne... |
4cfd54f3f99749b1752d25a61557c8958663eb0f | cd1d4f72a45c7237db957e89f8bd65b06c48855c | DataDog/datadog-api-client-go | /api/datadogV2/model_fastly_account_create_request_attributes.go | Go | go | 5,445 | 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 datadogV2
import (
"fmt"
"github.com/goccy/go-json"
"github.com/DataDo... |
c6d48ddeb795b6232d8fb785b3dbbe8a981f8cad | 78d01eec356e79d52972d69b9574b0fc6a34fb6d | MwrPub/mini-website-render | /Mwr.go | Go | go | 472 | no_license | package mini_website_render
import (
"fmt"
"log"
"net/http"
)
type Mwr struct {
host string
port int
}
func helloMwr(writer http.ResponseWriter, r *http.Request) {
_, _ = fmt.Fprint(writer, "MWR is NB!")
}
func (mwr *Mwr) Run() {
http.HandleFunc("/", helloMwr)
err := http.ListenAndServe(":9000", nil)
log.P... |
6facc9a513ea4dad93fa4737fd3933b5559f19d4 | 6653704025ca91f01b35b1f636a9ed74767631ef | apoorva11029/aci-containers | /vendor/github.com/hashicorp/consul/agent/agent_endpoint.go | Go | go | 43,446 | permissive | package agent
import (
"encoding/json"
"fmt"
"log"
"net/http"
"path/filepath"
"strconv"
"strings"
"time"
"github.com/hashicorp/go-memdb"
"github.com/mitchellh/hashstructure"
"github.com/hashicorp/consul/acl"
cachetype "github.com/hashicorp/consul/agent/cache-types"
"github.com/hashicorp/consul/agent/deb... |
ee00ce6b1bf6d5632c93bffed2440e3275713fb3 | cb2460b6bc84320a8a1e1efb82a7ac9d3f3dc2e3 | paaguti/quic-go | /internal/congestion/hybrid_slow_start_test.go | Go | go | 2,255 | permissive | package congestion
import (
"time"
"github.com/paaguti/quic-go/internal/protocol"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Hybrid slow start", func() {
var (
slowStart HybridSlowStart
)
BeforeEach(func() {
slowStart = HybridSlowStart{}
})
It("works in a simple case", f... |
8ef3c33461c1c61b4d18be22aa50bfef8a6fac06 | a72ed76518eb121432f9e82b7ba031603633cb95 | YX-XiaoBai/ginBase | /backend/public/const.go | Go | go | 258 | no_license | package public
const (
ValidatorKey = "ValidatorKey"
TranslatorKey = "TranslatorKey"
AdminSessionInfoKey = "AdminSessionInfoKey"
LoadTypeHTTP = 0
LoadTypeTCP = 1
LoadTypeGRPC = 2
HTTPRuleTypePrefixUrl = 0
HTTPRuleTypeDomain = 1
)
|
1642e73b654237bcc74be8689623ee5eaadd9ab5 | a3b0f7f23c0d69e6044b193ec3f2c93546cfc00b | byron-marohn/daos | /src/control/server/config_test.go | Go | go | 19,562 | permissive | //
// (C) Copyright 2018-2019 Intel Corporation.
//
// 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 la... |
84c6ad96b292e8b28484c465db60049781c34007 | 87cf3c4cc8f210c3231696a8c8c6e43860c1e5aa | nsip/nias-go-naplan-registration | /xml/parse.go | Go | go | 6,782 | permissive | // Shared code - XML Parser
package xml
import (
"encoding/json"
"encoding/xml"
"fmt"
"io"
"os"
)
var OUTPUT = false
// XXX add elements
// XXX Transaction ID and Sequence ID (see CSV)
/*
CSV Files Headers
LocalId,SectorId,DiocesanId,OtherId,TAAId,StateProvinceId,NationalId,PlatformId,PreviousLocalId,Previou... |
eaf7ef5a72e6994d4828c3b29b36f7841c9cc7af | abccd98043f08da75a80efe157156ad4ea931484 | v3io/tsdb-nuclio | /functions/query/vendor/github.com/v3io/v3io-tsdb/examples/nuclio/query/query_example.go | Go | go | 4,085 | permissive | package main
import (
"bytes"
"encoding/json"
"os"
"strconv"
"strings"
"sync"
"github.com/nuclio/nuclio-sdk-go"
"github.com/pkg/errors"
"github.com/v3io/v3io-tsdb/pkg/config"
"github.com/v3io/v3io-tsdb/pkg/formatter"
"github.com/v3io/v3io-tsdb/pkg/pquerier"
"github.com/v3io/v3io-tsdb/pkg/tsdb"
"github.co... |
651f37bf24cdc682ddc3d89e5cfc435e7541cf28 | 59953f1ceed0e3e6f2bd0e9df02cda684c080dcc | golang-design/under-the-hood | /gosrc/runtime/cgocallback.go | Go | go | 317 | permissive | // Copyright 2011 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.
package runtime
// These functions are called from C code via cgo/callbacks.go.
// Panic.
func _cgo_panic_internal(p *byte) {
panic(gostringnocopy(p))
}
|
c05b01c09712986d55cd526bc481d904ac6d8139 | 45fa627209103ab44f9db72d6a6557ac3f045206 | AdrianaMusic/gvisor | /pkg/tcpip/tcpip.go | Go | go | 64,414 | permissive | // Copyright 2018 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... |
803247d33c62da228d11d7d0f890abf6b457fffe | 6e54026775434db6c7b222c33701795270b37b65 | bpkgoud/pulumi-azure-native | /sdk/go/azure/network/v20200501/getIpAllocation.go | Go | go | 1,392 | permissive |
package v20200501
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func LookupIpAllocation(ctx *pulumi.Context, args *LookupIpAllocationArgs, opts ...pulumi.InvokeOption) (*LookupIpAllocationResult, error) {
var rv LookupIpAllocationResult
err := ctx.Invoke("azure-native:network/v20200501:getIpAllocation"... |
8484f9859e01ab45a68ac84e7079510435abfa6d | 02503cff828fc6aa20218bf0500dbbd6b9bf8880 | rizalgowandy/go | /src/crypto/tls/quic_test.go | Go | go | 13,880 | permissive | // Copyright 2023 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.
package tls
import (
"context"
"errors"
"reflect"
"testing"
)
type testQUICConn struct {
t *testing.T
conn *QUICConn
readSecret map[Q... |
29d4b6e87a3b67316f94e20300deb17bd0e81c9d | b09c77a7e16b5c104d8d01566faa13e39ee24fce | amscanne/hibera | /hiberad/main.go | Go | go | 5,768 | no_license | package main
import (
"errors"
"fmt"
"github.com/amscanne/hibera/cli"
"github.com/amscanne/hibera/cluster"
"github.com/amscanne/hibera/core"
"github.com/amscanne/hibera/server"
"github.com/amscanne/hibera/storage"
"github.com/amscanne/hibera/utils"
"io/ioutil"
"net"
"os"
... |
25ed46930ee45b4561defcb50f6c5bdf34e4d599 | e603c38f7fc4e780726759afb31d168250a915b3 | baderkha/rpost-it-go-v2 | /internal/api/controller/session_auth.go | Go | go | 2,331 | no_license | package controller
import (
"rpost-it-go/internal/api/repo"
"rpost-it-go/internal/api/service"
"time"
"github.com/davecgh/go-spew/spew"
"github.com/gofiber/fiber/v2"
)
// SessionAuth : Session based authentication used as the login controller
type SessionAuth struct {
Basecontroller
DefaultAuthDurationDays ti... |
dc8de1e696b3e1ac78656630dc78ab13cc6dade7 | 11808386aa9f9e133132320181dcfb2b03b2f051 | JackLCL/milvus | /internal/querynodev2/segments/segment_test.go | Go | go | 5,185 | permissive | package segments
import (
"context"
"testing"
"github.com/stretchr/testify/suite"
"github.com/milvus-io/milvus-proto/go-api/schemapb"
"github.com/milvus-io/milvus/internal/proto/querypb"
"github.com/milvus-io/milvus/internal/proto/segcorepb"
storage "github.com/milvus-io/milvus/internal/storage"
"github.com/... |
35506d1b95304d89372d58f68f8f6edd4e7409a2 | c014b981c5a57f4e7fd24ac1b700db0ef66921e3 | yangleizhou/design-patterns | /02-structural/01-proxy.go | Go | go | 843 | no_license | package structural
import "fmt"
//代理模式用于延迟处理操作或者在进行实际操作前后对真实对象进行其它处理
var _ Subject = (*RealSubject)(nil)
var _ Subject = (*ProxyObject)(nil)
//Subject 抽象主题类
//通过接口或抽象类声明真实主题和代理对象实现的业务方法
type Subject interface {
Do()
}
//RealSubject 真实主题类
//实现了抽象主题中的具体业务
type RealSubject struct {
}
// Do do实现
func (*RealSubject) ... |
5c145eb8bdebf3679684a247ffdabbbfe6f01742 | 2eb2fac98400ed5defc064157b953e24bb6d40e5 | ironm0nk3y/lxd | /lxd/storage/drivers/utils.go | Go | go | 20,141 | permissive | package drivers
import (
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"sort"
"strings"
"time"
"github.com/pkg/errors"
"golang.org/x/sys/unix"
"github.com/lxc/lxd/lxd/operations"
"github.com/lxc/lxd/shared"
"github.com/lxc/lxd/shared/idmap"
)
const minBlockBoundary = 8192
// wipeDirectory empties the co... |
be4c6e190c68b9d0aa3816f332d521e6888ac348 | acd846f1fcb4a8f18d502564fa01157b61290b6d | yitume-toru/shop-api | /model/mysql/coupon.gen.go | Go | go | 1,944 | permissive | package mysql
type Coupon struct {
Id int `json:"id" form:"id" gorm:"primary_key"` // id
Title string `json:"title" form:"title" ` // 名称
StartTime int64 `json:"start_time" form:"start_time" ` // 开始时间
EndTime int64 `json... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.