text stringlengths 3.08k 10.4k |
|---|
package testdb
import (
"context"
"fmt"
"reflect"
"testing"
"github.com/DATA-DOG/go-sqlmock"
"github.com/kyma-incubator/compass/components/director/pkg/apperrors"
"github.com/kyma-incubator/compass/components/director/pkg/persistence"
"github.com/pkg/errors"
"github.com/stretchr/testify/require"
)
// RepoD... |
package participation
import (
"encoding/json"
"fmt"
"github.com/iotaledger/hive.go/serializer/v2"
)
const (
QuestionTextMaxLength = 255
QuestionAdditionalInfoMaxLength = 500
QuestionMinAnswersCount = 2
QuestionMaxAnswersCount = 10
)
var (
answersArrayRules = &serializer.ArrayRules{
Min: ... |
package main
import (
"errors"
"log"
"os"
"sort"
"strconv"
"strings"
"github.com/remind101/empire/pkg/heroku"
)
var listMode bool
var cmdScale = &Command{
Run: maybeMessage(runScale),
Usage: "scale [-l] <type>=[<qty>]:[<size>]...",
NeedsApp: true,
OptionalMessage: true,
Cate... |
package fat2
import (
"encoding/json"
"fmt"
"github.com/Factom-Asset-Tokens/factom"
"github.com/Factom-Asset-Tokens/fatd/fat"
"github.com/Factom-Asset-Tokens/fatd/fat/jsonlen"
)
// TransactionBatch represents a fat2 entry, which can be a list of one or more
// transactions to be executed in order
type Transacti... |
package commands
import (
"errors"
"fmt"
"os"
"path/filepath"
"regexp"
"github.com/codegangsta/cli"
"github.com/docker/machine/commands/mcndirs"
"github.com/docker/machine/drivers/driverfactory"
"github.com/docker/machine/libmachine"
"github.com/docker/machine/libmachine/auth"
"github.com/docker/machine/li... |
// Copyright © 2018 <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 importer
import (
"fmt"
"go/ast"
"go/token"
stdtypes "go/types"
"sort"
stdstrings "strings"
"github.com/swipe-io/swipe/pkg/astcopy"
"golang.org/x/tools/go/ast/astutil"
"golang.org/x/tools/go/packages"
)
type ImportInfo struct {
Name string
Differs bool
}
type Importer struct {
pkg *packa... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package types
type DomainStatus string
// Enum values for DomainStatus
const (
DomainStatusActive DomainStatus = "Active"
DomainStatusDeleted DomainStatus = "Deleted"
)
// Values returns all known values for DomainStatus. Note that this can be expanded
// in th... |
package cp
import "fmt"
//Draw flags
const (
DRAW_SHAPES = 1 << 0
DRAW_CONSTRAINTS = 1 << 1
DRAW_COLLISION_POINTS = 1 << 2
)
// 16 bytes
type FColor struct {
R, G, B, A float32
}
type Drawer interface {
DrawCircle(pos Vector, angle, radius float64, outline, fill FColor, data interface{})
DrawSe... |
package handlers
import (
"fmt"
"testing"
"github.com/rancher/go-machine-service/handlers/providers"
"github.com/rancher/go-rancher/v3"
)
// Test the filterDockerMessage to make sure are filtering the right messages
func TestFilterDockerMessages(t *testing.T) {
errChan := make(chan string, 2)
defer close(errCh... |
// *** WARNING: this file was generated by the Pulumi SDK Generator. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package v20160930
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type ContainerService struct {
pulumi.C... |
package main
import (
"bufio"
"crypto/tls"
"flag"
"fmt"
"log"
"net"
"net/http"
"net/http/httputil"
"net/url"
"os"
"path"
"strings"
"time"
)
func main() {
fs := flag.NewFlagSet("bbgoget", flag.ExitOnError)
var (
listenAddr string
)
bbh := &BBHandler{}
fs.StringVar(&listenAddr, "listen-address", "... |
//
// Copyright 2019 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 applica... |
package spectrum
import (
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"path"
"regexp"
"strings"
)
var (
fileSuffixes = []string{".tap.zip", ".sna.zip", ".z80.zip"}
baseURL = "http://www.worldofspectrum.org/"
queryBaseURL = baseURL + "infoseek.cgi?"
)
func knownType(filename string) bool {
for _, suff... |
// Copyright 2020 Thinkium
//
// 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... |
/*
Code to call the IBM IAM Services and get a session object that will be used by the Power Colo Code.
*/
package ibmpisession
import (
"bytes"
"crypto/tls"
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"strings"
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
"github... |
// Package web provides a web.go compitable layer for reusing the code written with
// hoisie's `web.go` framework. Basiclly this package add web.Context to
// martini's dependency injection system.
package web
import (
"bytes"
"crypto/hmac"
"crypto/sha1"
"encoding/base64"
"fmt"
"github.com/codegangsta/martini"
... |
//
// xlsx2json package wraps the github.com/tealag/xlsx package (used under a BSD License) and a fork of <NAME>'s Otto
// Javascript engine (under an MIT License) providing an scriptable xlsx2json exporter, explorer and importer utility.
//
//
// Overview: A command line utility designed to take a XML based Excel fil... |
// Copyright 2015-2018 the u-root 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 main
import (
"bytes"
"crypto/sha256"
"fmt"
"io"
"io/ioutil"
"os"
"os/exec"
"path/filepath"
"testing"
"github.com/u-root/u-root/pkg/... |
// Copyright 2016-2021, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or... |
/*
Copyright (c) 2010 <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, merge, publish,
distribute, sublice... |
// Package tag provides Tag abstraction to handle Docker tags (images)
// and their differences between remote registries and Docker daemon,
// i.e. what tags ara available in remote Docker registry, do we have them pulled
// in our local system, or do we have the same tags in our own local registry etc.
package tag
i... |
package cgminer
import (
"context"
"errors"
"fmt"
"strconv"
)
// Version returns version information
//
// For context-based requests use `VersionContext()`
func (c *CGMiner) Version() (*Version, error) {
return c.VersionContext(context.Background())
}
// VersionContext returns version information using provide... |
/*
Copyright 2019 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, ... |
package aws
import (
"fmt"
"log"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/hashicorp/aws-sdk-go-base/tfawserr"
"github.com/hashicorp/terraform-plugin-sdk/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
tfec2 "github.com/terraform-providers/t... |
package fuse
import (
"context"
iofs "io/fs"
"os"
"path/filepath"
"strings"
"github.com/go-yaml/yaml"
"github.com/hanwen/go-fuse/v2/fs"
"github.com/hanwen/go-fuse/v2/fuse"
"git.backbone/corpix/gpgfs/pkg/errors"
"git.backbone/corpix/gpgfs/pkg/log"
)
type (
Fuse struct {
fs.Inode
log log.Logger
k... |
// Copyright 2019 Google Inc. All Rights Reserved.
// This file is available under the Apache license.
// +build integration
package mtail_test
import (
"fmt"
"path"
"testing"
"time"
"net"
"net/http"
"os"
"runtime"
"context"
"bytes"
"encoding/json"
"github.com/golang/glog"
"github.com/google/mtail/inter... |
package tests
import (
"encoding/json"
"io/ioutil"
"math/big"
"strings"
"testing"
"github.com/hashicorp/go-hclog"
"github.com/umbracle/fastrlp"
"github.com/0xPolygon/polygon-edge/chain"
"github.com/0xPolygon/polygon-edge/helper/hex"
"github.com/0xPolygon/polygon-edge/helper/keccak"
"github.com/0xPolygon/p... |
package promela
import (
"errors"
"go/ast"
"go/token"
"github.com/nicolasdilley/gomela/promela/promela_ast"
)
func (m *Model) translateIfStmt(s *ast.IfStmt) (b *promela_ast.BlockStmt, defers *promela_ast.BlockStmt, err *ParseError) {
b = &promela_ast.BlockStmt{List: []promela_ast.Stmt{}}
defers = &promela_ast.... |
/*
Copyright 2018 ZTE Corporation. 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 wr... |
package sql
import (
"database/sql"
"time"
"github.com/influxdata/flux"
"github.com/influxdata/flux/execute"
"github.com/influxdata/flux/values"
_ "github.com/uber/athenadriver/go"
)
// AWS Athena support.
// Notes:
// * transactions are not supported by Athena
// * only `sql.from` is supported, as the purpose... |
package ifsc
import (
"bytes"
"encoding/json"
"errors"
"io/ioutil"
"net/http"
"testing"
"github.com/razorpay/ifsc/v2/src/go/mocks"
"github.com/stretchr/testify/assert"
)
func getIfscResponse() *IFSCResponse {
bytes := []byte(`{"bank": "Kotak Mahindra Bank",
"branch": "GURGAON",
"center": "GURGAON",
"dist... |
// Code generated by go-swagger; DO NOT EDIT.
package workflows
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"net/http"
"time"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.co... |
package main
import (
"context"
"crypto/tls"
"encoding/json"
"fmt"
"net/http"
"net/http/httputil"
"net/url"
"regexp"
"strings"
"github.com/sirupsen/logrus"
check "github.com/adevinta/vulcan-check-sdk"
"github.com/adevinta/vulcan-check-sdk/state"
"github.com/adevinta/vulcan-checks/cmd/vulcan-exposed-http... |
// Copyright 2020 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, ... |
// Copyright 2016-2021, Pulumi Corporation.
package cf2pulumi
import (
"strings"
"unicode"
"unicode/utf8"
"github.com/goccy/go-yaml/ast"
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/hcl/v2/hclsyntax"
"github.com/pulumi/pulumi/pkg/v3/codegen/hcl2/model"
"github.com/zclconf/go-cty/cty"
)
// camel repla... |
package model
import (
"database/sql/driver"
"errors"
"github.com/gofrs/uuid"
"github.com/json-iterator/go"
"strings"
"time"
)
// BotState Bot状態
type BotState int
const (
// BotInactive ボットが無効化されている
BotInactive BotState = 0
// BotActive ボットが有効である
BotActive BotState = 1
// BotPaused ボットが一時停止されている
BotPause... |
// Copyright 2022 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 agree... |
package josejwt_test
import (
"context"
"errors"
"fmt"
"path"
"time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
jose "gopkg.in/square/go-jose.v2"
// . "github.com/naveego/vault-jose-plugin/plugin"
"github.com/SermoDigital/jose/jws"
"github.com/hashicorp/vault/sdk/logical"
logicaltest "github... |
package access_token_dto
import (
"fmt"
"github.com/golanshy/plime_core-go/data_models/user_dto"
"github.com/golanshy/plime_core-go/logger"
"github.com/golanshy/plime_core-go/utils/date_utils"
"github.com/golanshy/plime_core-go/utils/rest_errors"
"math/rand"
"os"
"strconv"
"strings"
"time"
)
const (
TokenT... |
package moodle
import (
errors "../errorcodes"
files "../files"
"../helpers"
"crypto/md5"
"encoding/hex"
"strings"
)
// NewUser authenticates the user, stores its information in the DB
// and returns the token if it was successfull
// If location is an empty string, it will automatically store to the default
//... |
// Package flow showcases a test with a more complex test structure using the
// flow module. It consists of three sequential stages, with most sub-tests in
// each stage running in parallel.
package flow
import (
"encoding/json"
"flag"
"fmt"
"sync/atomic"
"testing"
"time"
cb "github.com/clearblade/Go-SDK"
"g... |
package cmd
import (
golog "log"
"os"
"github.com/pkg/errors"
"github.com/spf13/afero"
"github.com/spf13/cobra"
"github.com/spf13/viper"
"go.uber.org/zap"
_ "k8s.io/client-go/plugin/pkg/client/auth/oidc" // from https://github.com/kubernetes/client-go/issues/345
"sigs.k8s.io/controller-runtime/pkg/manager"
... |
package export
import (
"fmt"
"testing"
"github.com/porfirion/trie"
)
type T = trie.Trie
func ExampleExport() {
example := &T{Prefix: []byte{0xF0, 0x9F, 0x91}, Value: "short", Children: &[256]*T{
0x10: {Prefix: []byte{0x10}, Value: "modified"},
0xA8: {Prefix: []byte{0xA8}, Value: "nokey", Children: &[256]*T... |
//go:build windows
// +build windows
package enforcer
import (
"fmt"
"sync"
"time"
"github.com/gentlemanautomaton/winsession"
"github.com/gentlemanautomaton/winsession/connstate"
"github.com/scjalliance/resourceful/enforcerui"
"github.com/scjalliance/resourceful/lease"
"github.com/scjalliance/resourceful/pol... |
package message
import (
"io"
blocks "github.com/ipfs/go-ipfs/blocks"
key "github.com/ipfs/go-ipfs/blocks/key"
pb "github.com/ipfs/go-ipfs/exchange/bitswap/message/pb"
wantlist "github.com/ipfs/go-ipfs/exchange/bitswap/wantlist"
inet "gx/ipfs/QmUBogf4nUefBjmYjn6jfsfPJRkmDGSeMhNj4usRKq69f4/go-libp2p/p2p/net"
g... |
package frontend
import (
//"fmt"
e "github.com/daniloanp/IA/environment"
walk "github.com/daniloanp/IA/pathThroughMap"
fights "github.com/daniloanp/IA/templeFights"
allegro "github.com/dradtke/go-allegro/allegro"
font "github.com/dradtke/go-allegro/allegro/font"
prim "github.com/dradtke/go-allegro/allegro/prim... |
package client
import (
"bytes"
"context"
"io"
"strings"
"time"
"go.uber.org/zap"
core_v1 "k8s.io/api/core/v1"
v1 "k8s.io/api/core/v1"
k8s_errors "k8s.io/apimachinery/pkg/api/errors"
meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1"
k8s_client "k8s.io/client-go/kubernetes"
)
func ListPods(
lg *zap.Logger,
... |
package utils
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/md5"
"crypto/rand"
"crypto/sha1"
"encoding/base64"
"encoding/hex"
"fmt"
"github.com/astaxie/beego"
"github.com/axgle/mahonia"
"io"
math_rand "math/rand"
"net/url"
"time"
)
// Guid
func NewGuid() string {
b := make([]byte, 48)
if _, e... |
// Copyright 2019 <NAME>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writi... |
package dbop
import (
"database/sql"
)
type AccessInfo struct {
Host string `db:"Host"`
Port int `db:"Port"`
User string `db:"User"`
Password string `db:"Password"`
}
// MySQLInstanceStatus defines the observed state of a MySQL instance
type MySQLInstanceStatus struct {
IsErrant bool
Glo... |
package sync
import (
"bytes"
"encoding/json"
"fmt"
"log"
"net/http"
"time"
"github.com/gorilla/websocket"
gomatrix "commune/gomatrix"
)
var upgrader = websocket.Upgrader{
ReadBufferSize: 1024,
WriteBufferSize: 1024,
}
const (
// Time allowed to write a message to the peer.
writeWait = 10 * time.Secon... |
package main
import (
"net"
"fmt"
"net/rpc"
"log"
"encoding/pem"
"os"
"bufio"
"crypto/rsa"
"crypto/x509"
"crypto/rand"
"bytes"
"errors"
)
type Produto struct{
Nome, Id, Categoria, Descricao string
Preco float32
Quantidade int
}
type Novo struct{
P1,P2 Produto
}
type Usuario struct {
Login, Senha []... |
package api
import (
"fmt"
"github.com/labstack/echo"
"github.com/lithictech/go-aperitif/api/apiparams"
"github.com/lithictech/go-aperitif/logctx"
"github.com/sirupsen/logrus"
"net/http"
"runtime"
"strconv"
"time"
)
func unconfiguredLogger() *logrus.Entry {
return logrus.New().WithField("unconfigured_logger... |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
/*
Copyright 2021 NDD.
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
distribute... |
package prs
import (
"os"
"fmt"
"gorec/ast"
"gorec/token"
"gorec/types"
)
type precedence int
const (
COMPARE_PRECEDENCE precedence = 0
ADD_SUB_PRECEDENCE precedence = 1
MUL_DIV_PRECEDENCE precedence = 2
EXP_ROOT_PRECEDENCE precedence = 3
PAREN_PRECEDENCE precedence = 4
)... |
package main
import (
"bufio"
"encoding/json"
"errors"
"flag"
"fmt"
"log"
"os"
"path"
"strings"
"sync"
"github.com/logrusorgru/aurora/v3"
"github.com/signedsecurity/sigrawl3r/internal/options"
"github.com/signedsecurity/sigrawl3r/internal/runner"
)
type Options struct {
noColor bool
silent bool
URLs... |
package create_projects
import (
"bytes"
"crypto/tls"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"path"
"runtime"
"strings"
"testing"
"time"
"github.com/opendevstack/ods-core/tests/utils"
v1 "github.com/openshift/api/build/v1"
buildClientV1 "github.com/openshift/client-go/build/clientset/versioned/typ... |
package server
import (
"strings"
"sync"
"github.com/golang/glog"
"github.com/neoul/gnxi/utilities/status"
"github.com/neoul/gnxi/utilities/xpath"
gnmipb "github.com/openconfig/gnmi/proto/gnmi"
"google.golang.org/grpc/codes"
)
type aliasEntry struct {
name string
path string
gpath *gnmipb.Path
... |
package linkedlist
/*
链表是一种递归结构,它或为空(nil)或是指向一个节点(node)的指针,
该节点含有一个泛型的元素和一个指向另一条链表的指针。
1.理解指针
2.警惕指针丢失和内存泄漏
3.利用哨兵简化实现难度
4.注意边界条件处理
5.举例画图辅助思考
*/
import (
"fmt"
)
type SingleNode struct {
Value int
next *SingleNode
}
func NewSingleNode(value int) *SingleNode {
return &SingleNode{Value: value, next: ... |
package eventRouting
import (
"fmt"
"sort"
"strings"
"sync"
"github.com/SumoLogic/sumologic-cloudfoundry-nozzle/caching"
"github.com/SumoLogic/sumologic-cloudfoundry-nozzle/eventQueue"
fevents "github.com/SumoLogic/sumologic-cloudfoundry-nozzle/events"
"github.com/cloudfoundry/sonde-go/events"
)
type EventRo... |
package tty
import (
"errors"
"fmt"
"net"
"net/rpc"
"os"
"path"
"time"
"github.com/docker/docker/pkg/namesgenerator"
"github.com/golang/glog"
"github.com/yubo/gotty/rec"
)
type Cmd int
func (c *Cmd) Ps(arg *CallOptions, reply *[]Session_info) error {
for _, session := range daemon.session {
info := Ses... |
package main
import (
"encoding/json"
"flag"
"fmt"
"github.com/streadway/amqp"
"io"
"log"
"strings"
"time"
)
var (
uri = flag.String("uri", "amqp://guest:guest@localhost:5672/", "AMQP URI")
exchange = flag.String("exchange", "signal-exchange", "Durable, non-auto-deleted AMQP exchange name")
ex... |
package actions
import (
"errors"
"fmt"
"github.com/mitchellh/mapstructure"
"io"
"net/http"
"net/http/httptest"
"reflect"
"testing"
)
func getTestServer(resourcePath, body string) (*httptest.Server, error) {
if isJSONString(body) == false {
return nil, errors.New("specifed body does not have json format")
... |
package gomongo
import (
"errors"
"log"
"time"
circuit "github.com/rubyist/circuitbreaker"
"gopkg.in/mgo.v2"
)
// Regenerate status for circuitbreaker
var Regenerate = "regenerate"
// Success status for circuitbreaker
var Success = "success"
// Fail status for circuitbreaker
var Fail = "fail"
// MongoOptions... |
package fake
import (
"context"
"fmt"
"html"
"net/http"
"strings"
"sync"
"time"
)
// Handler implements a fake Sciensano server
type Handler struct {
Fail bool
Slow bool
Responses map[string]string
Count int
lock sync.Mutex
}
// Handle processes an incoming HTTP request
func (handler *... |
package integration
import (
"net/http/httptest"
"os"
"time"
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
vegeta "github.com/tsenart/vegeta/lib"
)
const routerLatencyThreshold = 20 * time.Millisecond
var _ = Describe("Performance", func() {
Context("two healthy backends", func() {
var (
backen... |
package main
import (
"context"
"crypto/rand"
"encoding/base64"
"encoding/json"
"fmt"
"io/ioutil"
"log"
"net/http"
"net/url"
"time"
"github.com/go-chi/chi"
"github.com/go-chi/chi/middleware"
"github.com/go-chi/render"
"golang.org/x/oauth2"
"golang.org/x/oauth2/google"
"github.com/maskarb/skarbek-dev/... |
package container
import (
"bytes"
"fmt"
"strings"
"text/tabwriter"
"github.com/olshevskiy87/dockerate/docker"
"github.com/docker/docker/api/types"
"github.com/reconquest/loreley"
)
const (
IDMinWidth = 12
ImageTagMinWidth = 12
CommandMinWidth = 20
StatusUpStr = "Up"
)
type List struct {
tabBuf... |
// -----------------------------------------------------------------------------
// ZR Library zr/[bytes.go]
// (c) <EMAIL> License: MIT
// -----------------------------------------------------------------------------
package zr
... |
package aicra
import (
"context"
"errors"
"fmt"
"net/http"
"strings"
"github.com/xdrm-io/aicra/api"
"github.com/xdrm-io/aicra/internal/config"
"github.com/xdrm-io/aicra/internal/ctx"
"github.com/xdrm-io/aicra/internal/reqdata"
)
// Handler wraps the builder to handle requests
type Handler Builder
// ServeH... |
package cmd
import (
"io/ioutil"
"os"
"github.com/Sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/emc-advanced-dev/pkg/errors"
"github.com/emc-advanced-dev/unik/pkg/client"
unikos "github.com/emc-advanced-dev/unik/pkg/os"
)
var name, sourcePath, base, lang, provider, runArgs string
var mountPoints []st... |
package dmr
import (
"errors"
"fmt"
"github.com/polkabana/go-dmr/crc/quadres_16_7"
)
// EMB LCSS fragments.
const (
SingleFragment uint8 = iota
FirstFragment
LastFragment
Continuation
)
// LCSSName is a map of LCSS fragment type to string.
var LCSSName = map[uint8]string{
SingleFragment: "single fragment",
... |
package core_test
import (
"fmt"
"path"
"testing"
"github.com/APTrust/dart-runner/bagit"
"github.com/APTrust/dart-runner/constants"
"github.com/APTrust/dart-runner/core"
"github.com/APTrust/dart-runner/util"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)
func getTestWorkflow(t ... |
package output
import (
"fmt"
"io"
"os"
"github.com/logrusorgru/aurora"
"github.com/open-policy-agent/opa/tester"
"github.com/open-policy-agent/opa/topdown"
"github.com/open-policy-agent/opa/topdown/lineage"
)
// Standard represents an Outputter that outputs
// results in a human readable format.
type Standar... |
package deploy
import (
"fmt"
"os"
"time"
"github.com/flant/kubedog/pkg/kube"
"github.com/flant/werf/cmd/werf/common"
"github.com/flant/werf/cmd/werf/common/docker_authorizer"
"github.com/flant/werf/pkg/deploy"
"github.com/flant/werf/pkg/docker"
"github.com/flant/werf/pkg/lock"
"github.com/flant/werf/pkg/pr... |
/*
*
* Copyright 2017 gRPC authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... |
package api_tests_test
import (
"github.com/VerifyTests/Verify.Go/verifier"
"github.com/google/uuid"
"strings"
"testing"
"time"
)
type Person struct {
GivenNames string `json:"given_names"`
FamilyName string `json:"family_name"`
Spouse string `json:"spouse"`
Address Address `json:"address"`... |
package api
import (
"time"
"github.com/volatiletech/null/v8"
)
type ListRequest struct {
PageNumber int `json:"page_no" form:"page_no" binding:"omitempty,min=1"`
PageSize int `json:"page_size" form:"page_size" binding:"omitempty,min=1"`
OrderBy string `json:"order_by" form:"order_by" binding:"omitem... |
package cleanid3
import (
"fmt"
"github.com/bogem/id3v2/v2"
"github.com/golang/glog"
)
// Frame interface unifying the basic functions we need accross frame
// types.
type Frame interface {
// Log tag name and all important details for this frame.
Log(string)
// Update the tag with new frame information.
Upda... |
package config
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"os"
"path/filepath"
"strings"
"sync"
"github.com/fsnotify/fsnotify"
"github.com/mitchellh/mapstructure"
"github.com/pkg/errors"
"github.com/spf13/cast"
"gopkg.in/yaml.v2"
)
type Config struct {
folder string
lock sync.RWMutex
env map[strin... |
package executor
import (
"io/ioutil"
"os"
"path/filepath"
rt "runtime"
"strings"
"github.com/gobuffalo/packr"
"github.com/ActiveState/cli/internal/exeutils"
"github.com/ActiveState/cli/pkg/platform/runtime/envdef"
"github.com/ActiveState/cli/internal/appinfo"
"github.com/ActiveState/cli/internal/errs"
"... |
//
// Copyright (c) 2014-2019 Cesanta Software Limited
// 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
//
// Un... |
/*
* Copyright (c) 2019, salesforce.com, inc.
* All rights reserved.
* SPDX-License-Identifier: BSD-3-Clause
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
*/
package typed
import (
"github.com/dgraph-io/badger"
"github.com/salesforce/sloop/pkg/sl... |
// Copyright 2019 Anapaya Systems
//
// 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 irrigation
import (
"lacima.com/go_setup_containers/site_generation_base/site_generation_utilities"
)
func Construct_eto_data(){
su.Bc_Rec.Add_header_node("WEATHER_DATA_STRUCTURE","WEATHER_DATA_STRUCTURE",make(map[string]interface{}))
su.Bc_Rec.Add_header_node("ROLL_OVER","ROLL... |
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you ... |
package webhook
import (
"encoding/json"
"time"
"github.com/starshine-sys/pkgo/v2"
)
type UnknownEventData struct {
json.RawMessage
}
var _ Event = (*UnknownEventData)(nil)
func (*UnknownEventData) Type() DispatchEventType {
return UnknownEventType
}
type PingEventData struct{}
var _ Event = (*PingEventData... |
package day22
import (
"container/heap"
"errors"
"fmt"
. "github.com/dr-horv/advent-of-code-2018/internal/pkg"
"math"
)
func Dijkstra(start State, goal State, world map[Coordinate]CavernType) (Path, error) {
tentativeDistances := mapWithDefault{make(map[State]int), math.MaxInt64}
tentativeDistances.set(start,... |
// Copyright (c) 2021-2022 Nordix Foundation.
//
// Copyright (c) 2022 Doc.ai and/or its affiliates.
//
// SPDX-License-Identifier: Apache-2.0
//
// 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... |
// MIT License
// Copyright (c) 2020 <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, merge, p... |
package main
import (
"bufio"
"encoding/json"
"fmt"
"io"
"os"
"strconv"
"strings"
"time"
)
// parsing of usage.txt, stats based on that
const (
// OsUnknown is default value for when os type is missing
OsUnknown = 0
// OsMac means running on Mac
OsMac = 1
// OsWindows running on Windows
OsWindows = 2
)... |
// This file was generated for SObject ContentVersion, API Version v43.0 at 2018-07-30 03:47:31.168644141 -0400 EDT m=+17.511907673
package sobjects
import (
"fmt"
"strings"
)
type ContentVersion struct {
BaseSObject
Checksum string `force:",omitempty"`
ContentBodyId string `force:",omite... |
package main
import (
"context"
"flag"
"fmt"
"os"
"runtime/pprof"
"strings"
"sync"
"time"
"github.com/zoomio/tagify"
)
var (
version = "tip"
source = flag.String("s", "", "source, could be URL (e.g. http://... and https://...) or file path")
query = flag.String("q", "", "DOM C... |
// Copyright 2020 cloudeng llc. All rights reserved.
// Use of this source code is governed by the Apache-2.0
// license that can be found in the LICENSE file.
package main
import (
"context"
"fmt"
"os"
"strings"
"time"
"cloudeng.io/algo/container/heap"
"cloudeng.io/cmdutil"
"cloudeng.io/errors"
"cloudeng.i... |
package k8s
import (
"errors"
"fmt"
"strconv"
"strings"
"sync"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/util/retry"
)
// TCPPortMapping is a TCPPortMapper backed by a Kubernetes ConfigMap.
type TCPPortMapping struct {
mu sync.RWMutex
table map[int32]... |
package notifications
import (
"fmt"
"firebase.google.com/go/messaging"
poststypes "github.com/desmos-labs/desmos/v2/x/staging/posts/types"
"github.com/desmos-labs/djuno/types"
postsutils "github.com/desmos-labs/djuno/x/posts/utils"
)
const (
LikeReactionValue = ":heart:"
NotificationTypeKey = "type"
TypeC... |
// Package wizards implements the OAuth2 protocol for authenticating users through Wizards of the Coast "Platform".
// This package can be used as a reference implementation of an OAuth2 provider for Wizards.
package wizards
import (
"encoding/json"
"io"
"net/http"
"fmt"
"github.com/markbates/goth"
"golang.org... |
package pkg
import (
"bytes"
"encoding/binary"
"fmt"
"github.com/denysvitali/ca-combos-editor/pkg/parsers"
"github.com/denysvitali/ca-combos-editor/pkg/readers"
"github.com/denysvitali/ca-combos-editor/pkg/types"
"github.com/sirupsen/logrus"
"io/ioutil"
"os"
"sort"
)
var Log = logrus.New()
type ComboEdit s... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.