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 |
|---|---|---|---|---|---|---|---|---|
186a83f647d732654f03bdba877ffe475bd082a0 | bdd8e9b66a20aeacf3d946ebc431849d8091fff3 | kubernetes/kubernetes | /vendor/go.etcd.io/etcd/pkg/v3/traceutil/trace.go | Go | go | 6,199 | permissive | // Copyright 2019 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... |
fbd2c5fde8aa107f79fc1e0c775477d7e072a3bb | 196f7cc3d21d082efb5632c0e3383dec05a784cb | fpawel/atool | /internal/pkg/julian.go | Go | go | 1,348 | no_license | package pkg
import (
"time"
)
//calculate the Julian date, provided it's within 209 years of Jan 2, 2006.
func TimeToJulian(t time.Time) float64 {
year := t.Year()
month := int(t.Month())
day := t.Day()
a := (14 - month) / 12
y := year + 4800 - a
m := month + 12*a - 3
julianDay := day + (153*m+2)/5 + 365... |
e69e8f71729f825b704d0201eef19673df3ad18a | c969dde74db6eab0f70ff0884ba6482bbd035c67 | solo-io/gloo | /projects/gloo/pkg/api/converters/kube/account_credentials_secret.go | Go | go | 2,217 | permissive | package kubeconverters
import (
"context"
"github.com/solo-io/solo-kit/pkg/utils/kubeutils"
v1 "github.com/solo-io/gloo/projects/gloo/pkg/api/v1"
"github.com/solo-io/solo-kit/pkg/api/v1/clients/kubesecret"
"github.com/solo-io/solo-kit/pkg/api/v1/resources"
skcore "github.com/solo-io/solo-kit/pkg/api/v1/resourc... |
1f96cf95b682e293c3cfcb3ba42703c3a6fe423d | e9317f9a4500d0201ab3501ddfecec96e7ffcb17 | olagacek/opentelemetry-collector | /exporter/jaeger/jaegerthrifthttpexporter/factory_test.go | Go | go | 3,607 | permissive | // Copyright 2019, 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... |
d07edeb742e609b6de23be129ff2d75b240b38d5 | a953544eb46aa3c6ccdad292d7ef4e88ed831678 | database-cache/matrixcube | /raftstore/store_test.go | Go | go | 10,140 | permissive | // Copyright 2020 MatrixOrigin.
//
// 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... |
97e4bfdb177b2f67ce77d72f3f9d7c110da951c0 | 9d0d451741c17fdcf10c84260270731a67e26cd0 | dolguin-/matterbridge | /bridge/nctalk/nctalk.go | Go | go | 6,283 | permissive | package nctalk
import (
"context"
"crypto/tls"
"strconv"
"strings"
"github.com/42wim/matterbridge/bridge"
"github.com/42wim/matterbridge/bridge/config"
"gomod.garykim.dev/nc-talk/ocs"
"gomod.garykim.dev/nc-talk/room"
"gomod.garykim.dev/nc-talk/user"
)
type Btalk struct {
user *user.TalkUser
rooms []Broo... |
1869b79677c51a32ee4e7fcb1c75479eafd0e150 | 63ae69886794e2fc4569a87a21bdda6e63155187 | ratogabriel/mailazy-go | /mailazy.go | Go | go | 986 | permissive | package mailazy
import (
"github.com/kunal-saini/httpman"
)
type SenderClient struct {
Client *httpman.Httpman
}
func NewSenderClient(key, secret string) *SenderClient {
client := httpman.New(DefaultEndpoint).SetHeader(APIKeyHeaderKey, key).SetHeader(APISecretHeaderKey, secret)
return &SenderClient{Client: clien... |
7923fee55f3e7cbb05e855b00eef4639cbb38db0 | ecadd1356323966c6bed1bc509dbcaea54bd764f | ikirker/ConfGeocoder | /schema.go | Go | go | 2,092 | no_license | package main
import (
"gopkg.in/yaml.v2"
"io/ioutil"
"os"
)
// Note: we don't expect to have to output these as JSON;
// but the JSON names might be useful for e.g. debugging dumps
type ConferenceSeries struct {
Name string `yaml:"name";json:"name"`
LongName string `yaml:"long-name";json:"long... |
010c7191a696d2a29cb98aabb3be387982456b2b | 890f6777a99d9f697167053cc319224d901fe791 | souled3000/kindergarten | /controllers/organizational.go | Go | go | 12,952 | no_license | package controllers
import (
"kindergarten-service-go/models"
"github.com/astaxie/beego/validation"
)
//组织架构
type OrganizationalController struct {
BaseController
}
type JSONStruct struct {
Status string `json:"status";`
Code int `json:"code";`
Result interface{} `json:"result";`
Msg string... |
ad783fbe11bd2731d51928576342d38863cd3f8c | 8d7771c433b10551242d1bec3b9efe505b48abba | charly3pins/piglatin | /handler.go | Go | go | 839 | no_license | package piglatin
import "log"
// Handler is the generic interface used to translate words
type Handler interface {
Translate(Word) Word
}
// DefaultHandler is the handler that processes the words that doesn't match with other rules
type DefaultHandler struct {
Next Handler
}
// Translate is the method to translat... |
c5350e0e9470471bc385fdbe320318bb1ab88e6e | cc224efa722f9ac22cdce4e4274bb002d8a1cb0f | src-d/go-cli | /examples/basic/main_test.go | Go | go | 801 | permissive | package main
import (
"bytes"
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"testing"
"github.com/stretchr/testify/require"
)
var testBin string
func init() {
bin := "test"
if runtime.GOOS == "windows" {
bin = "test.exe"
}
dir, err := os.Getwd()
if err != nil {
panic(err)
}
testBin = filep... |
311a5ec59e57404250c21bacdf9150717c4f932f | 0ccaa6843e62f4b306159cef813a8baf70704eff | jglenc/Test2 | /pack3d/bvh.go | Go | go | 4,282 | permissive | package pack3d
import "github.com/jglenc/Test"
type Tree []fauxgl.Box
func NewTreeForMesh(mesh *fauxgl.Mesh, depth int) Tree {
mesh = mesh.Copy()
mesh.Center()
boxes := make([]fauxgl.Box, len(mesh.Triangles))
for i, t := range mesh.Triangles {
boxes[i] = t.BoundingBox()
}
root := NewNode(boxes, depth)
tree ... |
82bef62b6c1c9cc0eae7c2cc863207c748c77db4 | f2e8e83536a390a0b6a658eceeaf12f5e182f692 | swisscom/bosh-agent | /integration/nats_firewall_test.go | Go | go | 3,613 | permissive | package integration_test
import (
"fmt"
"os"
"github.com/cloudfoundry/bosh-agent/settings"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
"github.com/onsi/gomega/format"
)
var _ = Describe("nats firewall", func() {
Context("ipv4", func() {
BeforeEach(func() {
//restore original settings of bosh f... |
743ec4f3b0a47ad1c038d834b8c10ddbc2b2273b | d6fbd509b810d7e78454cce1278536191d5f0d10 | srdczk/file_server | /main.go | Go | go | 371 | no_license | package main
import (
"fmt"
"github.com/srdczk/file_server/handler"
"net/http"
)
func main() {
// set handler for update
http.HandleFunc("/file/upload", handler.UploadHandler)
http.HandleFunc("/file/upload/success", handler.UploadSuccessHandler)
err := http.ListenAndServe(":9393", nil)
if err != nil {
fmt.P... |
e9b3a214a8cf5f0e2df63c319b789b792bcb5556 | b5a553b8a7117e8ca50d1a8c8526b3fad85f470b | dabue/chrome-ssh-agent | /go/keys/manager.go | Go | go | 13,970 | permissive | // Copyright 2017 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 ... |
564e2dcfbe094991688f08955fc0de83be012cfd | bbefb170871c5c2f39cefb6f9a901a9d18cd37c5 | jhallat/todo-schedule-service | /httphelper/httphelper_test.go | Go | go | 408 | no_license | package httphelper
import "testing"
func TestParseUrl(t *testing.T) {
var result, _ = parseUrl("localhost:8080/api/test/1/subtest/ok", "test/:id/subtest/:label")
if result["id"] != "1" {
t.Errorf("Invalid value from 'id', expected '%s', actual '%s'", "1", result["id"])
}
if result["label"] != "ok" {
t.Errorf... |
8b10f7ee292b47ab4d0bacb8b0b6e82e4963d13c | d52dbbd73aeee8b0f8d5259e593f2cee001a3f1c | camirmas/skiena | /structures/hash_table_test.go | Go | go | 440 | no_license | package structures
import (
"testing"
// "fmt"
)
func TestHashTable(t *testing.T) {
table := make(HashTable, 2^32)
table.Insert("hello", 1234)
if res := table.Get("hello"); res == nil {
t.Errorf("Expected 1234, got nil")
}
if res := table.Get("hello123"); res != nil {
t.Errorf("Expected nil, got %v", re... |
15876abc1bbae716b1e681857b30671e80f4e842 | 6eac8aeef91449e4c544d45b706a15a82a6fce60 | tanzhifeng/MasterProject | /Server/loginserver/logic/Logical_Login.go | Go | go | 2,622 | no_license | package logic
import (
"../../common"
"../../common/prot/pt_com"
"../../common/prot/pt_login"
"../../common/tools"
"../global"
"../include"
"fmt"
)
func (o *Logical) LoginServerUserLogin(params ...interface{}) {
fmt.Println(params...)
loginsocket := params[0].(uint32)
account := params[1].(string)
passwor... |
3acbb9b380c4265ad3a8f9054c0b8f58022c1753 | bd5c5502b99788f1e4a08115f8d63c7442f4e0d4 | kbsingh/almighty-core | /design/spaces.go | Go | go | 3,809 | permissive | package design
import (
d "github.com/goadesign/goa/design"
a "github.com/goadesign/goa/design/apidsl"
)
var space = a.Type("Space", func() {
a.Attribute("type", d.String, "The type of the related resource", func() {
a.Enum("spaces")
})
a.Attribute("id", d.UUID, "ID of the space", func() {
a.Example("40bbdd3... |
4656eea4e7f4c3238bd0d99796e22755c58b5f19 | 94a8e24433698cbc6a3f485b690f57f0169bd49a | zaKuDER/lotus | /node/impl/full/sync.go | Go | go | 4,510 | permissive | package full
import (
"context"
"sync/atomic"
cid "github.com/ipfs/go-cid"
pubsub "github.com/libp2p/go-libp2p-pubsub"
"go.uber.org/fx"
"golang.org/x/xerrors"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain"
"github.com/filecoin-pro... |
1b3b266b75c9d9135d9913dc29143ddca0a0030d | 259576ac69834f9815fd0e598841175f3a194c80 | Cwells126/php-buildpack | /src/php/integration/deploy_a_php_app_with_amqp_test.go | Go | go | 1,011 | permissive | package integration_test
import (
"os"
"path/filepath"
"time"
"github.com/cloudfoundry/libbuildpack/cutlass"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("CF PHP Buildpack", func() {
var app *cutlass.App
AfterEach(func() { app = DestroyApp(app) })
Context("deploying a basic PHP... |
b51fbeed3f6b4f7a027d7e5e64ce9bc9ffae3919 | 13617df3d81523e1a3ba06dd2f4b6b293e6d389a | RTradeLtd/go-ipfs-plugin-i2p-gateway | /vendor/gx/ipfs/QmU44KWVkSHno7sNDTeUcL4FBgxgoidkFuTUyTXWJPXXFJ/quic-go/integrationtests/chrome/chrome_test.go | Go | go | 1,835 | permissive | package chrome_test
import (
"fmt"
"gx/ipfs/QmU44KWVkSHno7sNDTeUcL4FBgxgoidkFuTUyTXWJPXXFJ/quic-go/integrationtests/tools/testserver"
"gx/ipfs/QmU44KWVkSHno7sNDTeUcL4FBgxgoidkFuTUyTXWJPXXFJ/quic-go/internal/protocol"
. "github.com/onsi/ginkgo"
)
var _ = Describe("Chrome tests", func() {
for i := range protocol... |
accde503b10d856decf171ef477f13858d92b865 | 0d6ce0232ccce1358a74a0cfb8bfe2469264d173 | lesetse/metro2 | /pkg/file/file_test.go | Go | go | 9,411 | permissive | // Copyright 2020 The Moov Authors
// Use of this source code is governed by an Apache License
// license that can be found in the LICENSE file.
package file
import (
"bytes"
"encoding/json"
"io/ioutil"
"path/filepath"
"strings"
"testing"
"github.com/moov-io/metro2/pkg/lib"
"gopkg.in/check.v1"
)
func TestFi... |
be8729f1d28a00ee994e51cc0b782bf6967a465b | 968f1efc8628f4b13e5983b4e1978ba142a6740f | mrzhouyu/go-GO | /src/面向对象.go/接口转换.go | Go | go | 525 | no_license | package main
import "fmt"
type Humaner interface { //子集
sayHello() //只负责声明不负责实现方法 由别的自定义类型实现
}
type Yuchou interface { //超集
Humaner //继承接口
game()
}
type Student struct {
name string
age int
}
func (s *Student) sayHello() {
fmt.Println("Student被调用")
}
func (s *Student) game() {
fmt.Println("LOL")
}
func m... |
f67a9eaac94f79da04be3a283b20ca4578415233 | 0fe87e228e335579c55dc5e8027ae07614a0e7d4 | ursmurli/s5cmd | /complete/complete.go | Go | go | 7,330 | permissive | package complete
import (
"context"
"errors"
"flag"
"math"
"runtime"
"strconv"
"strings"
"time"
"github.com/PiranhaTeam/s5cmd/core"
"github.com/PiranhaTeam/s5cmd/opt"
"github.com/PiranhaTeam/s5cmd/url"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/s3"
cmp "github.com/posener/comple... |
d60dd09e75d0927a0300a173b55d6e02867ae262 | 0211b124ff8d53d07cf413d493b8ecf8de76dc75 | cyningchen/video_server | /scheduler/dbops/conn.go | Go | go | 283 | no_license | package dbops
import (
"database/sql"
_ "github.com/go-sql-driver/mysql"
)
var (
dbConn *sql.DB
err error
)
func init() {
dbConn, err = sql.Open("mysql", "kedacom:KedaMysql16#@tcp(139.196.90.101:3306)/video_server?charset=utf8")
if err != nil {
panic(err.Error())
}
}
|
4a64286eee2c3838f44390fe400d7e57be5881c3 | 05a3856ce305d48c03414d9de9ccf69a9a8b50f1 | samhug/ratchet_processors | /udt_reader.go | Go | go | 2,611 | no_license | package ratchet_processors
import (
"encoding/json"
"fmt"
"io"
"log"
"github.com/licaonfee/ratchet/data"
"github.com/licaonfee/ratchet/processors"
"github.com/licaonfee/ratchet/util"
"github.com/samhug/udt"
pb "github.com/cheggaaa/pb/v3"
)
// UdtReader connects to a UDT server via SSH and runs the specifie... |
3ee4d92fb8013135fcf120faf6559a8bbbe494ce | b18bd1bc1aa440f1608852bed1ab295206b6e6cc | kubemq-io/go-sdk-cookbook | /queues/multicast-mix/main.go | Go | go | 3,093 | permissive | package main
import (
"context"
"fmt"
"github.com/kubemq-io/kubemq-go"
"log"
"os"
"os/signal"
"syscall"
)
func main() {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
queuesClient, err := kubemq.NewQueuesClient(ctx,
kubemq.WithAddress("localhost", 50000),
kubemq.WithClientId("go-... |
5f2bf1135a8c6f490a5685681b8170f331e7713a | 02a06cbf50f94a0508f5ba7846680c52a70e62f0 | zxt2012bs/EasyFaaS | /pkg/funclet/command/command.go | Go | go | 1,922 | permissive | /*
* Copyright (c) 2020 Baidu, 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... |
81469e8ef6df714b988759d62d6fa10157bd7a55 | c8707e77601d645c51902ba9d23a0b113375999e | tannhauser9000/utils | /strings/util.go | Go | go | 464 | no_license | package strings;
func Split(src, sep string, dst *[]string, str_index *int) {
head := sep[0];
start := 0;
*str_index = 0;
n := len(*dst);
for i := 0; i + len(sep) <= len(src) && *str_index+1 < n; i++ {
if src[i] == head && (len(sep) == 1 || src[i:i+len(sep)] == sep) {
(*dst)[*str_index] = src[start... |
92e27f3a52fcd6cd121fa11bfbd374894d152ee4 | 534b6abb0750bf36adfe532daacf3be6875fe48a | sak0/cri-tools | /cmd/crictl/logs.go | Go | go | 11,299 | permissive | /*
Copyright 2017 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, ... |
3a92306f218971e1fbf17e79fdca348635e13629 | b8a0d442826e89d5a82f07f35f66213bd8f7519b | hklhai/kubevela | /pkg/features/controller_features.go | Go | go | 5,611 | permissive | /*
Copyright 2021 The KubeVela 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, softw... |
4ca375aa4d35fc8b631cc0dcfcce5b62250a0a76 | 7e307a3f0a7884d0c95c5cd914f94af3849443bc | Oberonus/patron | /component/http/v2/route_test.go | Go | go | 5,816 | permissive | package v2
import (
"errors"
"net/http"
"testing"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestNewRoute(t *testing.T) {
t.Parallel()
handler := func(http.ResponseWriter, *http.Request) {}
rateLimiting, err := WithRateLimiting(1, 1)
require.NoError(t, err)
type arg... |
456e5e8e26a578a0715c5181a9dbd4774820bbfc | 706c56d350613f32e19f56f9d5f60dc6194980e5 | bmeng/installer | /pkg/tfvars/alibabacloud/alibabacloud.go | Go | go | 3,603 | permissive | package alibabacloud
import (
"encoding/json"
"fmt"
alibabacloudprovider "github.com/AliyunContainerService/cluster-api-provider-alibabacloud/pkg/apis/alibabacloudprovider/v1beta1"
"github.com/openshift/installer/pkg/asset/ignition/bootstrap"
"github.com/openshift/installer/pkg/types"
"github.com/pkg/errors"
)
... |
bfcb238fd2b6959eddc4a371d71abc74eb2a49c1 | 141a08075461a82c68df2279af13e9a19e87a476 | Ross1503/vpp-agent | /plugins/linux/ifplugin/linuxcalls/dump_interface_linuxcalls.go | Go | go | 12,384 | permissive | // Copyright (c) 2018 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 app... |
9d2d3fbb0f12e1e2f32b30cbf7b0f4afcd3805a2 | b7693caee837f0bbf29fd1fbe408336d39a51c4f | vzlcn0/keys | /json/marshal_test.go | Go | go | 589 | permissive | package json_test
import (
"testing"
"github.com/keys-pub/keys/json"
"github.com/stretchr/testify/require"
)
func TestMarshal(t *testing.T) {
b, err := json.Marshal([]json.Value{
json.NewString("key1", "val1"),
json.NewInt("key2", 2),
})
require.NoError(t, err)
require.Equal(t, `{"key1":"val1","key2":2}`,... |
01a2b72f29193a5f72c86ed05da6a8466e269c65 | a855e9d9eb078108827cb4fa8a971325844d4d3c | allen-shaw/jvmgo | /.history/cmd/cmd_20210506235924.go | Go | go | 536 | no_license | package cmd
import (
"flag"
"fmt"
"os"
)
// java [-options] class [args...]
type Cmd struct {
HelpFlag bool
VersionFlag bool
CpOption string
Class string
Args []string
}
func ParseCmd() *Cmd {
cmd := &Cmd{}
flag.Usage = printUsage
flag.BoolVar(&cmd.HelpFlag, "help", false, "print help ... |
098bfe3f1cb83621c2e71433c76f994b9fe89a38 | 59cf9f0f1dd17d941c63076207a71d3f798f6898 | ghosh17/Go-Tutorial | /error_handling.go | Go | go | 491 | no_license | //Error handling in Go
package main
import "fmt"
import "math"
import "errors"
func main(){
//Return a error value when a negative number is passed to a square root function
var num float64
num=-3
result, err:= Sqrt(num)
if(err==nil){
fmt.Println("\nThe SQRT is ",result)
}else{
fmt.Println(err)
... |
df2ce855b69e60ffefd3e32ceeb3bb3400435b7d | 13e71810009750307dd99791a98c1e6565841a96 | cycloidio/tfdocs | /providers/powerstore/data-sources.go | Go | go | 2,529 | no_license | package powerstore
import (
"fmt"
"github.com/cycloidio/tfdocs/resource"
)
var (
DataSources = []*resource.Resource{
&resource.Resource{
Name: "",
Type: "powerstore_host",
Category: "Data Sources",
ShortDescription: `Host DataSource`,
Description: ``,
Keyw... |
caaa805c99b7f61df4ef64549602eb47ec43c4b9 | 740e30219d36f852d01469f2d3d7a07e78ef9ca6 | joe-elliott/opentelemetry-collector | /receiver/fluentforwardreceiver/conversion_test.go | Go | go | 6,709 | 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... |
09babfa19f8fd0b189265a8c899dffc55b5da7ff | 5bd9ab7af19b7744b164188948ff8af7072ee90c | gravitational/satellite | /vendor/github.com/gravitational/roundtrip/errors.go | Go | go | 1,919 | permissive | /*
Copyright 2015 Gravitational, 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, soft... |
7b2587677e1620e5a341d353bde492b97b0d76f5 | 3e2041fa142ea67456fbeff074c791b3086f64d3 | suyaoli/MyManager | /server/models/user/userloginao.go | Go | go | 1,405 | no_license | package user
import (
. "github.com/fishedee/language"
. "github.com/fishedee/web"
)
type UserLoginAoModel struct {
Model
UserAo UserAoModel
}
func (this *UserLoginAoModel) IsLogin() User {
sess, err := this.Session.SessionStart()
if err != nil {
panic("session启动失败")
}
defer sess.SessionRelease()
userId ... |
ac53f29e517a51bd0ec9ecb7726dad2f987afdf6 | 7a66317788f9bb90be0d3f9aba97b9df48c55717 | craiglpeters/kubeone | /pkg/util/config/cluster.go | Go | go | 5,062 | permissive | /*
Copyright 2019 The KubeOne 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... |
fa2f9b899802738a9dcee0a454db7876871a80dc | fe81ea2865412253ba6d227c0a80b884abc6a951 | isabella232/fs-repo-migrations | /ipfs-6-to-7/gx/ipfs/QmbBhyDKsY4mbY6xsKt3qu9Y7FPvMJ6qbD8AMjYYvPRw1g/goleveldb/leveldb/iterator/array_iter.go | Go | go | 3,508 | permissive | // Copyright (c) 2014, Suryandaru Triandana <syndtr@gmail.com>
// All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package iterator
import (
"github.com/ipfs/fs-repo-migrations/ipfs-6-to-7/gx/ipfs/QmbBhyDKsY4mbY6xsKt3qu9Y7FPvMJ6qbD8AMjYYv... |
dc9e33e5258a5358716f164f58e66688c8599966 | 01b2ef6dad4ab424e65ea210fbf9f64da19080df | luckispac/kustomize | /kyaml/yaml/rnode.go | Go | go | 34,748 | permissive | // Copyright 2019 The Kubernetes Authors.
// SPDX-License-Identifier: Apache-2.0
package yaml
import (
"encoding/json"
"fmt"
"log"
"os"
"regexp"
"strconv"
"strings"
"sigs.k8s.io/kustomize/kyaml/errors"
"sigs.k8s.io/kustomize/kyaml/internal/forked/github.com/go-yaml/yaml"
"sigs.k8s.io/kustomize/kyaml/sliceu... |
cc571adcd4e01ab43f0cb7fef0a6a9af50996dd2 | 047f26d03cbc77a3865084f1ab0729a356ad7af8 | YWak/atcoder | /submissions/others/EDPC/D/main.go | Go | go | 1,324 | permissive | package main
import (
"bufio"
"fmt"
"os"
"strconv"
)
func main() {
N := nextInt()
W := nextInt64()
weights := make([]int64, N+1)
values := make([]int64, N+1)
dp := make([][]int64, N+1)
for i := 0; i < N; i++ {
weights[i] = nextInt64()
values[i] = nextInt64()
... |
2b19f7ec40bf4a3bcf1df18cb97df371831beab1 | 6358c6119f50ef2c5e3cc6583714d25dcf93bccc | Duncaen/dhall-golang | /core/subst.go | Go | go | 8,014 | no_license | package core
import (
"fmt"
"reflect"
)
func subst(name string, replacement, t Term) Term {
return substAtLevel(0, name, replacement, t)
}
func substAtLevel(i int, name string, replacement, t Term) Term {
switch t := t.(type) {
case Universe:
return t
case Builtin:
return t
case Var:
if t.Name == name &... |
0686dedb6a661ca3e229ccb891652e2c9dd2b676 | 9121fa45069b6d49ec5c5e7f8427a4592f9ea6ce | operator-framework/operator-registry | /pkg/registry/helper_test.go | Go | go | 3,557 | permissive | package registry
import (
"testing"
"github.com/blang/semver/v4"
"github.com/stretchr/testify/require"
)
func TestBundleVersionCompare(t *testing.T) {
type fields struct {
version string
}
type args struct {
version string
}
type order func(t *testing.T, val int)
var (
lt order = func(t *testing.T, v... |
88dee0ad4703e3674c1e36b483a4829e11b4a448 | 8cd3d63d0c3ab47b613386ecba5bfedd1ec20cac | lifei6671/filesystem | /filer.go | Go | go | 1,137 | permissive | package filesystem
import (
"io"
"time"
"os"
)
type Values map[string]interface{}
type Filer interface {
Exist(path string) error
Read(path string) ([]byte,error)
ReadStream(path string) (io.Reader,error)
ListContents(dir string,recursive bool) ([]os.FileInfo,error)
GetMetadata(path string) (os.FileInfo,erro... |
e0a9b8643670c271b75d13042d42f3d27b550cb6 | 7ce6aebf01f310f49c7cdc0699358e893761cee3 | Mortim-Portim/TN_Engine | /TNE/world.go | Go | go | 7,793 | no_license | package TNE
import (
"fmt"
"math"
"time"
"github.com/mortim-portim/GraphEng/GE"
)
/**
TODO
save world with worldstruct, entities, players
**/
type WorldParams struct {
ChunkUpdateRange int
Ef *EntityFactory
FrameCounter *int
Struct *GE.WorldStructure
}
//
func GetWorld(wp *World... |
08b1b5b593ade84963698eef603db9081702046a | 213f2d136653e0097c22e8bd9fe82728409041d6 | justinEtalenter/networking-course-project | /backend/pkg/builders/tasks.go | Go | go | 955 | permissive | package builders
import (
"github.com/architectv/networking-course-project/backend/pkg/models"
)
type TaskBuilder struct {
Task *models.Task
}
func NewTaskBuilder() *TaskBuilder {
task := &models.Task{
ListId: 1,
Title: "Default List Title",
Description: "Default List Desription",
Position: ... |
21415d89ff7fd4b1599b0f12fd6fdca5b1fbd776 | d35158d73bcd7165e895a2d65d3c7e69073f3221 | apirator/apirator | /internal/usecase/ingress.go | Go | go | 2,147 | permissive | // Copyright 2020 apirator.io
//
// 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... |
b1555b6ec71716056c92928639724a97538ab54e | a66fc44016b2872e08e7907560be5a7aea5f4c32 | bangarangler/go-rest-api | /model.go | Go | go | 1,470 | no_license | package main
import (
"database/sql"
// "errors"
)
type product struct {
ID int `json:"id"`
Name string `json:"name"`
Price float64 `json:"price"`
}
func (p *product) getProduct(db *sql.DB) error {
return db.QueryRow("SELECT name, price FROM products WHERE id=$1",
p.ID).Scan(&p.Name, &p.Price)
// r... |
5b8d400513a53892817c7da8e7531e6a2800e78e | b0db7ef2ef72eeb5a1f6236a78ef93013f0102cc | Julusian/go-twitch | /twitchapi/search_test.go | Go | go | 761 | permissive | package twitchapi
import (
"testing"
"github.com/julusian/go-twitch/twitch"
)
func TestSearchChannels(t *testing.T) {
tc := newTestClient(t)
opt := &twitch.ListOptions{
Limit: 1,
Offset: 0,
}
_, err := tc.Search.Channels("Star", opt)
if err != nil {
t.Errorf("error not nil: %+v", err)
}
}
func Test... |
821a156777c15beac69749f770f7f6f3c9579bd4 | 9602050b7af566642a5f1da87734bdc013e1a8d0 | bg451/opentracing-go | /tracer.go | Go | go | 3,272 | permissive | package opentracing
import "time"
// Tracer is a simple, thin interface for Span creation.
//
// A straightforward implementation is available via the
// `opentracing/basictracer` package's `standardtracer.New()'.
type Tracer interface {
// Create, start, and return a new Span with the given `operationName`, all
//... |
07d6d98be6e1d68e32a818645cce546001821fa8 | caae8fd810b25f350e52816a8a68c4ffea3ec87c | cgebe/gocryptotrader | /exchanges/btcmarkets/btcmarkets.go | Go | go | 11,812 | permissive | package btcmarkets
import (
"bytes"
"errors"
"fmt"
"log"
"net/url"
"time"
"github.com/cgebe/gocryptotrader/common"
"github.com/cgebe/gocryptotrader/config"
"github.com/cgebe/gocryptotrader/exchanges"
"github.com/cgebe/gocryptotrader/exchanges/ticker"
)
const (
btcMarketsAPIURL = "https://api.bt... |
073ee6586d7a58f6325ec2eed738a16d40d91ee5 | 459bf8e5435b063b9ba7ebe0485b44720f109866 | golang-design/under-the-hood | /gosrc/runtime/timestub.go | Go | go | 497 | permissive | // Copyright 2017 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.
// Declarations for operating systems implementing time.now
// indirectly, in terms of walltime and nanotime assembly.
// +build !windows
package runtime
imp... |
cd7fc63370a0a30b9c000faff794fe10f8fca99b | 6b4cb7a48502149268ab5d3615010b43259caba7 | Gfloresechaiz/lnd | /server.go | Go | go | 96,456 | permissive | package main
import (
"bytes"
"context"
"crypto/rand"
"encoding/hex"
"fmt"
"image/color"
"math/big"
"net"
"path/filepath"
"regexp"
"runtime"
"strconv"
"sync"
"sync/atomic"
"time"
"github.com/btcsuite/btcd/btcec"
"github.com/btcsuite/btcd/chaincfg/chainhash"
"github.com/btcsuite/btcd/connmgr"
"githu... |
3edc7d391d5fd0dd79945363cf62d1172c293f38 | b55d23d52d629dabb6859c199668931b0fb1f159 | microsoftgraph/msgraph-beta-sdk-go | /models/managedtenants/device_app_performance_collection_response.go | Go | go | 4,128 | permissive | package managedtenants
import (
i878a80d2330e89d26896388a3f487eef27b0a0e6c010c493bf80be1452208f91 "github.com/microsoft/kiota-abstractions-go/serialization"
ie233ee762e29b4ba6970aa2a2efce4b7fde11697ca9ea81099d0f8269309c1be "github.com/microsoftgraph/msgraph-beta-sdk-go/models"
)
// DeviceAppPerformanceCollect... |
1257f970244fe79e5807f6d88690e7626fbfb4ef | c3374e3f9cd6e0de96008fa97d6673d0743aebe1 | qinFamily/go-admin-demo | /workflow-engine/model/ACT_HI_PROCINST.go | Go | go | 6,610 | permissive | package model
import (
"go-admin-demo/database"
"strings"
"sync"
"github.com/jinzhu/gorm"
)
// ProcInst 流程实例
type ProcInst struct {
Model
// 流程定义ID
ProcDefID int `json:"procDefId"`
// 流程定义名
ProcDefName string `json:"procDefName"`
// title 标题
Title string `json:"title"`
// 用户部门
Department string `json:"d... |
4704241b1943decf393329708e033bc35984423f | 1fb9ea6c76d8cfb589451df8ba4df4b241d1a14e | slns/banking-auth | /domain/user.go | Go | go | 271 | no_license | package domain
import "database/sql"
type User struct {
Username string `db:"username"`
Password string `db:"password"`
Role string `db:"role"`
CustomerId sql.NullString `db:"customer_id"`
CreatedOn sql.NullString `db:"created_on"`
} |
c6ddf506e8ab2f012cd1d59255d61a5aa1928cda | cd73cce631f75054717e093835a3672ff760f158 | jskelcy/interviews | /partition-list/main.go | Go | go | 1,281 | no_license | package main
import (
"fmt"
intlist "github.com/jskelcy/interview/linked-list/int-list"
)
func main() {
head := intlist.MakeList([]int{3, 5, 8, 5, 10, 2, 1})
head = partitionList(head, 5)
print(head)
}
func print(head *intlist.Node) {
printString := []int{}
printRunner := head
for printRunner != nil {
pr... |
5b55940b10ec9faa2e7faa4b725c09c85aafca52 | 08b448de5c2c7d7818c1a51499a3ac5b899b643c | rancher/rancher | /pkg/controllers/dashboard/clusterregistrationtoken/clusterregistrationtoken.go | Go | go | 2,110 | permissive | package clusterregistrationtoken
import (
"context"
v3 "github.com/rancher/rancher/pkg/apis/management.cattle.io/v3"
v32 "github.com/rancher/rancher/pkg/generated/controllers/management.cattle.io/v3"
"github.com/rancher/rancher/pkg/wrangler"
"github.com/rancher/wrangler/pkg/randomtoken"
"k8s.io/apimachinery/pkg... |
4c40652da5f1b6c7ee56c7ca09fd17dfcffcde0d | dee68391503e5b45466ec329c18bfd4ecea8b32b | Bernabe30/sd | /logistica/server.go | Go | go | 1,589 | no_license | package main
import (
"os"
"log"
"encoding/csv"
"fmt"
"net"
"github.com/nchcl/sd/chat"
"google.golang.org/grpc"
)
func main() {
fmt.Println("Server on")
lis, err := net.Listen("tcp", ":9000")
if err != nil {
log.Fatalf("failed to listen: %v", err)
}
writeCSV()
//var seguimiento *... |
eedde54e40dd3149fa421936039ebf6a185f54a4 | 6625d3be0884f98dae23aab5d570a0af0a518759 | singcl/goo | /advanced/14.1_goroutine1.go | Go | go | 541 | no_license | package main
import (
"fmt"
"time"
)
func main() {
fmt.Println("In main()")
go longWait()
go shortWait()
fmt.Println("About to sleep in main()")
// sleep works with a Duration in nanoseconds (ns) !
time.Sleep(10 * 1e9)
fmt.Println("At the end of main()")
}
func longWait() {
fmt.Println("Beginnint longWait(... |
52b773ca69effa81544ec50dd25d19cae137c38c | 72991176f1f09d3cf1cf4ce0a53120934120bf3b | fossabot/go-cf-helloworld | /main.go | Go | go | 595 | permissive | package main
import (
"encoding/json"
"fmt"
"log"
"net/http"
)
type Greeting struct {
Language string `json:"language"`
Content string `json:"content"`
}
func templateGreeting(s string) string {
if s == "" {
s = "World"
}
return fmt.Sprintf("Hello, %s!", s)
}
func handler(w http.ResponseWriter, r *http.... |
d14cf88e5a3fbcc2dd2dc6fd1b225d295e02b1db | e24766b685cb906eb09db7661b7c177e142aff3b | cpg1111/spawnd | /config/config.go | Go | go | 1,548 | permissive | package config
import (
"fmt"
"io/ioutil"
"github.com/BurntSushi/toml"
)
type ConnServer interface {
Addr() string
Type() string
}
type UnixServer struct {
ConnServer
Path string
User string
PWD string
Owner string
Group string
Mode uint
}
func (u UnixServer) Addr() string {
return u.Path
}
func... |
e69b368ea88068611aac76c9407bac17ef7e0529 | 5c2dfaa05d4519b48a37a6e7df5ebfce77ae5a82 | slpcat/docker-images | /kafka/kafka-operator-krallistic/kube/kube.go | Go | go | 1,548 | permissive | package kube
import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
k8sclient "k8s.io/client-go/kubernetes"
"k8s.io/client-go/rest"
"k8s.io/client-go/tools/clientcmd"
log "github.com/Sirupsen/logrus"
)
var (
logger = log.WithFields(log.Fields{
"package": "kube",
})
)
type Kubernetes struct {
Client ... |
eca09036731946d05a2210293b2174817225af66 | 7fe59d7f231dc4c8e1715b3ccb52b6b3ac4dc9ce | goplus/gop | /cl/func_type_and_var.go | Go | go | 11,061 | permissive | /*
* Copyright (c) 2021 The GoPlus Authors (goplus.org). 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
*
* U... |
390767c22704c77b7c9bec361d6e6c4cc7faa5de | 8b669eb3d176df04b6dc35f6adbc901481d9971d | Xelinor/oci-go-sdk | /applicationmigration/ocic_source_details.go | Go | go | 1,434 | permissive | // Copyright (c) 2016, 2018, 2020, 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... |
44c4cd168977be11785547e944908156f4dc6a2b | d84d00dae9a31c6caa12687cab2fb32fcd5fd5ae | tidepool-org/oapi-codegen | /examples/petstore-expanded/chi/petstore_test.go | Go | go | 4,012 | permissive | package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"net/http/httptest"
"testing"
"github.com/stretchr/testify/assert"
"github.com/tidepool-org/oapi-codegen/examples/petstore-expanded/chi/api"
)
func DoJson(handler http.Handler, method string, url string, body interface{}) *httptest.ResponseRecor... |
584cbd1976323d7eafbe191773748f01d1273b18 | a4928673ada758c74bfcc90a79247df45e2151f9 | tony0408/gored | /exchange/bibox/api.go | Go | go | 16,145 | permissive | package bibox
// Copyright (c) 2015-2019 Bitontop Technologies Inc.
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"strconv"
"strings"
"time"
"github.com/bi... |
e2879ef8522bb555f24a7f95749d32cdb1c96464 | d97a285929159d356210ccf04a0bbc094a89f779 | amit-pandia/pcc-blackbox | /lib/notification.go | Go | go | 540 | no_license | // Copyright © 2020 Platina Systems, Inc. All rights reserved.
// Use of this source code is governed by the GPL-2 license described in the
// LICENSE file.
package pcc
import (
"fmt"
"github.com/platinasystems/tiles/pccserver/models"
)
type Notification struct {
models.Notification
}
func (p *PccClient) GetNot... |
7d816c0de6b2a33060ae130efc0e67e4fb3ad371 | 77da46867e0b3dc453269019ca39186c0a573084 | zhaobzh/couper | /config/endpoint.go | Go | go | 1,303 | permissive | package config
import (
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/hcl/v2/gohcl"
"github.com/avenga/couper/config/meta"
)
var _ Inline = &Endpoint{}
// Endpoint represents the <Endpoint> object.
type Endpoint struct {
AccessControl []string `hcl:"access_control,optional"`
DisableAccessControl ... |
6cb1ed0a9b1f177ff2b3e3954c8764a9a521d078 | 49bf14fe5cf96124079779d7608ff537e38febc7 | hellodoctordev/common | /oauth/google.go | Go | go | 4,165 | no_license | package oauth
import (
"cloud.google.com/go/firestore"
"context"
"fmt"
"github.com/hellodoctordev/common/constants"
"github.com/hellodoctordev/common/firebase"
"github.com/hellodoctordev/common/keys"
"github.com/hellodoctordev/common/logging"
"golang.org/x/oauth2"
"google.golang.org/api/iterator"
"log"
"net... |
a1eef7d2a645b2934bf48347e0180f8ea1c797e8 | 254a379bfe7f9178a36770994aa9003b0ca5fc48 | dajunx/go_test | /src/workScript/doExecuteHttpConsoleCMD.go | Go | go | 3,739 | no_license | package fileManage
import (
"fmt"
"strings"
"github.com/PuerkitoBio/goquery"
"io"
"compress/gzip"
"io/ioutil"
"net/http"
"strconv"
)
func WebGetAction(url string) []byte {
client := &http.Client{
CheckRedirect: nil,
}
reqest, _ := http.NewRequest("GET", url, nil)
reqest.Header.Set("User-Agent", " Mozi... |
807fb5070a049e30bdf3bd5c67ff35070a5aa3d7 | eafcf6b0923a8098164a787158978dbcd9f9a8eb | SchweizerischeBundesbahnen/gotc | /identity/v3/agencies/requests.go | Go | go | 3,485 | no_license | package agencies
import (
"github.com/gophercloud/gophercloud"
"github.com/gophercloud/gophercloud/openstack"
"github.com/gophercloud/gophercloud/openstack/identity/v3/tokens"
"log"
)
func GetProvider(opts gophercloud.AuthOptions) (*gophercloud.ProviderClient, error) {
return openstack.AuthenticatedClient(opts)
... |
59b2435cb8a8e61d3a122af8c239f966578183b9 | 9a09267392da60309d54c6d4c00c0f0d18787585 | crscillitoe/sourcegraph | /internal/vcs/git/diff_search_test.go | Go | go | 7,746 | permissive | package git
import (
"context"
"reflect"
"strings"
"testing"
"time"
"github.com/google/go-cmp/cmp"
"github.com/sourcegraph/sourcegraph/internal/api"
"github.com/sourcegraph/sourcegraph/internal/gitserver"
)
func TestRepository_RawLogDiffSearch(t *testing.T) {
t.Parallel()
expiredCtx, cancel := context.Wit... |
aebefcaf3e6be8f34ececc26e193545cf04853dd | cdf3a20497121d997f9aad8f2c93765fa1d89266 | PenguinLeee/Lattigo_genotype_imputation | /prediction/lib/utils.go | Go | go | 6,265 | no_license | package lib
import (
"encoding/binary"
"encoding/csv"
"errors"
"fmt"
"github.com/ldsec/lattigo/v2/ckks"
"github.com/ldsec/lattigo/v2/ring"
"io"
"log"
"math"
"os"
"runtime"
"strings"
)
// NbrBatchAndLastBatchSize computes dimPatients/nbrPatientsBatch and dimPatients%nbrPatientsBatch
func NbrBatchAndLastBat... |
f68fd70d33b4819d6f21c6c2e52af43873da135c | 2e5862e688880a6b467fb3e256d29634ebd44979 | kevinburke/go-1 | /exp/ingest/single_ledger_session.go | Go | go | 1,878 | permissive | package ingest
import (
"github.com/stellar/go/exp/ingest/adapters"
"github.com/stellar/go/exp/ingest/io"
"github.com/stellar/go/support/errors"
)
var _ Session = &SingleLedgerSession{}
func (s *SingleLedgerSession) Run() error {
s.setRunningState(true)
defer s.setRunningState(false)
s.shutdown = make(chan boo... |
9b8486b8ab67d83d4c9e5e9a7ed2e4141c8bf8d7 | 52cf2b39c1eb50af177a1659e3fb401d372e4a54 | allanperlee/portfolio | /23.go | Go | go | 773 | no_license | package main
import(
"fmt"
)
func isAbundant(natural int) bool {
var counter int = 1
for i := 2; i < natural; i++ {
if natural % i == 0 {
counter += i
}
}
return counter > natural
}
func main (){
var abundants[]int
var limit int = 28123
var counter int = 0
var isSumOfTwoAbundants[28124]bool
for ... |
fad76798df4c37d78ef6f42777330b38e2baa6e0 | 96685090fc23fd3d7aaa0c54f3b9de317542031c | jollyjerr/algorithms-specialization-notebook | /course1/week1/mergesort/mergesort_test.go | Go | go | 545 | no_license | package main
import "testing"
func TestBaseCase(t *testing.T) {
if res := mergeSort([]int{1}); !equal(res, []int{1}) {
t.Error()
}
}
func TestSimpleCase(t *testing.T) {
if res := mergeSort([]int{4, 6, 5}); !equal(res, []int{4, 5, 6}) {
t.Error()
}
}
func TestEdgeCase(t *testing.T) {
if res := mergeSort([]i... |
a01c00c4d22b51a8c06714848c14752d2d1ffee3 | 878fcaa8ca3404687bea35e4c64b17b7ab95a30a | kornel661/nserv | /serve_test.go | Go | go | 2,233 | permissive | package nserv_test
import (
"crypto/tls"
"fmt"
"gopkg.in/kornel661/nserv.v0"
"html"
"io/ioutil"
"net/http"
"testing"
)
// TestServerStop checks if stopping the server works.
func TestServerStop(t *testing.T) {
srv := newServer()
finish := make(chan struct{})
go func() {
if !srv.Stop() {
t.Error("We did... |
34e2a2bfb3c1d6bae76279bb265c5937640d72fb | 7c74f3d57735f949c33bc015890c399821369c4d | pepipost/pepipost-sdk-go | /vendor/github.com/apimatic/form/form.go | Go | go | 316 | permissive | // Copyright 2014 Alvaro J. Genial. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Package form implements encoding and decoding of application/x-www-form-urlencoded data.
package form
const (
implicitKey = "_"
omittedKey = "-"
)
|
cb0a4076c53735b66e99bc2c6c4ac71522337f2a | 43611013904426fdcbb6e0489bee71c53d9e3f05 | Carlangueitor/pulumi-kubernetes | /sdk/go/kubernetes/discovery/v1beta1/endpointSliceList.go | Go | go | 6,358 | permissive | // *** WARNING: this file was generated by pulumigen. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v1beta1
import (
"reflect"
"github.com/pkg/errors"
metav1 "github.com/pulumi/pulumi-kubernetes/sdk/v2/go/kubernetes/meta/v1"
"github.com/pulumi/pulumi/sdk/v2/go/pulu... |
d6750f36d7c4e02bffb55cbe548b2453fc283ac8 | 62ba8a4e7f5f5b857d56b8ea082e0c627ab12d67 | suclogger/go-jvm | /ch03/classfile/class_file.go | Go | go | 2,798 | no_license | package classfile
import (
"fmt"
)
type ClassFile struct {
// magic uint32
minorVersion uint16
majorVersion uint16
constantPool ConstantPool
accessFlags uint16
thisClass uint16
superClass uint16
interfaces []uint16
fields []*MemberInfo
methods []*MemberInfo
attributes []AttributeInfo
}
func Parse(classDat... |
56e6ba198af25fb521186b0fa2a040a6b10c7dcd | 0d33d18468fdc8681ec08edff1e44642ed66151f | defconcepts/weave | /nameserver/nameserver.go | Go | go | 6,501 | permissive | package nameserver
import (
"fmt"
"sync"
"time"
"github.com/miekg/dns"
. "github.com/weaveworks/weave/common"
"github.com/weaveworks/weave/mesh"
"github.com/weaveworks/weave/net/address"
)
const (
// Tombstones do not need to survive long periods of peer disconnection, as
// we delete entries for disconnec... |
2d411a30cdea4ca666ec34647342d9598254b4da | b15d63d483496ee1291abfd78c9ef1c5be8f5272 | a20351766/mchain1.2 | /common/ledger/blkstorage/fsblkstorage/blockindex.go | Go | go | 13,257 | 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 agreed to in wri... |
cad12b23fc64168fbac2eaa9d31e51a897807b23 | b20915dc52e61acf3e2eb770a3e2cc2ab7648475 | super-rain/istio | /tests/integration/security/authn/permissive/permissive_test.go | Go | go | 5,009 | permissive | // Copyright 2019 Istio Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
4b3cb1a9561a646417a13e1516795663f530779d | 1111feb8537435ae8055db656baa673abf2b0dcd | you1996/zitadel | /internal/repository/project/application.go | Go | go | 6,439 | permissive | package project
import (
"context"
"encoding/json"
"fmt"
"github.com/caos/zitadel/internal/eventstore"
"github.com/caos/zitadel/internal/errors"
"github.com/caos/zitadel/internal/eventstore/repository"
)
const (
UniqueAppNameType = "appname"
applicationEventTypePrefix = projectEventTypePrefix + "app... |
36b8f29dc66da898bb650a43278655328010e408 | acdf98d3cbc1b9ae9490ff108db02845bd45895a | bdshadow/kubernetes-client-android | /kubernetes-model/vendor/k8s.io/kubernetes/pkg/util/net/sets/ipnet_test.go | Go | go | 4,117 | 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... |
ae606dbf7c0a63528de842f93ee1078202a51f86 | 2a2d09e16d6e8b5abd1d0100f920f4c60aa34b16 | gappelgren/cortex | /pkg/lib/aws/errors.go | Go | go | 2,483 | permissive | /*
Copyright 2019 Cortex Labs, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softwa... |
54c9532047e45ec698fbd98037827fea4cd54bfc | 2ab8430d66f7d11f3554ea6e158c4a883ea4c81f | EmoinLanyu/gardener | /pkg/resourcemanager/controller/secret/add.go | Go | go | 4,090 | permissive | // Copyright (c) 2020 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 Lice... |
e99d022f47337584fba8a57b1bf4da04d2654580 | 2b6207ed1d283c641ebe71b7ba4f5e17eb0a1aba | davidgood/garagepi | /middleware/chain.go | Go | go | 279 | permissive | package middleware
import "net/http"
type Chain []Middleware
func (mc Chain) Wrap(next http.Handler) http.Handler {
var chain = next
middlewareCount := len(mc)
for i := middlewareCount - 1; i >= 0; i-- { // iterate backwards
chain = mc[i].Wrap(chain)
}
return chain
}
|
4116488a70474751a0ffce62db730183ea61ea8e | 998c636957d5b289df0595c1e65306b131520a41 | Datera/datera-csi | /pkg/driver/driver_sanity_test.go | Go | go | 791 | no_license | package driver
import (
"os"
"testing"
sanity "github.com/kubernetes-csi/csi-test/pkg/sanity"
udc "github.com/Datera/go-udc/pkg/udc"
)
const (
Endpoint = "unix:///tmp/test-csi.sock"
)
func getDriver(t *testing.T) *Driver {
conf, err := udc.GetConfig()
if err != nil {
t.Fatal(err)
}
if err = os.Setenv(En... |
05128c9034e4c8fe487ae46e2b08df8470302339 | 1df0b13ae310e325a3a99a37140cc6fcc0ebfe93 | ilyaglow/drw | /distinct_writer.go | Go | go | 929 | permissive | package drw
import (
"bytes"
"io"
)
// Writer that supposed to wrap original writer and write distinct values.
type Writer struct {
*Opts
OriginalWriter io.Writer
}
// NewWriter represents a distinct writer initializer.
func NewWriter(w io.Writer, delim byte, cache Cache) io.Writer {
return &Writer{
Opts: &Op... |
e9a6ee07ca3bbe1bb36c31a88bcece50ffefc57c | 7e8b8c751201250804217ec27649815bc0c533a1 | BoxLinker/cicd | /vendor/github.com/BoxLinker/boxlinker-api/controller/models/registry/image.go | Go | go | 1,648 | no_license | package registry
import (
"time"
"github.com/go-xorm/xorm"
"github.com/satori/go.uuid"
)
type Image struct {
Id string `xorm:"pk"`
Namespace string `xorm:"UNIQUE(image) NOT NULL"`
Name string `xorm:"UNIQUE(image) NOT NULL"`
Tag string `xorm:"UNIQUE(image) NOT NULL"`
Size int64
Digest string `xorm:... |
11edfd2583a31e5dd677f91ca0211e5ddb4491eb | 0392b23dceff0e909e6df876d80f6b6fd6e0b68e | salvivona/chainlink-cosmos | /x/chainlink/types/coin.go | Go | go | 696 | permissive | // Copyright 2021 ChainSafe Systems
// SPDX-License-Identifier: MIT
package types
import (
sdk "github.com/cosmos/cosmos-sdk/types"
)
const (
// Chainlink token denom
LinkDenom string = "link"
)
// NewLinkCoin will create a "link" coin with the provided amount.
func NewLinkCoin(amount sdk.Int) sdk.Coin {
return... |
8cb0cd9dca1b0d7e9241c29f70e50eae141795db | e7c02230026cea95ba760489c610fc114df3eeb1 | kyon4sos/ims-go | /dao/menu.go | Go | go | 241 | no_license | package dao
import (
"img-server/model"
"log"
)
func GetAllMenus() []*model.Menu {
var menus []*model.Menu
res := GetDb().Find(&menus)
if res.Error != nil {
log.Println("menus err",res.Error.Error())
return nil
}
return menus
}
|
db2659e780bb52b62afc71bdd30d025993ac672b | 10bf7da8c278a6ef2e1a4e44ec75a8bc5fe5604e | helloyi/go-sshclient | /sshclient_test.go | Go | go | 16,158 | permissive | package sshclient
import (
"bufio"
"bytes"
"context"
"errors"
"fmt"
"io"
"io/ioutil"
"net"
"os"
"os/exec"
"path"
"sync"
"syscall"
"testing"
"time"
"unsafe"
"github.com/creack/pty"
"github.com/gliderlabs/ssh"
"github.com/pkg/sftp"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/r... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.