text stringlengths 3.08k 10.4k |
|---|
// Copyright 2013 The Gorilla 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 handlers is a collection of handlers for use with Go's net/http package.
*/
package handlers
import (
"bufio"
"io"
"net"
"net/http"
"sort"... |
package connectordb
import (
"connectordb/users"
"testing"
"github.com/stretchr/testify/require"
)
func TestStream(t *testing.T) {
Tdb.Clear()
db := Tdb
num, err := db.CountStreams()
require.NoError(t, err)
require.Equal(t, int64(0), num)
u, err := db.ReadStream("tst/tst/tst")
require.Nil(t, u)
require.... |
package main
import (
"errors"
"flag"
"fmt"
"io"
"os"
"strings"
"sync"
"github.com/mknyszek/goat"
"github.com/mknyszek/goat/cmd/internal/spinner"
"github.com/mknyszek/goat/simulation"
"github.com/mknyszek/goat/simulation/toolbox"
"github.com/mknyszek/goat/simulation/toolbox/object"
"github.com/mknyszek/g... |
package main
import (
"encoding/xml"
"fmt"
"github.com/julienschmidt/httprouter"
"github.com/nlopes/slack"
"io/ioutil"
"log"
"net/http"
"os"
"strings"
)
var summarySender chan *TestSummary
var slackChannels map[string]string = nil
type Response struct {
Text string `json:"text,omitempty"`
Channel stri... |
package main
import (
"bytes"
"encoding/json"
"flag"
"fmt"
"log"
"net/http"
"os"
"strconv"
"strings"
"time"
)
var (
// BuildCommit contains the git sha of the commit built, defaults to empty
BuildCommit = "-"
// BuildTag contains the tag of the commit built, defaults to 'snapshot'
BuildTag = "snapshot"
... |
package products
// generated by pgtalk-gen on Thu, 06 Jan 2022 17:33:19 CET
// DO NOT EDIT
import (
p "github.com/emicklei/pgtalk"
c "github.com/emicklei/pgtalk/convert"
"github.com/jackc/pgtype"
"time"
)
// Product is generated from the public.products table.
type Product struct {
ID int64 ... |
package client
import (
"context"
"fmt"
"reflect"
"strconv"
gogogrpc "github.com/gogo/protobuf/grpc"
abci "github.com/tendermint/tendermint/abci/types"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/encoding"
"google.golang.org/grpc/encoding/proto"
"google.golang.org/grpc/m... |
package commands
import (
"bufio"
"bytes"
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"math"
"net/http"
"os"
"strconv"
"strings"
"github.com/bwmarrin/discordgo"
"github.com/paulloz/bip-boup/bot"
"github.com/paulloz/bip-boup/embed"
)
func commandRoll(args []string, env *bot.CommandEnvironment, b *bot.Bo... |
// Copyright 2017 <NAME>, ΓΜ. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package nettools
import (
"crypto/tls"
"fmt"
"net"
"os"
"strings"
"time"
"github.com/go-siris/siris/core/errors"
"golang.org/x/crypto/acme/autocert"
"gop... |
/*
Copyright 2020 kubeflow.org.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
d... |
package main
import (
"context"
"fmt"
"log"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/dynamodb"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
const (
// LockTimeoutVar is the key for the se... |
// Copyright (c) 2014 The unifi Authors. All rights reserved.
// Use of this source code is governed by ISC-style license
// that can be found in the LICENSE file.
package unifi
import (
"encoding/json"
"fmt"
)
type LAN struct {
LanIP string `json:"lan_ip"`
NumAdopted int `json:"num_adopted"`
... |
package main_test
import (
"fmt"
"os"
"os/exec"
"path/filepath"
"runtime"
"strings"
"sync"
"testing"
"v.io/x/lib/gosh"
)
var (
sh *gosh.Shell
cmd string
tmpDir string
setupOnce sync.Once
)
func setup(t *testing.T) {
setupOnce.Do(func() {
sh = gosh.NewShell(t)
tmpDir = sh.MakeTempDi... |
/****************************************************************************
* Copyright 2020, Optimizely, Inc. and contributors *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you m... |
//nolint:golint,goconst
package config
import (
"bytes"
"fmt"
"io/ioutil"
"net/http/httptest"
"net/url"
"os"
"path/filepath"
"runtime"
"testing"
"github.com/stretchr/testify/require"
"github.com/grafana/agent/pkg/util/subset"
"gopkg.in/yaml.v2"
_ "github.com/grafana/agent/pkg/integrations/install"
v2 ... |
// Copyright Project Harbor 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... |
/*
The MIT License (MIT)
Copyright (c) 2015 <NAME>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, m... |
// Unless explicitly stated otherwise all files in this repository are licensed
// under the Apache License Version 2.0.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2018 Datadog, Inc.
package config
import (
"github.com/stretchr/testify/assert"
"testing"
)
func... |
package backuprestore
import (
"context"
"fmt"
"k8s.io/apimachinery/pkg/util/sets"
"k8s.io/klog/v2"
"os"
"path/filepath"
"time"
)
var (
static_pod_list = []string{
"etcd-pod.yaml",
"kube-apiserver-pod.yaml",
"kube-controller-manager-pod.yaml",
"kube-scheduler-pod.yaml",
}
staticPodContainers = sets.... |
package mutation
import (
"fmt"
"strings"
"github.com/sirupsen/logrus"
corev1 "k8s.io/api/core/v1"
)
// injectCurl is a container for the mutation injecting environment vars
type injectCurl struct {
Logger logrus.FieldLogger
}
// injectCurl implements the podMutator interface
var _ podMutator = (*injectCurl)(n... |
package common
import (
"fmt"
"io"
"os"
"strings"
aurora "github.com/logrusorgru/aurora"
indent "github.com/openconfig/goyang/pkg/indent"
"github.com/tranvictor/ethutils"
. "github.com/tranvictor/jarvis/networks"
)
func PrintFunctionCall(fc *FunctionCall) {
printFunctionCallToWriter(fc, os.Stdout, 0)
}
fun... |
package astikit
import (
"archive/zip"
"context"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
)
// internal shouldn't lead with a "/"
func zipInternalPath(p string) (external, internal string) {
if items := strings.Split(p, ".zip"); len(items) > 1 {
external = items[0] + ".zip"
internal = string... |
package main
import (
"compress/gzip"
"fmt"
"io"
"log"
"math"
"os"
"path/filepath"
"strings"
"time"
"github.com/influxdata/influxdb/influxql"
"github.com/influxdata/influxdb/models"
"github.com/influxdata/influxdb/tsdb/engine/tsm1"
)
type cmdExport struct {
path string
out string... |
package admission
import (
"bytes"
"context"
"crypto/rsa"
"crypto/x509"
"errors"
"fmt"
"testing"
"github.com/google/go-cmp/cmp"
"github.com/kubewarden/kubewarden-controller/internal/pkg/admissionregistration"
"github.com/kubewarden/kubewarden-controller/internal/pkg/constants"
corev1 "k8s.io/api/core/v1"
... |
package iterator_test
import (
"fmt"
"math"
"github.com/bradenaw/juniper/iterator"
"github.com/bradenaw/juniper/xmath"
)
func ExampleIterator() {
iter := iterator.Counter(5)
for {
item, ok := iter.Next()
if !ok {
break
}
fmt.Println(item)
}
// Output:
// 0
// 1
// 2
// 3
// 4
}
func Exampl... |
package main
import (
"errors"
"fmt"
"log"
"os"
"os/signal"
"reflect"
"strconv"
"strings"
"syscall"
"time"
"github.com/stripe/stripe-go/v71"
"github.com/stripe/stripe-go/v71/client"
"github.com/dnoberon/charger/airtable"
"github.com/joho/godotenv"
)
func main() {
var staleDays int
var pollInterval ... |
/*
Copyright 2018 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... |
package configuration
import (
"context"
"fmt"
"github.com/go-logr/logr"
goharborv1 "github.com/goharbor/harbor-operator/apis/goharbor.io/v1beta1"
commonCtrl "github.com/goharbor/harbor-operator/pkg/controller"
"github.com/goharbor/harbor-operator/pkg/factories/application"
"github.com/goharbor/harbor-operator... |
package httpmock
import (
"errors"
"fmt"
"net/http"
"net/http/httptest"
"strings"
"sync"
"github.com/stretchr/testify/require"
"github.com/nhatthm/httpmock/format"
"github.com/nhatthm/httpmock/planner"
"github.com/nhatthm/httpmock/request"
"github.com/nhatthm/httpmock/test"
"github.com/nhatthm/httpmock/v... |
// Copyright (c) 2004-present Facebook All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package viewer
import (
"context"
"io"
"net/http"
"net/http/httptest"
"testing"
"github.com/facebookincubator/symphony/cloud/log"
"github.com/face... |
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// CAUTION: If this file is not vector.go, it was generated
// automatically from vector.go - DO NOT EDIT in that case!
package vector
func (p *IntVector) re... |
package dns_resolution_checker
import (
"context"
"errors"
"net"
"time"
"github.com/sirupsen/logrus"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
kubeproberv1 "github.com/erda-project/kubeprober/apis/v1"
"github.com/erda-project/kubeprober/pkg/kubeclie... |
package merger
import (
"bytes"
"context"
"fmt"
"io"
"io/ioutil"
"path"
"testing"
"time"
"github.com/streamingfast/bstream"
"github.com/streamingfast/dbin"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func TestBundleReader_ReadSimpleFiles(t *testing.T) {
bundle := NewTest... |
package client
import (
"context"
"errors"
"fmt"
"net/http"
"net/url"
"os"
"path"
"strconv"
"sync"
"time"
"github.com/gorilla/websocket"
"github.com/lamhai1401/gologs/logs"
)
// Wss constant
const (
// Time allowed to write a message to the peer.
writeWait = 30 * time.Second
// Time allowed to read t... |
package graph
import (
"image/color"
"git.sr.ht/~charles/fynehax/geometry/r2"
"fyne.io/fyne"
"fyne.io/fyne/canvas"
"fyne.io/fyne/driver/desktop"
"fyne.io/fyne/theme"
"fyne.io/fyne/widget"
)
const (
// default inner size
defaultWidth int = 50
defaultHeight int = 50
// default padding around the inner ob... |
package main
import (
"flag"
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/tools/clientcmd"
"time"
//"k8s.io/api/extensions/v1beta1"
"k8s.io/api/extensions/v1beta1"
extensions "k8s.io/api/extensions/v1beta1"
"k8s.io/apimachinery/pkg/util/intstr"
"path/fi... |
// Copyright (c) 2017-2019 The UtopiaCoinOrg developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package util
import (
"bytes"
"crypto"
"crypto/sha256"
"encoding/base64"
"encoding/hex"
"fmt"
"github.com/UtopiaCoinOrg/uctime/merkle"
"github.com/UtopiaC... |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package app
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Use this data source to retrieve the metadata for SA... |
package tcp
import (
"fmt"
"sync"
"github.com/terassyi/gotcp/pkg/packet/ipv4"
"github.com/terassyi/gotcp/pkg/packet/tcp"
)
type Listener struct {
inner *Tcp // TODO どうにかする
queue chan AddressedPacket
tcb *controlBlock
}
func (t *Tcp) Listen(addr string, port int) (*Listener, error) {
a, err := ipv4.StringT... |
package main
import (
"os/exec"
"bufio"
"fmt"
"os"
"strings"
"io/ioutil"
)
func fileExists(filename string) bool {
info, err := os.Stat(filename)
if os.IsNotExist(err) {
return false
}
return !info.IsDir()
}
func fileNotExistsOrContains(filename string, match string) bool {
bytes, err :... |
package git
import (
"context"
"fmt"
"github.com/CDLUC3/uc3-tools/uc3-build-info/shared"
"github.com/google/go-github/github"
"golang.org/x/oauth2"
"net/http"
"net/url"
"os"
"regexp"
"strings"
)
var repoCache = map[string]map[SHA1]Repository{}
type Repository interface {
fmt.Stringer
Owner() string
Name... |
package tests
import (
"bytes"
"context"
"io/ioutil"
"math/big"
"testing"
"time"
"gx/ipfs/QmXWZCd8jfaHmt4UDSnjKmGcrQMw95bDGWqEeVLVJjoANX/go-ipfs-files"
logging "gx/ipfs/QmcuXC5cxs79ro2cUuHs4HQ2bkDLJUYokwL8aivcX6HW3C/go-log"
"github.com/stretchr/testify/require"
"github.com/filecoin-project/go-filecoin/pro... |
package main
import "text/template"
var testTemplate = template.Must(template.New("testCase").Parse(testTmpl))
var testTestTemplate = template.Must(template.New("testTestCase").Parse(testTestTmpl))
type testValue struct {
OpType string
TestName string
Description string
ModelValue modelValue... |
package rhinoceros
import (
"time"
"github.com/lindsaygelle/nook"
"github.com/lindsaygelle/nook/animal"
"github.com/lindsaygelle/nook/character"
"github.com/lindsaygelle/nook/gender"
"github.com/lindsaygelle/nook/personality"
"golang.org/x/text/language"
)
var (
hornsbyBirthday = nook.Birthday{
Day: 20,
... |
// Copyright © 2016 <NAME> (<EMAIL>)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish... |
package analyze
import (
"os"
"path/filepath"
"time"
"github.com/dundee/gdu/v5/pkg/fs"
)
// File struct
type File struct {
Mtime time.Time
Parent fs.Item
Name string
Size int64
Usage int64
Mli uint64
Flag rune
}
// GetName returns name of dir
func (f *File) GetName() string {
return f.Name
}
... |
// Public Domain (-) 2013-2014 The GoPlivo Authors.
// See the GoPlivo UNLICENSE file for details.
package plivo
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"github.com/google/go-querystring/query"
)
const (
libraryVersion = "0.1"
defaultBaseURL = "https://api.plivo.com/%s/Accou... |
// Copyright 2012 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package runtime_test
import (
"runtime"
"testing"
)
// arm soft division benchmarks adapted from
// https://ridiculousfish.com/files/division_benchmarks.tar... |
package service
import (
"context"
"fmt"
"github.com/pkg/errors"
"time"
"github.com/kyma-incubator/reconciler/pkg/model"
"go.uber.org/zap"
)
const (
defaultOperationsWatchInterval = 30 * time.Second
defaultOrphanOperationTimeout = 5 * time.Minute
)
type BookkeeperConfig struct {
OperationsWatchInterval ti... |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package mongodbatlas
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// `mongodbatlas_global_cluster_config` provide... |
/*
@Time : 2020/11/6 4:26 下午
@Author : ShadowWalker
@Email : <EMAIL>
@File : sso
@Software: GoLand
@Description: 结构体 单点登陆
*/
package structs
import "github.com/jinzhu/gorm"
// 单点登陆 登陆模块
type SingleSignOnLoginModule struct {
gorm.Model
CreatedUserID uint `gorm:"not null"` ... |
// Copyright (C) Activision Publishing, Inc. 2017
// https://github.com/Demonware/harbor-analytics
// Author: <NAME>
// Licensed under the 3-Clause BSD License (the "License");
// you may not use this file except in compliance with the License.
package registry
import (
"log"
"sort"
"time"
"github.com/demonware/... |
// Package threeleg provides functions for working with the three-legged
// OAuth flow described at https://developer.lyft.com/v1/docs/authentication#section-3-legged-flow-for-accessing-user-specific-endpoints.
package threeleg
import (
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"strings"
"tim... |
package server
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* ... |
package main
import (
"fmt"
"log"
"net"
"strings"
"syscall"
"github.com/golang/protobuf/proto"
"github.com/stefanhans/programming-reactive-systems-in-go/prototypes/protobuf-tcp-chat/chat-group"
)
// Start publisher service to provide member registration and message publishing
func startPublisher() error {
/... |
package ole
const (
CLSCTX_INPROC_SERVER = 1
CLSCTX_INPROC_HANDLER = 2
CLSCTX_LOCAL_SERVER = 4
CLSCTX_INPROC_SERVER16 = 8
CLSCTX_REMOTE_SERVER = 16
CLSCTX_ALL = CLSCTX_INPROC_SERVER | CLSCTX_INPROC_HANDLER | CLSCTX_LOCAL_SERVER
CLSCTX_INPROC = CLSCTX_INPROC_SERVER | CLSCTX_... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.26.0
// protoc v3.17.3
// source: helloworld.proto
package testdata
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sy... |
package client
import (
"fmt"
"io"
"time"
"google.golang.org/genproto/googleapis/rpc/errdetails"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/types/known/timestamppb"
pb "github.com/airbusgeo/geocube-client-go/pb"
)
type AOI [][][][2]float64
type Record struct ... |
package DG2D
import (
"fmt"
"github.com/notargets/gocfd/utils"
)
type LagrangeElement2D struct {
N, Nfp, Np, NFaces int
R, S utils.Vector
Dr, Ds utils.Matrix
V, Vinv, MassMatrix utils.Matrix
Cub *Cubature
}
type Cubature struct {
r, s, w utils.Vec... |
package runner
import (
"bufio"
"fmt"
"io"
"io/ioutil"
"os"
"path/filepath"
"strings"
"sync"
"github.com/projectdiscovery/gologger"
"github.com/projectdiscovery/nuclei/pkg/executor"
"github.com/projectdiscovery/nuclei/pkg/requests"
"github.com/projectdiscovery/nuclei/pkg/templates"
)
// Runner is a clien... |
package acs
import (
"crypto/tls"
"encoding/json"
"errors"
"io/ioutil"
"net"
"net/http"
"net/url"
"strconv"
"time"
"github.com/aws/amazon-ecs-agent/agent/api"
"github.com/aws/amazon-ecs-agent/agent/ecs_client/authv4"
"github.com/aws/amazon-ecs-agent/agent/ecs_client/authv4/credentials"
"github.com/aws/am... |
package ibm
import (
"context"
"os"
"path"
"strings"
"github.com/turbot/go-kit/helpers"
"github.com/turbot/steampipe-plugin-sdk/v3/connection"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin/transform"
)
// Regions is the current known list of valid region... |
package manifest
import (
"fmt"
"github.com/pkg/errors"
"gopkg.in/yaml.v2"
"io/ioutil"
"os"
"reflect"
"regexp"
"strings"
)
/*
Application yaml represents the complete yaml structure
type is always string because you can use a vars placeholder in all attributes.
*/
type Application struct {
Name ... |
package control
import (
"context"
"fmt"
"log"
"sync"
"sync/atomic"
"github.com/pingcap/tipocket/test-infra/pkg/core"
"github.com/pingcap/tipocket/test-infra/pkg/history"
"github.com/pingcap/tipocket/test-infra/pkg/verify"
)
// Controller controls the whole cluster. It sends request to the database,
// and a... |
/*
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
This file is licensed under the Apache License, Version 2.0 (the "License").
You may not use this file except in compliance with the License. A copy of
the License is located at
http://aws.amazon.com/apache2.0/
This file is dist... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package swf
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
"github.com/aws/aws-sdk-go-v2/private/protocol/jsonrpc"
)
type RegisterDo... |
// 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.
package maintapi
import (
"context"
"flag"
"fmt"
"sync"
"testing"
"time"
"golang.org/x/build/maintner"
"golang.org/x/build/maintner/godata"
"golang.o... |
package state
import (
"encoding/json"
"fmt"
"reflect"
"strings"
"k8s.io/apimachinery/pkg/apis/meta/v1/unstructured"
"k8s.io/apimachinery/pkg/runtime/schema"
)
// State is passed to and received from handler.
type State struct {
Object *unstructured.Unstructured `json:"object"`
Dependents ... |
// MIT License
// Copyright (c) [2022] [Arriven (https://github.com/Arriven)]
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights... |
package main
import (
"flag"
"fmt"
"go/ast"
"go/token"
"log"
"os/exec"
"strings"
"unicode"
"github.com/go-toolsmith/pkgload"
"golang.org/x/tools/go/packages"
)
func main() {
var l linter
steps := []struct {
name string
fn func() error
}{
{"init linter", l.init},
{"parse flags", l.parseFlags},... |
package client
import (
"context"
"fmt"
"net/http"
"strings"
"time"
gh "github.com/google/go-github/v24/github"
"golang.org/x/oauth2"
)
type ActivityType int
const (
NonInteresting ActivityType = iota
OpenedIssue
ClosedIssue
CommentedIssue
OpenedPullRequest
ReopenedPullRequest
EditedPullRequest
Close... |
// Copyright (c) 2016, 2018, 2022, 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... |
/*
* Copyright IBM Corp. 2018 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 ... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package connect
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
"github.com/aws/aws-sdk-go-v2/private/protocol"
)
type SuspendContactRecordingInput struct {
_ struct{} `type:"structure"`
... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.25.0
// protoc v3.14.0
// source: entity/request.proto
package grpc
import (
proto "github.com/golang/protobuf/proto"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runti... |
package routes
import (
"context"
"database/sql"
"doubleboiler/config"
"doubleboiler/models"
"net/http"
"strings"
"github.com/gorilla/mux"
)
func init() {
r.Path("/create-organisation").
Methods("GET").
HandlerFunc(organisationCreationFormHandler)
r.Path("/organisations").
Methods("POST").
HandlerF... |
/*
Copyright 2016 <NAME> <<EMAIL>>
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... |
package stream
import (
"fmt"
"io"
"os"
"strings"
"github.com/gookit/color"
"golang.org/x/crypto/ssh/terminal"
"github.com/werf/logboek/internal/stream/fitter"
"github.com/werf/logboek/pkg/types"
)
const defaultWidth = 140
type Stream struct {
io.Writer
*StateAndModes
}
func NewStream(w io.Writer, state... |
package goconcurrentqueue
import (
"context"
"fmt"
"sync"
"time"
)
const (
WaitForNextElementChanCapacity = 1000
dequeueOrWaitForNextElementInvokeGapTime = 10
)
// FIFO (First In First Out) concurrent queue
type FIFO struct {
slice []interface{}
rwmutex sync.RWMutex
lockRWmutex sync.RWMu... |
package zgok
import (
"bytes"
"encoding/binary"
"fmt"
)
const (
APP_BYTE_SIZE = 8 // Byte size of the signature app field.
SIGNATURE_BYTE_SIZE = 64 // Byte size of the signature.
)
// Signature interface.
type Signature interface {
ExeSize() int64
SetExeSize(exeSize int64)
ZipSize() int64
SetZipSize(... |
package tree
import (
"errors"
)
const wildcard = "*"
var errNoNilValuesAllowed = errors.New("no nil values allowed")
// Tree is a wrapper over tha root node od a tree
type Tree struct {
root *node
}
// New returns a new Tee containning a decomposed version of v
func New(v interface{}) (*Tree, error) {
if v == ... |
/*
Copyright (c) Huawei Technologies Co., Ltd. 2021.
kunpengsecl licensed under the Mulan PSL v2.
You can use this software according to the terms and conditions of
the Mulan PSL v2. You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOU... |
/*
Copyright 2021 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, ... |
// Copyright 2016 The Vanadium 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 vine contains a discovery plugin that is using Vine protocol.
//
// This plugin is for testing Vanadium applications under unpredictable and
//... |
package ui
import (
"net/http"
"github.com/supergiant/supergiant/pkg/client"
"github.com/supergiant/supergiant/pkg/model"
)
//NewKube holds default inffo for the UI kubes object.
func NewKube(sg *client.Client, w http.ResponseWriter, r *http.Request) error {
// TODO we shouldn't use a map for the model, because... |
package log
import (
"database/sql"
"log"
"strings"
"time"
"github.com/johnweldon/go-misc/util"
)
type RelDB struct {
dbpath string
ensured bool
db *sql.DB
}
func NewRelDB(path string) *RelDB {
return &RelDB{dbpath: path, ensured: false, db: nil}
}
func (d *RelDB) Open() func() {
if d.db != nil {
... |
package configuration
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net"
"os"
"strconv"
"strings"
)
const (
envChainType = "CHAINTYPE"
envConfigPath = "CONFIGPATH"
envBootStrapIP = "BOOTSTRAPIP"
envNodeIP = "NODEIP"
envNodePort = "NODEPORT"
envGethPool = "GETHPOOL"
defa... |
// Copyright (C) 2021 Gridworkz Co., Ltd.
// KATO, Application Management Platform
// 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 r... |
package rpc
import (
"context"
"fmt"
"mime"
"net/http"
"path"
"strings"
"sync"
"time"
"github.com/golang/protobuf/jsonpb"
"github.com/peterebden/go-cli-init"
"github.com/prometheus/client_golang/prometheus"
"github.com/thought-machine/please-servers/grpcutil"
pb "github.com/thought-machine/please-server... |
/*
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License ... |
package conf
import (
"time"
)
// Titan configuration center
type Titan struct {
Server Server `cfg:"server"`
Status Status `cfg:"status"`
Tikv Tikv `cfg:"tikv"`
TikvLog TikvLogger `cfg:"tikv-logger"`
Logger Logger `cfg:"logger"`
PIDFileName string `cfg:"pid-file... |
package maven
import (
"sort"
"testing"
)
func TestParseVersion(t *testing.T) {
_, err := ParseVersion("foobar")
if err == nil {
t.Errorf("foobar should not be pased correctly as a version")
}
version, err := ParseVersion("1.2.3")
if err != nil {
t.Errorf("err")
panic(err)
}
if version.Major != 1 {
... |
package metrix
import (
"bufio"
"io"
"os"
"strings"
)
func LoadMeminfo() (*Meminfo, error) {
defer benchmark("load meminfo")()
f, e := os.Open("/proc/meminfo")
if e != nil {
return nil, e
}
defer f.Close()
m := &Meminfo{}
return m, m.Load(f)
}
type Meminfo struct {
MemTotal int64 `json:"mem_to... |
package backend
import (
"encoding/json"
"fmt"
"net/http/cookiejar"
"sort"
"strings"
"time"
"github.com/tstromberg/campwiz/pkg/cache"
"github.com/tstromberg/campwiz/pkg/campwiz"
"github.com/tstromberg/campwiz/pkg/mangle"
"k8s.io/klog/v2"
)
// RCaliforniaAdv handles RCaliforniaAdv queries
type RCaliforniaAd... |
package controller
import (
"fmt"
"time"
"github.com/lterrac/edge-autoscaler/pkg/system-controller/pkg/delayclient"
eaclientset "github.com/lterrac/edge-autoscaler/pkg/generated/clientset/versioned"
eascheme "github.com/lterrac/edge-autoscaler/pkg/generated/clientset/versioned/scheme"
"github.com/lterrac/edge-... |
package vbox
/*
#cgo CFLAGS: -I third_party/VirtualBoxSDK/sdk/bindings/c/include
#cgo CFLAGS: -I third_party/VirtualBoxSDK/sdk/bindings/c/glue
#cgo LDFLAGS: -ldl -lpthread
#include "VBoxCAPIGlue.h"
*/
import "C" // cgo's virtual package
// Enumeration of AccessMode values
type AccessMode uint
const (
// Open the ... |
package local
import (
"context"
"net"
"sync"
"sync/atomic"
"github.com/pkg/errors"
"github.com/srvc/ery/pkg/domain"
"github.com/srvc/ery/pkg/util/netutil"
)
// NewMappingRepository creates a new MappingRepository instance that can access local data.
func NewMappingRepository() domain.MappingRepository {
re... |
package writers
import (
"fmt"
"os"
"path"
"path/filepath"
"strings"
generate "github.com/rur/ttgen"
)
type htmlBlockPartialData struct {
Path string
Name string
Fragment bool
Default bool
POSTOnly bool
}
type htmlBlockData struct {
FieldName string
Identifier string
Name string
Parti... |
//
// This source file is part of the carousell/aggproto open source project
//
// Copyright © 2021 Carousell and the project authors
// Licensed under Apache License v2.0
//
// See https://github.com/carousell/aggproto/blob/master/LICENSE for license information
// See https://github.com/carousell/aggproto/graphs... |
// Data structures and methods relating to a single peer. The peer object is
// intended for local use through a Network object only. With the exception of
// the read-only methods MostRecentActivity(), Quality() and
// String(), methods should not be called concurrently.
package network
import (
"fmt"
"log"
"time... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.