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 |
|---|---|---|---|---|---|---|---|---|
2ac7fe888d8be720e4f584ea95a62bba300d8659 | 27b66c6b47a1a7b4e99a07473669d590d8bbd2c7 | jmlucjav/framework | /modules/pipeline/model.go | Go | go | 2,752 | permissive | /*
Copyright Medcl (m AT medcl.net)
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, softwar... |
5c84361f4e5b318d4571f2c19f29ffdbfefeee4c | 3b8a4464d1358afc21a84ddc1f2333be7002ba24 | glyn/garden-linux | /Godeps/_workspace/src/github.com/tedsuo/ifrit/grouper/parallel_test.go | Go | go | 5,259 | permissive | package grouper_test
import (
"errors"
"os"
"syscall"
"time"
"github.com/tedsuo/ifrit"
"github.com/tedsuo/ifrit/fake_runner"
"github.com/tedsuo/ifrit/grouper"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Parallel Group", func() {
var (
started chan struct{}
groupRunner i... |
78f70e4ab612839164d4336c9d82636b87bb0114 | 665898dabaa3ef2ad44fadeca28b3f2fe44efee1 | vincent-pli/manifestival | /sources/path_test.go | Go | go | 3,474 | permissive | package sources_test
import (
"os"
"path/filepath"
"testing"
. "github.com/manifestival/manifestival/sources"
)
func TestParsing(t *testing.T) {
tests := []struct {
name string
path string
recursive bool
want []string
wantError bool
}{{
name: "single directory",
path: "../testdata/... |
c4c0c5bd655be80c5de1851e88232781d35b5bf0 | d3593b894173bf4cd383b7ccaba802cc8e97091a | dabio/staticdrop | /oauth2/oauth2_test.go | Go | go | 2,697 | permissive | package oauth2_test
import (
"fmt"
"net/http"
"net/http/httptest"
"path/filepath"
"reflect"
"runtime"
"testing"
"github.com/dabio/staticdrop/oauth2"
)
const (
clientID = "CLIENT_ID"
clientSecret = "CLIENT_SECRET"
redirectURL = "REDIRECT_URL"
)
func config(url string) *oauth2.Config {
return &oauth2... |
8d3c253b22e15d9f455284c310a2d342c62e144e | 1ef2322ee4513c5bbc560716d8cd809da643b61a | julz/eventing-kafka | /pkg/controller/kafkasecret/reconciler_test.go | Go | go | 7,633 | permissive | package kafkasecret
import (
"context"
"testing"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/client-go/kubernetes/scheme"
clientgotesting "k8s.io/client-go/testing"
kafkav1beta1 "knative.dev/eventing-contrib/kafka/channel/pkg/apis/messaging/v1beta1"
fakekafkaclient "knative.dev/event... |
a193581c43349b5bb2bafa7827e1c295ecc3c201 | 0a04ba2d813a21686ab65b22674e1f4ee5907c54 | enaml-ops/ert-plugin | /enaml-gen/loggregator_trafficcontroller/loggregator.go | Go | go | 543 | permissive | package loggregator_trafficcontroller
/*
* File Generated by enaml generator
* !!! Please do not edit this file !!!
*/
type Loggregator struct {
/*Etcd - Descr: Number of concurrent requests to ETCD Default: 10
*/
Etcd *LoggregatorEtcd `yaml:"etcd,omitempty"`
/*DopplerPort - Descr: DEPRECATED Default: 8081
*/
Do... |
187144353b26fa9a6f2651f7468e4a7c17c29cc0 | 1c5d4829c137c6856c94eb5b02da247fa861b4c1 | ManiacMike/wechat-go | /wxweb/session.go | Go | go | 16,574 | permissive | /*
Copyright 2017 wechat-go Authors. All Rights Reserved.
MIT License
Copyright (c) 2017
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the right... |
df73a0112ec9678278945d0f85db77de7b6a238a | dcdba8a4118c5eb25e4b988698d8e7b933ad95f9 | amithk/indexing | /secondary/common/timestamp.go | Go | go | 10,003 | permissive | // defines timestamp types to interface with go-coubhbase and also provides
// functions for set-operations on time-stamps.
package common
import "github.com/couchbase/indexing/secondary/logging"
import "bytes"
import "fmt"
import "sync"
// TsVb is logical clock for a subset of vbuckets.
type TsVb struct {
Bucket s... |
53ed654628f4817cee668042c8f3ed97c20fa1e1 | 92fbc4906a9a87719824f407e40c0dc99574b806 | qinshulei/skia-buildbot | /golden/go/search/utils_test.go | Go | go | 5,301 | permissive | package search
import (
"bytes"
"context"
"encoding/json"
"math/rand"
"os"
"sort"
"testing"
"time"
assert "github.com/stretchr/testify/require"
"go.skia.org/infra/go/eventbus"
"go.skia.org/infra/go/gcs"
"go.skia.org/infra/go/tiling"
"go.skia.org/infra/go/util"
"go.skia.org/infra/golden/go/expstorage"
"... |
aa1046cf0a2adef05cfa5d102fda3e465998a939 | 255a9deea6909eb1219749c03b49f8cb7a36e854 | gophers-latam/ejemplos | /sample-testing_tests/sample-sub_test.go | Go | go | 360 | no_license | package main
import (
"fmt"
"strconv"
"testing"
)
var testData = []int{10, 11, 17, 10}
// go test -run TestSampleSub -v
func TestSampleSub(t *testing.T) {
expected := "10"
for _, val := range testData {
tc := val
t.Run(fmt.Sprintf("input = %d", tc), func(t *testing.T) { // sub test
if expected != strconv... |
a505c2d9a28438c847f31134d01c16a99e047755 | c7720b14e1af4ffdc320bf12333f7b20fef04152 | HenryNguyen5/chainlink | /core/chains/terra/chain_set.go | Go | go | 3,290 | permissive | package terra
import (
"context"
"github.com/pkg/errors"
"go.uber.org/multierr"
"github.com/smartcontractkit/sqlx"
"github.com/smartcontractkit/chainlink-terra/pkg/terra"
"github.com/smartcontractkit/chainlink-terra/pkg/terra/db"
"github.com/smartcontractkit/chainlink/core/chains"
"github.com/smartcontract... |
a6c8322f2e6d9eb77cce7cbcab36781840b4dfad | cb240d6bc3047f0c2d6250aa7c37c0d08aecfe5e | sourcegraph/graphql-go | /graphql_test.go | Go | go | 83,881 | permissive | package graphql_test
import (
"context"
"errors"
"fmt"
"sync"
"testing"
"time"
"github.com/graph-gophers/graphql-go"
gqlerrors "github.com/graph-gophers/graphql-go/errors"
"github.com/graph-gophers/graphql-go/example/starwars"
"github.com/graph-gophers/graphql-go/gqltesting"
"github.com/graph-gophers/graph... |
bc1dbcdfe89e6e5168555561b2bae9735c49691f | 4f7f33f81fb7c6731da6762c6f65bde26e890485 | msample/log2 | /log2.go | Go | go | 4,575 | permissive | // Log2 defines Debug, Info, Warn, Error and Audit structured logging
// functions whose implementations may be swapped atomically.
//
// Main purpose: provide a standard way for go packages to link to
// logging functions without restricting which logging implementation
// an app chooses to use (other than imposi... |
1c4d36364db0e822e2b09d0a5fe47992ec1dcb87 | d507df76eaa65028c0a2d5a95a659251b40f53c9 | AlekSi/test_db | /convert/mysql/sakila/category.go | Go | go | 280 | no_license | package sakila
import (
"time"
)
//go:generate reform
// Category represents a row in category table.
//reform:category
type Category struct {
CategoryID int8 `reform:"category_id,pk"`
Name string `reform:"name"`
LastUpdate time.Time `reform:"last_update"`
}
|
e95de27806975bb563eccd6856f364a90b5afa18 | fee6c4a303981db6b4cee832ed5d8b4a2e117fd6 | arijitnayak92/go-lang-projects | /Fruit/mock/validation.go | Go | go | 733 | no_license | package mock
import (
"github.com/arijitnayak92/taskAfford/Fruit/validation"
"github.com/gin-gonic/gin"
"github.com/stretchr/testify/mock"
)
// Validation ...
type Validation struct {
mock.Mock
}
// NewValidation ...
func NewValidation() *Validation {
return &Validation{}
}
// SignUpValidation ...
func (mock *... |
07bf563945b6239c7dccb437d96c0acb81f645e9 | 4228349219b9ed74ea66670180bd333a3fb2ecc8 | nicknailers69/wizechain | /app/app.go | Go | go | 24,074 | no_license | package app
import (
"io"
"os"
"path/filepath"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/codec/types"
"github.com/spf13/cast"
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmos "github.com/tendermint/tendermint/libs/os"
dbm "github.... |
df898262a11ded3edf70ca386162d022a13f1c0a | 55239d267072ae12a80b7b66acc63af7784c4071 | cassava/cot | /pathutil/path.go | Go | go | 1,758 | no_license | package pathutil
import (
"path/filepath"
"strings"
"unicode/utf8"
)
// Split splits a string by path separator and returns a splice
// of path parts.
func Split(path string) []string {
return strings.FieldsFunc(path, func(r rune) bool {
return r == filepath.Separator
})
}
// Translate prefix takes a prefix a... |
e5654c38843502a14e268f6482bdb8a2034c015c | 57ae7e892315e6abf63adf590cf63f8674d92f15 | mei-rune/gofish | /client/redfish_v1/list_registry_responses.go | Go | go | 4,512 | permissive | package redfish_v1
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"fmt"
"io"
"github.com/go-openapi/runtime"
strfmt "github.com/go-openapi/strfmt"
"github.com/runner-mei/gofish/models"
)
// ListRegistryReader is a ... |
acbd02c5d155fd4d4994e34b9cf8ab76cbd5a9f1 | b04ab2e9081563ea0b79d31ccbb75c6d8b976255 | sfomuseum/go-cloud-blob-echo | /echo.go | Go | go | 1,250 | permissive | package echo
import (
"context"
"gocloud.dev/blob"
"io"
_ "log"
"net/url"
"os"
)
func Echo(ctx context.Context, from string, to string) (int64, error) {
var reader io.ReadCloser
var writer io.WriteCloser
switch from {
case "":
reader = os.Stdin
default:
u, err := url.Parse(from)
if err != nil {
... |
0b78fbd16166a7f2431dac5eba0072204d921cfd | a56e7fcdae70344732cc582db98f61988fbacb3d | chef/automate | /api/config/deployment/init_config_template.go | Go | go | 1,871 | permissive | package deployment
const configTemplate = `
# This is a default Chef Automate configuration file. You can run
# 'chef-automate deploy' with this config file and it should
# successfully create a new Chef Automate instance with default settings.
[global.v1]
# The external fully qualified domain name.
# When the ap... |
759276430f5f82171145af77ffd0b30384cd76ab | d97b4a7fef16a00c8a6cd2cbeca83daf32f207a4 | TheMightyGit/yaegi | /interp/interp.go | Go | go | 28,140 | permissive | package interp
import (
"bufio"
"context"
"errors"
"flag"
"fmt"
"go/build"
"go/scanner"
"go/token"
"io"
"io/ioutil"
"log"
"os"
"os/signal"
"path"
"path/filepath"
"reflect"
"runtime"
"runtime/debug"
"strconv"
"strings"
"sync"
"sync/atomic"
)
// Interpreter node structure for AST and CFG.
type nod... |
02aef596d3075afaeadd121942f357186dc904c2 | 76ca01f9a8b430506a735a5afb2c5af49a78c195 | snakelayer/discord-warframe-orokin-alerts | /dwf-bot.go | Go | go | 1,600 | permissive | package main
import (
"flag"
"os"
"os/signal"
"syscall"
"time"
"github.com/snakelayer/discord-warframe-orokin-alerts/discord"
"github.com/snakelayer/discord-warframe-orokin-alerts/worldstate"
log "github.com/sirupsen/logrus"
)
func main() {
var token string
var roleName string
var tts bool
var isDebug b... |
c71e7116866b97a547e2862bad7dfd5a2764b7ca | 786ef4c9123a77562946df1b859fed69811b90d3 | ChorusOne/Vitruvius | /pkg/oasis/inlet.go | Go | go | 5,242 | permissive | // Given some DB, we want to aggregate queries and bulk write them in groups of
// transactions at some arbitrary limit. We will define a global instance so we
// can call into this from any application without large modification of the
// source.
// --------------------------------------------------------------------... |
15f1f7a868c955dc03c14a6cfb11b3eaf471f26e | 8abe76d18f99fdbf3c1243c9dffd5602b274df1a | buybuyboy/micro-jxc | /jxc-base/model/ShopStorage.go | Go | go | 387 | no_license | package model
type ShopStorage struct {
Id int `json:"id" gorm:"column:id"`
ShopId string `json:"shop_id" gorm:"column:shop_id"`
StorageId string `json:"storage_id" gorm:"column:storage_id"`
Name string `json:"name" gorm:"column:name"`
Remark string `json:"remark" gorm:"column:remark"`
... |
baa0052fb3e1b333a5bf12e61a346ee62f5f46b0 | 0ad43afb0df2b1440c8867a26c13a00112f0102f | you1996/zitadel | /internal/domain/policy_login.go | Go | go | 1,133 | permissive | package domain
import "github.com/caos/zitadel/internal/eventstore/v1/models"
type LoginPolicy struct {
models.ObjectRoot
Default bool
AllowUsernamePassword bool
AllowRegister bool
AllowExternalIDP bool
IDPProviders []*IDPProvider
ForceMFA bool
SecondFactors ... |
ad9acd795a9877bb702e20c6446c131b961cc21f | 9d5d8635b5c2c895795c7eae667befb9e5919247 | made2591/go-algorithms | /sorting/common/util.go | Go | go | 552 | permissive | package common
import (
"math/rand"
"time"
)
func Sorted(vals []int) bool {
for i, n := range vals[:len(vals)-1] {
if n > vals[i+1] {
return false
}
}
return true
}
func Shuffle(vals []int) {
r := rand.New(rand.NewSource(time.Now().Unix()))
for len(vals) > 0 {
n := len(vals)
randIndex := r.Intn(n)
... |
cc70806bf14d4080480b946c540749df8d9f9ab8 | 4f221beb33ef069287e4649fcff74455f7fb1b67 | BigCybe/Coffee_Machine | /main/main.go | Go | go | 17,125 | no_license | package main
import (
"bufio"
"bytes"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"strconv"
"strings"
"time"
)
type Machine struct {
Milk int
Water int
Sugar int
Coffee int
Money int
}
type Coffee struct {
Coffee_type string
price int
need_milk int
need_water int
need_coffee int
}
func (u *Machine) Bu... |
66c8b708839355dd71fb559a237607c25ad6bddb | b451af64e7a8d025d3486aab1d666f6e49561a40 | xerenahmed/dragonfly | /server/block/bookshelf.go | Go | go | 624 | permissive | package block
import "github.com/df-mc/dragonfly/server/item"
// Bookshelf is a decorative block that primarily serves to enhance enchanting with an enchanting table.
type Bookshelf struct {
solid
bass
}
// BreakInfo ...
func (b Bookshelf) BreakInfo() BreakInfo {
return newBreakInfo(1.5, alwaysHarvestable, axeEff... |
97b65c31948fe198166e39adbf0a75e418dc1b75 | a1c40e10008013ec4de09d37f9a5879cdf977298 | chjlangzi/gophercloud | /openstack/networking/v2/networks/requests.go | Go | go | 5,515 | permissive | package networks
import (
"github.com/chjlangzi/gophercloud"
"github.com/chjlangzi/gophercloud/pagination"
)
// ListOptsBuilder allows extensions to add additional parameters to the
// List request.
type ListOptsBuilder interface {
ToNetworkListQuery() (string, error)
}
// ListOpts allows the filtering and sortin... |
8230c33b77cc74c39ed9afe8e8f1cd3d2265a7a3 | b0b9eba29021640b2e684d650bdd7d81c6edd540 | DevelHell/wildcard-processor | /wildcard_processor.go | Go | go | 1,909 | permissive | package wildcard_processor
import (
"path/filepath"
"strings"
"github.com/flashmob/go-guerrilla/backends"
"github.com/flashmob/go-guerrilla/mail"
"github.com/flashmob/go-guerrilla/response"
)
type WildcardConfig struct {
WildcardHosts string `json:"wildcard_hosts"`
}
type wildcard struct {
config *Wild... |
2995490abc9730343eb19f810bbeac278417c8a0 | 9b39009c60bdad8a172eff3834cef5e0cd02c4e8 | gdzy1987/slb | /least_busy_test.go | Go | go | 1,362 | permissive | package slb
import (
"container/heap"
"testing"
"github.com/stretchr/testify/require"
)
func TestLeastBusy_Dispatch(t *testing.T) {
testPool := newLeastBusy([]string{})
testPool.nodes = nodes{
{host: "localhost:9000", index: 0, pending: 7},
{host: "localhost:9002", index: 1, pending: 0},
{host: "localhost... |
94147083b54070cf8b71b58b86ef2d2e7453c1e0 | ef923486bfac3cd6b8d4bf453a1688796d54c27a | talibzaz/ox-master | /grpc/mail/client.go | Go | go | 3,150 | no_license | package mail
import (
"google.golang.org/grpc"
"github.com/graphicweave/ox/mail"
"context"
"github.com/spf13/viper"
"github.com/sirupsen/logrus"
)
/**
* Created by ♅ Salfi Farooq on 23/06/17.
*/
func _connect() (*grpc.ClientConn, error) {
if conn, err := grpc.Dial(viper.GetString("INJUN_GRPC_ADDR"), grpc.Wi... |
f4b6930915f7b96fc9e7a5e9e5c267092f2194bf | b6e043dace1d1ee8e2473d3a53ef9dee2d22511e | aleksic-nikola/XML-project | /BACKEND/auth-service/security/tokenizer.go | Go | go | 916 | no_license | package security
import (
"os"
"time"
jwt "github.com/dgrijalva/jwt-go"
"github.com/joho/godotenv"
)
// creates a token with the secret defined in the .env file
// returns a signed token
func GetToken(username string, role string) (string, error) {
godotenv.Load()
signingKey := []byte(os.Getenv("ACCESS_SECRET")... |
86fa2218a8c10f129747f5d0b7bef82f58bd5380 | c0d5ba6b3df5b9d723f0d4be5cca2391c0a8e16b | jgsqware/machine | /libmachine/provision/utils.go | Go | go | 6,192 | permissive | package provision
import (
"fmt"
"io/ioutil"
"net/url"
"path"
"path/filepath"
"regexp"
"strconv"
"strings"
"time"
"github.com/docker/machine/libmachine/auth"
"github.com/docker/machine/libmachine/cert"
"github.com/docker/machine/libmachine/log"
"github.com/docker/machine/libmachine/mcnutils"
"github.com... |
38e6ad99b20ba61c16bb312dc313f1394a9ed75d | c795f3c0a269f296d6762b4436df8ec0c80825dd | jerejones/jlog | /event/level.go | Go | go | 1,236 | permissive | package event
import (
"strings"
)
// Level indicates the severity of the log event
type Level int
const (
UnknownLevel Level = 1 << iota
// DebugLevel is used for debugging information. Executed queries, user authenticated, session expired
DebugLevel
// InfoLevel is used for informative purposes that are not ... |
d005f63cd4ca0d51456e94b867c1569b41179e95 | 4af2229da3eb91050dcc94524ca2b36f9a0eb702 | sandlbn/ndn-dpdk | /dpdk/cryptodev.go | Go | go | 7,433 | permissive | package dpdk
/*
#include "cryptodev.h"
*/
import "C"
import (
"errors"
"fmt"
"strings"
"unsafe"
)
// Crypto operation type.
type CryptoOpType int
const (
CRYPTO_OP_SYM CryptoOpType = C.RTE_CRYPTO_OP_TYPE_SYMMETRIC
)
func (t CryptoOpType) String() string {
switch t {
case CRYPTO_OP_SYM:
return "symmetric"
... |
c5d1dbfca8ebecf0a2416beca68c3868fcfac599 | 5101e7b482b2a1e9a610b35b609588d2dcaee8f5 | aliksend/integration_framework | /plugins/http_server/preparer.go | Go | go | 1,497 | no_license | package http_server
import (
"fmt"
"integration_framework/helper"
"integration_framework/plugins"
)
type IPrepare interface {
Prepare(serviceUrl string) error
}
func (s *Service) Preparer(params interface{}) (plugins.IServicePreparer, error) {
prepareYaml, ok := helper.IsYamlMap(params)
if !ok {
return nil, ... |
658a309677069b78c6f076383c2af8aa29de9787 | 3fef6c3ce8131d0e62b2d43f335c43ed27275280 | umitkavala/protoactor-go | /actor/pidset_test.go | Go | go | 2,019 | permissive | package actor
import (
"strconv"
"testing"
"github.com/stretchr/testify/assert"
)
func TestPIDSet_Empty(t *testing.T) {
var s PIDSet
assert.True(t, s.Empty())
}
func TestPIDSet_Clear(t *testing.T) {
var s PIDSet
s.Add(NewPID("nohost", "p1"))
s.Add(NewPID("nohost", "p2"))
s.Add(NewPID("nohost", "p3"))
asse... |
705587af00344cf417c0e7af3d132172381eeb98 | e8939e67afd84e1fcfa3bfd23abc6b93db7273a5 | lgu-cours/go-web-tp-step2 | /src/webapp/persistence/dao/studentDAO_test.go | Go | go | 873 | no_license | package dao
import (
"testing"
"fmt"
)
// Student DAO Unit Testing
// DAO based on a map in memory with initial list of 3 students
func TestInMemoryDAO(t * testing.T ) {
fmt.Println(t.Name()) // prints function name
SetDAOImplementation(MEMORY)
dao := GetStudentDAO()
student ... |
351f937fc3117db76f99363de00d0ba3147838f2 | d117292c15e45ab09f843fb9d52f3ce0a07d2c94 | romanornr/golang-tutorial | /udemy/section8/04_scope/clojure/main.go | Go | go | 346 | no_license | package main
import (
"fmt"
)
func wrapper() func() int {
x := 0
return func() int {
x++
return x
}
}
func test() func() int {
x := 0
return func() int {
x = +8
return x
}
}
func main() {
increment := wrapper()
fmt.Println(increment())
fmt.Println(increment())
test2 := test()
fmt.Println(test2()... |
3bb8fe7a4c3ff6083c361ecc7d9bf858a3eb5b95 | c778d2aecfd34fa4d076fba44d344eb81044ee36 | AlistairBurrowes/golang-toy-robot | /processing/commands.go | Go | go | 1,415 | no_license | package processing
import (
"golang-toy-robot/model"
"regexp"
"strconv"
)
func ParseCommand(input string) model.Command {
var result model.Command
switch input {
case "MOVE":
result = model.MoveCommand{}
case "LEFT":
result = model.LeftCommand{}
case "RIGHT":
result = model.RightCommand{}
case "REPORT... |
729a197c35ce16150da73d7bce1c492681be3547 | 3e4683222fadb2e29960393d81678f0e387fc0ad | MSHR-Dec/go_backend | /tools/seed/task.go | Go | go | 759 | no_license | package main
import (
"fmt"
"strconv"
"gorm.io/gorm"
"github.com/MSHR-Dec/go_backend/internal/domain/model"
)
type task struct {
db *gorm.DB
}
func newTask(db *gorm.DB) *task {
return &task{
db: db,
}
}
func (t task) generate() {
userIDs := t.getUserIDs()
for _, userID := range userIDs {
for i := 0... |
276ab35ee95ac66b82f1dec61bf7942d4ec10e2c | 0e425600113333f54b256ee1a13fabb4d95cbe7f | Moonpax/go-react-helm-kubernetes | /server/utils.go | Go | go | 572 | no_license | package main
import (
"io/ioutil"
"log"
"net/http"
"time"
)
// HTTPGetRequest make simple HTTP request with method GET
func HTTPGetRequest(reqURL string) ([]byte, error, int) {
client := &http.Client{Timeout: 30 * time.Second}
resp, err := client.Get(reqURL)
if err != nil {
return nil, err, resp.StatusCode
... |
c590bceb1f1c3001812a39e87a78d955dace998f | 547e891adda427d9dd33ec1037801547ae7761c8 | vishalkuo/trillian | /server/mysql_storage_provider.go | Go | go | 2,030 | permissive | // Copyright 2018 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable... |
91da1261d08d63ba9ccfb3df4744ef4d0801884e | 93cf383070962ba30e76f290364c91f72891d2b5 | kbuzsaki/cupid | /vendor/github.com/coreos/go-systemd/dbus/dbus_test.go | Go | go | 2,030 | permissive | // Copyright 2015 CoreOS, 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... |
e7d10ef7cc95d0327e4406a8000b75873cb4ec8f | fc3501374386cda975c8aa50ab978b00e99c52bc | wangfmD/rvs | /handles/version/versionaction.go | Go | go | 7,484 | no_license | package version
import (
"database/sql"
"errors"
"github.com/gin-gonic/gin"
_ "github.com/go-sql-driver/mysql"
_ "github.com/wangfmD/rvs/log"
"github.com/wangfmD/rvs/setting"
"github.com/wangfmD/rvs/sshv"
"log"
"net/http"
)
func QueryVersionById(c *gin.Context) {
id := c.Param("versionid")
pVersMap := sqlQ... |
bba8664efb9e978f15facf3235f11b867cbd4a45 | 31b52ebbb347559fe149428bd1890bd2fa5ee9a7 | vkdive/calculator-be | /scanner/scanner.go | Go | go | 1,761 | no_license | package scanner
import (
"bufio"
"bytes"
"io"
"unicode"
"calculator/util"
)
type Scanner struct {
r *bufio.Reader
}
func NewScanner(r io.Reader) *Scanner {
return &Scanner{r: bufio.NewReader(r)}
}
func (s *Scanner) Read() rune {
ch, _, err := s.r.ReadRune()
if err != nil {
return util.Eof
}
return ch
... |
249180e57ae2e2ed5cbb0ba70bbc8cd701fcab51 | a1fb2f041e23d0cbe5233b22a84346a3db975a0c | cobaltspeech/sdk-cubic | /grpc/go-cubic/cubicpb/gw/gw_test.go | Go | go | 2,904 | permissive | package gw_test
import (
"context"
"fmt"
"net"
"net/http"
"testing"
"time"
"github.com/cobaltspeech/sdk-cubic/grpc/go-cubic/cubicpb"
"github.com/cobaltspeech/sdk-cubic/grpc/go-cubic/cubicpb/gw"
"github.com/golang/protobuf/ptypes/empty"
"github.com/grpc-ecosystem/grpc-gateway/runtime"
"google.golang.org/grp... |
9a5254ae375d74b0c3acea4a32e63816afc93117 | 4bb1e387ae5f89ee9a3db4b294297e0b3baf7c68 | osmir-cds/istio | /galley/pkg/config/processor/transforms/serviceentry/handler_bench_test.go | Go | go | 7,978 | 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... |
0c5bf3bffc5e6bc745e6a04b8edca481ee5100c1 | 8d5ca7fe9e06947cd3213edc30dfecf483d4c603 | GAJULA-ABHINAV1997/Golang_Datastructures | /Assign_7/main.go | Go | go | 2,679 | no_license | package main
import (
"fmt"
"net/http"
"github.com/gin-gonic/gin"
"github.com/jinzhu/gorm"
_ "github.com/jinzhu/gorm/dialects/postgres"
)
type Book struct {
ID uint `json:"id" gorm:"primary_key`
Name string `json:"name"`
Auther string `json:"auther`
Year string `json:"year"`
}
func connectDB() *g... |
a9cb0962de15dbe1389fa582118b3fb72538ce6d | f26e2a3da9c776e3f4b076621a73ab575cc2c8fb | davidewatson/nodeadm | /utils/file.go | Go | go | 1,723 | permissive | package utils
import (
"io"
"io/ioutil"
"net/http"
"os"
"strings"
log "github.com/platform9/nodeadm/pkg/logrus"
)
func ReplaceString(file string, from string, to string) {
read, err := ioutil.ReadFile(file)
if err != nil {
log.Fatalf("Failed to read file %s with error %v", file, err)
}
newContents := str... |
ce9df533c92659420aa70b692a72284859be6220 | d6810704f81906d941b558dfab7aa7f1500fbe33 | bstick12/riff | /vendor/github.com/boz/kcache/types/ingress/filter.go | Go | go | 846 | permissive | package ingress
import (
"github.com/boz/kcache/filter"
"github.com/boz/kcache/nsname"
"k8s.io/api/extensions/v1beta1"
)
func ServicesFilter(ingresses ...*v1beta1.Ingress) filter.ComparableFilter {
var ids []nsname.NSName
for _, ing := range ingresses {
ids = append(ids, buildServicesFilter(ing)...)
}
retu... |
beb9bb2bb03a6c74b23206df481e634b50d83a93 | bc598ec7a872c42c059642a53f4732de7822a205 | Srini194/kubermatic | /api/pkg/controller/master-controller-manager/rbac/test/fake/informer_factory.go | Go | go | 3,725 | permissive | /*
Copyright 2020 The Kubermatic Kubernetes Platform contributors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law ... |
30dfe4dbc757029f127cb5a66d2df20ecd88a97e | 0d2fb62136a037d1e7bc97cb1648059409b63f62 | appveen/mongo-go-driver | /mongo/causal_consistency_test.go | Go | go | 18,970 | permissive | // Copyright (C) MongoDB, Inc. 2017-present.
//
// Licensed under the Apache License, Version 2.0 (the "License"); you may
// not use this file except in compliance with the License. You may obtain
// a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
package mongo
import (
"context"
"os"
"testing... |
006882a73434e1bb714ccc3fa74906078d40b607 | 5322009f190a812df22ee44e4231ab5229818ec1 | cheonvi1004/open-service-broker-sacloud | /broker/server_test.go | Go | go | 1,218 | permissive | package broker
import (
"context"
"errors"
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestServerStart(t *testing.T) {
dummyErr := errors.New("dummy")
cfg := &Config{
BasicAuthPassword: "test",
BasicAuthUsername: "password",
}
t.Run("Should block until returns error", func(t *testing.T... |
d34e446901e35b3ff819e78bd6756543aa31f7c8 | a4ad0ca6d00914b72b6ed3eeed6f92cffd0cd400 | chongchuanbing/katib | /pkg/controller.v1beta1/experiment/experiment_controller_test.go | Go | go | 18,858 | permissive | /*
Copyright 2021 The Kubeflow 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, so... |
c526be538c6be9f1fbb7bb54715df609a33392b3 | 5bc00b63112d5dfd72aa2ab6657e92b0889c1b12 | 1dustycy/CtCI-6th-Edition-Go | /src/chapter3/problem6_test.go | Go | go | 802 | no_license | package chapter3
import (
"testing"
)
func TestPetShelter(t *testing.T) {
ps := GetPetShelter()
ps.enqueue("lucky", DogType)
ps.enqueue("spot", DogType)
ps.enqueue("snowball", CatType)
var i *PetInfo
var err error
i, err = ps.dequeueAny()
if err != nil {
t.Fatalf("Unexpected error: %v\n", err)
}
if i.pet... |
f3191247227195e32af9c85113205085293638dd | e595b52d22518cc47c9c69e0020b690126a0da04 | stephen-tse/harmony | /api/proto/message/errors.go | Go | go | 466 | permissive | package message
import "errors"
// Error of host package
var (
ErrWrongMessage = errors.New("Error as receiving wrong message")
ErrEnterMethod = errors.New("Error when processing enter method")
ErrResultMethod = errors.New("Error when processing result/getPlayers method")
ErrEnterPr... |
017aca0e4b8157111eb295e52fa6faa6036796a9 | ef092e44f3c0426303727493d9b4ac5cecbef816 | liyork/gopiano | /com/wolf/piano/test/base/reg_test.go | Go | go | 702 | no_license | package base
import (
"fmt"
"regexp"
"testing"
)
func TestRegBase(t *testing.T) {
match, _ := regexp.MatchString("\\d{16}", "880218end") //六位连续的数字
fmt.Println(match) //输出true
// 任意位置进行匹配1.*.*.*
match, _ = regexp.MatchString("1\\..*\\..*\\..*", "10.1.1.1")
fmt.Println("matc... |
25df4059f33fe18b5ea6fb329c12fce8814c7395 | 7efe0e78bcda3b9dca217271b2d925d59ebd39b0 | a289237642/myLeetCode | /Go/72. 编辑距离.go | Go | go | 861 | no_license | /**
给定两个单词 word1 和 word2,计算出将 word1 转换成 word2 所使用的最少操作数 。
你可以对一个单词进行如下三种操作:
插入一个字符
删除一个字符
替换一个字符
示例 1:
输入: word1 = "horse", word2 = "ros"
输出: 3
解释:
horse -> rorse (将 'h' 替换为 'r')
rorse -> rose (删除 'r')
rose -> ros (删除 'e')
示例 2:
输入: word1 = "intention", word2 = "execution"
输出: 5
解释:
intention -> inention (删除 't')
i... |
ea01129072c8f1efae4033e27ee395a2d210f5fe | f3d76a8405fa4fdbd946561b95bd260fbccd4297 | jasiu001/compass | /components/director/internal/domain/apptemplate/resolver_test.go | Go | go | 42,645 | permissive | package apptemplate_test
import (
"context"
"errors"
"testing"
"github.com/stretchr/testify/mock"
"github.com/kyma-incubator/compass/components/director/pkg/resource"
"github.com/kyma-incubator/compass/components/director/pkg/apperrors"
"github.com/kyma-incubator/compass/components/director/internal/model"
... |
22934c548076ba83b1e60d088236f1d4b78543b7 | 9a8f4c1ecfc2ca9c43b329bde65c7bf372122eab | frankfanslc/k8s-app-engine | /pkg/api/policy.go | Go | go | 13,418 | permissive | package api
import (
"fmt"
"net/http"
"strconv"
"sort"
"github.com/Aptomi/aptomi/pkg/engine"
"github.com/Aptomi/aptomi/pkg/engine/apply/action"
"github.com/Aptomi/aptomi/pkg/engine/diff"
"github.com/Aptomi/aptomi/pkg/engine/resolve"
"github.com/Aptomi/aptomi/pkg/event"
"github.com/Aptomi/aptomi/pkg/lang"
... |
1d8a400b559c8993c4fe7e62a693d6e66675cadc | fa8c25d58a1f999f624a833e7b9695e2be91e184 | Yleisradio/mongodb_exporter | /collector/mongos/sharding_topology.go | Go | go | 6,782 | permissive | // Copyright 2017 Percona 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 wr... |
62d4dafaf9f6315342d0d0951e6dcfbe4e9446fc | 3f181948b3d957a6af70b0da4e690ded8ebd3d44 | truestblue/php-transformer | /node/expr/assign/n_mul.go | Go | go | 819 | permissive | package assign
import (
"github.com/truestblue/php-transformer/node"
"github.com/truestblue/php-transformer/walker"
)
// Mul node
type Mul struct {
Variable node.Node
Expression node.Node
}
// NewMul node constructor
func NewMul(Variable node.Node, Expression node.Node) *Mul {
return &Mul{
Variable,
Expre... |
cb6d992be82e1537907ab4af0f96d132114afddb | 0d7ef601e27ac502d0f17b41deb19c94826f2f9d | tongchain/justledger | /common/capabilities/application_test.go | Go | go | 2,735 | permissive | /*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package capabilities
import (
"testing"
cb "justledger/protos/common"
"github.com/stretchr/testify/assert"
)
func TestApplicationV10(t *testing.T) {
ap := NewApplicationProvider(map[string]*cb.Capability{})
assert.NoError(t, ap... |
97c722e3849a1643fc82497e90996b16630f2064 | 53a48ef39c7e5615d2fe89dfe61c79dc90ae7a8d | likozar1/go-calculator | /calc.go | Go | go | 1,787 | no_license | package main
import "fmt"
import "regexp"
import "flag"
import "os"
import "bufio"
import "strconv"
const Regex = "-?[0-9]+|[*+/-]"
var Re *regexp.Regexp
var Expr string
func init() {
flag.StringVar(&Expr, "ex", "", "Provide mathematical expression; example: '-10 + 15 * 3'")
Re = regexp.MustCompile(Regex)
}
func... |
9003062a5c240daec6c62f38e6bb7fc0484cadf6 | 89e2fc35030ae03c4afa0a1b27a80e760b63d99d | cclerget/cri | /pkg/kube/container_validate.go | Go | go | 2,974 | permissive | // Copyright (c) 2018 Sylabs, Inc. All rights reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by appli... |
6082a23fd8d809a1ae03bb78ec46d10764c868d4 | e8d7146fbbd788f8e751179c896adb413399888e | hustnn/vectorsql | /src/functions/function_compare.go | Go | go | 2,886 | permissive | // Copyright 2020 The VectorSQL Authors.
//
// Code is licensed under Apache License, Version 2.0.
package functions
import (
"datatypes"
)
var FuncCompareEqual = &Function{
Name: "=",
Args: [][]string{
{"left", "right"},
},
Logic: func(args ...datatypes.Value) (datatypes.Value, error) {
v1 := args[0]
v2 ... |
8f31bc39516a50c31d68f46723dc22110731b349 | 9c3d2b263dd20717a846fd128da4856c0f8f613e | Srisach/lazygit | /pkg/gui/confirmation_panel.go | Go | go | 5,389 | permissive | // lots of this has been directly ported from one of the example files, will brush up later
// Copyright 2014 The gocui 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 gui
import (
"strings"
"github.com/fatih/color"
"gi... |
8555dd8982189851fb4d6271d63d8ede59c0016d | 30b789bae6d3d65399624b30db39f59607c5ab99 | jai2033shankar/service-manager | /api/api.go | Go | go | 6,255 | permissive | /*
* Copyright 2018 The Service Manager Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required ... |
4863f533aa1c68c3b95c2fa83071d2321e2b1c34 | 1cb67aefc8cb09c65b0e7ab72a93b00038574271 | mariotoffia/gomarkdoc | /format/asciidoc.go | Go | go | 4,901 | permissive | package format
import (
"errors"
"fmt"
"strings"
"github.com/princjef/gomarkdoc/lang"
)
// Asciidoc provides a Format which is compatible asciidoc format specification.
type Asciidoc struct{}
// Bold converts the provided text to bold
func (f *Asciidoc) Bold(text string) (string, error) {
if text == "" {
ret... |
4812c5f27926a24c35d0a5bc5f706f167ce81b3b | 8dcc6e9eb8fd4a0ad6444ac9b1f26582981e2722 | phpfs/surv | /config.go | Go | go | 391 | no_license | package main
//Set your config path here:
//(if your config.toml.sample is in the same path, just write it's file name!)
const configFile = "config.toml.sample"
//----------------------------------------------------------
//-------------Change-nothing-below-this-line-!-------------
//---------------------------------... |
e5f806245d2f64df76c587c05eaadf9497a3ea76 | 0b0bb7c66768a96672f1d07b076c4102b3da5388 | huskar-t/taosgorm | /migrator.go | Go | go | 2,033 | no_license | package taosgorm
import (
"database/sql"
"errors"
"fmt"
"gorm.io/gorm"
"gorm.io/gorm/clause"
"gorm.io/gorm/migrator"
"gorm.io/gorm/schema"
)
type Migrator struct {
migrator.Migrator
d Dialect
}
type Column struct {
name string
nullable sql.NullString
datatype string
maxle... |
5eb16c68f3c56f3aef77d61a9f67b19de013fcba | cb2d4918eb60ba870fcfc835b31c44f633ede0b3 | bigwhite/experiments | /http-benchmark/nethttp/main.go | Go | go | 399 | no_license | package main
import (
_ "expvar"
"log"
"net/http"
_ "net/http/pprof"
"runtime"
"time"
)
func main() {
go func() {
for {
log.Println("当前routine数量:", runtime.NumGoroutine())
time.Sleep(time.Second)
}
}()
http.Handle("/", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Write([]byt... |
8851789ede601d2e52ec2b8b7ea3f6248e1e1e61 | 3b6272801146df1575899edbb4747a74cba21efe | balan2010/mmctl | /vendor/github.com/mattermost/mattermost-server/v5/config/feature_flags.go | Go | go | 4,138 | permissive | // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
package config
import (
"math"
"reflect"
"strconv"
"strings"
"github.com/mattermost/mattermost-server/v5/mlog"
"github.com/mattermost/mattermost-server/v5/model"
"github.com/pkg/errors"
"github.com... |
cb16ce52591d91ef33c93b97a1de9d1e328131cd | 61b0340fcbf200b79bb8b6c3f910ea4df16f386a | neezhe/NSQ-SourceCodeRead | /internal/util/wait_group_wrapper.go | Go | go | 804 | permissive | package util
import (
"sync"
)
type WaitGroupWrapper struct {
sync.WaitGroup
}
//假如Main线程在接收到系统信号量之后直接退出, 那么其他两个线程也会跟着销毁. 于是这里就会出现一个问题, tcp服务线程 和 http服务线程,
// 是业务逻辑实现的主要线程, 里面可能正在”干活”, 此时需要退出, 是否有数据需要持久化了? 事务是否正好执行到一半?
//所以退出时需要做优雅退出处理. Main所在线程退出之前, 需要 ‘通知’ 并且 ‘等待’ 两个服务线程退出后才能退出
//为了实现这一点, nsq 利用了 sync... |
7763983f059e0d1463167a4dfebef7d73debd75f | e41bfa6ca106b666af9703e7abcd590e56e3f4c6 | aiordache/app | /internal/commands/build/build.go | Go | go | 12,198 | permissive | package build
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strconv"
"strings"
"sync"
"github.com/deislabs/cnab-go/bundle"
cnab "github.com/deislabs/cnab-go/driver"
"github.com/docker/app/internal"
"github.com/docker/app/internal/packager"
"github.com/docker/a... |
9071288a80a87587a20ca35346792ec3ac29258e | 430ed52c377d971280733db7c1fa68ab6913127a | blizzardtrade/ton-client-go | /client/global_multiplexer.go | Go | go | 1,413 | permissive | package client
import "sync"
// globalMultiplexer - is thread-safe multiplexer to be called in exported C function.
var globalMultiplexer = NewMultiplexer()
type channelPair struct {
responses chan<- *RawResponse
close <-chan struct{}
}
type multiplexer struct {
sync.Locker
requestIDCounter uint32
callback... |
a7534e306f6a9bdf57489ca66dd9176c08fec5b0 | e5937f2eda79f59276970293fd4283ed060a855d | Narachii/design_pattern | /command/simple_remote_control.go | Go | go | 442 | no_license | //Invoker
package main
type simpleRemoteControl struct {
slot iCommand
}
/**
* We have a method for setting
* the command the slot is going
* to control. This could be called
* multiple times if the client of
* this code wanted to change the
* behavior of the remote button.
*/
func (r *simpleRemoteControl) set... |
2d95585a1b546797fc6599a52adf969ac6610e7e | a7390e45874ae26416b3a467806e78f5d955af42 | vugarg/Kood-Johvi | /capitalize.go | Go | go | 662 | no_license | package piscine
func Capitalize(s string) string {
runes := []rune(s)
length := len(runes)
if runes[0] >= 'a' && runes[0] <= 'z' {
runes[0] -= 32
}
for i := 1; i < length; i++ {
if runes[i] >= 'A' && runes[i] <= 'Z' {
if runes[i-1] >= 'A' && runes[i-1] <= 'Z' ||
runes[i-1] >= 'a' && runes[i-1] <= 'z'... |
90d7af0fb3822e8270096c4449ce3293a9737efc | 58ad49030cf0f72b0b9e2c20d416d62d5214c9af | lilosir/LeetCode | /problem883/problem883_test.go | Go | go | 658 | no_license | package problem883
import "testing"
type testUnit struct {
input [][]int
output int
}
func TestProjectionArea(t *testing.T) {
table := []testUnit{
{
[][]int{
{2},
},
5,
},
{
[][]int{
{1, 2},
{3, 4},
},
17,
},
{
[][]int{
{1, 0},
{0, 2},
},
8,
},
{
[]... |
5838681f504f8eeadde5a6362bf6d724c4420eb9 | f76931fe863632d0104aa017a350549fd4958535 | mcree/k51 | /backend/mq.go | Go | go | 1,637 | permissive | package backend
import (
mqtt "github.com/eclipse/paho.mqtt.golang"
"github.com/spf13/viper"
"sync"
"time"
log "github.com/Sirupsen/logrus"
)
var client mqtt.Client
var onceMQ sync.Once
func defaultHandler(_ mqtt.Client, msg mqtt.Message) {
log := log.WithFields(log.Fields{
"prefix": "mq",
"message": msg,
... |
f266429f4306323c4b93039403851b35401f236d | d667649a1ffcd413e5a38ffa010d4bbc29afe4e1 | lionskape/werf | /pkg/deploy/helm/render.go | Go | go | 6,895 | permissive | package helm
import (
"fmt"
"io"
"io/ioutil"
"net/url"
"os"
"path/filepath"
"strings"
"github.com/Masterminds/semver"
"github.com/ghodss/yaml"
"k8s.io/helm/pkg/chartutil"
"k8s.io/helm/pkg/getter"
"k8s.io/helm/pkg/manifest"
"k8s.io/helm/pkg/proto/hapi/chart"
"k8s.io/helm/pkg/renderutil"
"k8s.io/helm/pk... |
c69b101c232a1007f66ff82690cc0fae244efc31 | 8d845f9f184bd9a4b3aacf1845bf61af933a3c0f | michaelwisely/gravwell | /filewatch/fwork_linux.go | Go | go | 1,447 | permissive | // +build linux
/*************************************************************************
* Copyright 2017 Gravwell, Inc. All rights reserved.
* Contact: <legal@gravwell.io>
*
* This software may be modified and distributed under the terms of the
* BSD 2-clause license. See the LICENSE file for details.
*******... |
e877e4eb1ace82bdc230add5698f347a5642dd54 | c3be9af106e7d6f3ef66f9a01efa7d5154e7d422 | shaneutt/go-github | /scrape/scrape.go | Go | go | 4,673 | permissive | // Copyright 2013 The go-github 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 scrape provides a client for interacting with GitHub using screen
// scraping.
//
// This is intended to be used as a supplement to the sta... |
aa1a2d1ce9feaa931b6d043cd51911e83cd6db48 | 6744559a29db8f29c585b42f2adbdae99338ff5e | Akatsuki-Ousawa/nyaa | /router/userHandler.go | Go | go | 11,554 | permissive | package router
import (
"fmt"
"net/http"
"strconv"
"github.com/NyaaPantsu/nyaa/model"
"github.com/NyaaPantsu/nyaa/service/captcha"
"github.com/NyaaPantsu/nyaa/service/user"
"github.com/NyaaPantsu/nyaa/service/user/form"
"github.com/NyaaPantsu/nyaa/service/user/permission"
"github.com/NyaaPantsu/nyaa/util/lan... |
ccf29d3262bb4018959c67f7ab27f1db249ad9e1 | e924da89d0d9e72779d3000581cb261ffee99ae4 | tstromberg/ggroups | /ggroups.go | Go | go | 395 | permissive | // ggroups is a Go-equivalent for groups(1), used to validate go-->libc behavior.
package main
import (
"fmt"
"os"
"os/user"
"strings"
)
func main() {
u, err := user.Lookup(os.Args[1])
if err != nil {
panic(fmt.Sprintf("lookup failed: %v", err))
}
gids, err := u.GroupIds()
if err != nil {
panic(fmt.Sprin... |
94b1211c478f474290f5180b07ef40c9f1f1cf77 | 4ebe336959b6140ff7d03d471c8710dadc126de3 | isabella232/ltc | /config/target_verifier/target_verifier.go | Go | go | 1,040 | permissive | package target_verifier
import (
"github.com/cloudfoundry-incubator/ltc/receptor_client"
"github.com/cloudfoundry-incubator/receptor"
)
//go:generate counterfeiter -o fake_target_verifier/fake_target_verifier.go . TargetVerifier
type TargetVerifier interface {
VerifyTarget(name string) (up bool, auth bool, err err... |
40f47c55dc6a545874d20f091b72d0528e26d95f | 94007412bbafcaac776139d37eba950e0c7473f0 | m1093782566/kubernetes | /test/e2e/common/pods.go | Go | go | 20,461 | permissive | /*
Copyright 2016 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
57b23a61c42f1cbbe93e880ae56731737280a352 | 66196d7b53da8bddf3d5a773a9e631d5e94b7280 | jmdacruz/flinkk8soperator | /pkg/controller/k8/mock/mock_k8.go | Go | go | 2,350 | permissive | package mock
import (
"context"
v1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
)
type GetDeploymentsWithLabelFunc func(ctx context.Context, namespace string, labelMap map[string]string) (*v1.DeploymentList, error)
type CreateK8ObjectFunc func(ctx context.Context, object run... |
804271965f3e773efa84fc63d6397ac5f466d0f3 | 7f20b7519e91587e2f7fed4d27116a6f49a1082c | gambarini/kombustion | /types/types.go | Go | go | 745 | permissive | package types
type Validatable interface {
Validate() []error
}
// CfResource - A Cloudformation Resource
type CfResource struct {
Type string `yaml:"Type"`
Properties interface{} `yaml:"Properties"`
Condition interface{} `yaml:"Condition,omitempty"`
Metadata interface{} `yaml:"Metadata,omitempty"`... |
08b21c78531b53e2702c5183493af9312653bf8d | 4d1423f00835f2d4e463e0f0459b3030d2d8d4ab | lkingland/serverless-operator | /knative-operator/pkg/controller/knativeserving/kourier/kourier.go | Go | go | 4,418 | permissive | package kourier
import (
"context"
"fmt"
"os"
mf "github.com/jcrossley3/manifestival"
"github.com/openshift-knative/serverless-operator/knative-operator/pkg/common"
appsv1 "k8s.io/api/apps/v1"
v1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstruc... |
8521d87cfea9795490d088aaae37741cf63cff1c | b4ff3b522e7b53180532f3287c86d81d6f9890ce | opentelekomcloud/gophertelekomcloud | /openstack/dcs/v1/backups/ListRestoreRecords.go | Go | go | 2,088 | permissive | package backups
import (
golangsdk "github.com/opentelekomcloud/gophertelekomcloud"
"github.com/opentelekomcloud/gophertelekomcloud/internal/extract"
)
func ListRestoreRecords(client *golangsdk.ServiceClient, instancesId string, opts ListBackupOpts) (*ListRestoreRecordsResponse, error) {
q, err := golangsdk.BuildQ... |
f9d5c9b531fb03c372890eab8de3e28c8a1594d5 | ec81c86479e058b2507a699415a7c5b00b7e4fda | bbrodriges/govim | /cmd/govim/internal/fswatcher/os_darwin.go | Go | go | 2,346 | permissive | // +build darwin
package fswatcher
import (
"fmt"
"log"
"os"
"path/filepath"
"time"
"github.com/fsnotify/fsevents"
"gopkg.in/tomb.v2"
)
const fRemoved = fsevents.ItemRemoved | fsevents.ItemRenamed
const fChanged = fsevents.ItemModified | fsevents.ItemChangeOwner
const fCreated = fsevents.ItemCreated
type fs... |
5023fc0a71ffea7f2561bf111e2042b5ee76a94c | 8c1c4735d90b4b400f49e4010b381c311abf7511 | shalevy1/octant | /internal/api/loading_state.go | Go | go | 3,376 | permissive | /*
* Copyright (c) 2020 the Octant contributors. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0
*/
package api
import (
"context"
"encoding/base64"
"fmt"
"io/ioutil"
"os"
"sync/atomic"
"time"
"github.com/vmware-tanzu/octant/pkg/event"
"github.com/spf13/afero"
"k8s.io/client-go/tools/clientc... |
dc8662ec7e6626657ba8734568051c5ca74c24e2 | edddaaea4578f504242cf8eb120e843d9b4b7043 | makeroo/taxi-scout | /rest/server.go | Go | go | 247 | no_license | package rest
import (
"github.com/makeroo/taxi_scout/storage"
"go.uber.org/zap"
)
// Server implements Taxi Scout REST API.
type Server struct {
Dao storage.Datastore
Logger *zap.SugaredLogger
Configuration Configuration
}
|
32b7b87fae6b246a2aa80200ab681adb2dda1979 | 75ebf4ef133be1b31ffa63c424a2e226052ada6b | alex-pro27/deliveryman | /admin/server.go | Go | go | 326 | no_license | package admin
import (
"context"
)
type Server struct {
}
func NewSever() *Server {
return new(Server)
}
func (s *Server) AuthFuncOverride(ctx context.Context, fullMethodName string) (context.Context, error) {
switch fullMethodName {
case "/admin.Admin/Login":
return ctx, nil
default:
return CheckAuth(ctx)... |
a92ffb9c5890668770bb1ac1df2fa3e059968238 | 39110703f1388b099e146eba402b501e63aa721f | zc310/utils | /httputil/request.go | Go | go | 1,661 | permissive | package httputil
import (
"encoding/json"
"io"
"io/ioutil"
"net/http"
"errors"
"fmt"
"strings"
)
var DefaultClient = http.DefaultClient
func GetRequest(url string) (*http.Response, error) {
req, err := http.NewRequest("GET", url, nil)
if err != nil {
return nil, err
}
return DefaultClient.Do(req)
}
fun... |
fd9b481a5db5f2c74529277a261c3f8c91de1529 | bc74d709f3a2c8105932726b30c28c3a9a80e480 | ice-j/amp-by-example | /backend/checkout.go | Go | go | 2,240 | permissive | // Copyright Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, ... |
b3b362a5cb7860129b65bf7d29a55ebe515c2dce | 3edd9e56e2498f6950d27b4206a9d6a2ae886859 | drewmullen/sdp-terraform-provider | /appgate/data_source_appgate_ringfence_rule.go | Go | go | 2,680 | permissive | package appgate
import (
"context"
"fmt"
"log"
"github.com/appgate/sdp-api-client-go/api/v13/openapi"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)
func dataSourceAppgateRingfenceRule() *schema.Resource {
return &schema.Resource{
Read: dataSourceAppgateRingfenceRuleRead,
Schema: map[strin... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.