text stringlengths 10 1.05M |
|---|
package wallet
import (
"encoding/hex"
"fmt"
"github.com/tdex-network/tdex-daemon/pkg/bufferutil"
"github.com/tdex-network/tdex-daemon/pkg/explorer"
"github.com/vulpemventures/go-elements/network"
"github.com/vulpemventures/go-elements/pset"
"github.com/vulpemventures/go-elements/transaction"
)
// CreateTx cr... |
package glog
import (
"testing"
"time"
log "github.com/kdar/factorlog"
)
var fmtTestsContext = log.LogContext{
Time: time.Unix(0, 1389223634123456789).In(time.UTC),
Severity: log.PANIC,
File: "path/to/testing.go",
Line: 391,
Format: nil,
Args: []interface{}{"hello there!"},
Function: "som... |
package config
import "os"
// BoombotCreds defines auth structure for boombot
type BoombotCreds struct {
BotToken string `json:"BOT_TOKEN"`
YoutubeToken string `json:"YOUTUBE_TOKEN"`
}
// GetSecrets retrieves all tokens required by the bot via AWS SecretsManager
func GetSecrets() (*BoombotCreds, error) {
var ... |
package ecs
//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
//distribut... |
package container
import (
"gorm.io/driver/sqlite"
"gorm.io/gorm"
"log"
"net/http"
)
var C *Container
type Container struct {
DB *DB
Api *Api
}
type DB struct {
*gorm.DB
}
type Api struct {
*http.Client
}
func InitContainer() {
C = NewDefaultContainer()
}
func NewDefaultContainer() *Container {
db, er... |
// Copyright (c) 2018 Hervé Gouchet. All rights reserved.
// Use of this source code is governed by the MIT License
// that can be found in the LICENSE file.
package gtk
import (
"github.com/gotk3/gotk3/glib"
"github.com/rvflash/safe"
)
// DataTable ...
type DataTable interface {
Cols() []string
ColSizes() []int... |
/*
Copyright 2021 The Vitess Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, soft... |
// +build lms_integration
package lms
import (
"crypto/x509/pkix"
"os"
"testing"
"github.com/sirupsen/logrus"
)
// This file contains tests to test real calls to LMS. It must not be run in the `make verify` stage.
// The purpose of the test is to perform calls during development cycle
// Run the test with the f... |
package rest
import (
"net/http"
"time"
"log"
"fmt"
"github.com/gorilla/handlers"
)
const default_port = "8080"
var startTime time.Time
func StartServer() {
startTime = time.Now().UTC()
// Get Cloud Foundry assigned port
port := default_port
if port == "" {
port = default_port
log.Println(fmt.Sprintf... |
package ports
import (
"fmt"
"github.com/pkg/errors"
"golang.stackrox.io/kube-linter/pkg/matcher"
"golang.stackrox.io/kube-linter/pkg/check"
"golang.stackrox.io/kube-linter/pkg/diagnostic"
"golang.stackrox.io/kube-linter/pkg/objectkinds"
"golang.stackrox.io/kube-linter/pkg/templates"
"golang.stackrox.io/kube... |
package httptest
import (
"bytes"
"encoding/json"
"net/http"
"net/http/httptest"
"github.com/markbates/hmax"
)
type JSON struct {
URL string
handler *handler
Headers map[string]string
Username string
Password string
}
type JSONResponse struct {
*Response
}
func (r *JSONResponse) Bind(x interface{... |
/*
* This file is part of the KubeVirt project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable la... |
package git
/*
#include <git2.h>
*/
import "C"
import (
"runtime"
"unsafe"
)
// DescribeOptions represents the describe operation configuration.
//
// You can use DefaultDescribeOptions() to get default options.
type DescribeOptions struct {
// How many tags as candidates to consider to describe the input commit-i... |
/*
Copyright 2017 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: onos/config/admin/admin.proto
// Package admin defines the administrative gRPC interfaces.
package admin
import (
context "context"
fmt "fmt"
_ "github.com/gogo/protobuf/gogoproto"
proto "github.com/gogo/protobuf/proto"
_ "github.com/gogo/protobuf/ty... |
// Copyright (c) 2013-2016 The btcsuite developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package main
import (
"fmt"
"os"
"path/filepath"
"github.com/alexdcox/dashd-go/chaincfg"
"github.com/alexdcox/dashd-go/database"
_ "github.com/alexdcox/dashd-go/... |
/*
* Twilio - Conversations
*
* This is the public Twilio REST API.
*
* API version: 1.27.1
* Contact: support@twilio.com
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
// ConversationsV1ServiceWebhookConfiguration struct for ConversationsV1ServiceWebh... |
package main
import "testing"
func TestDLL(t *testing.T) {
tests := []struct {
name string
source string
expected int
}{
{
name: "none",
expected: 0,
source: `
package main
func main() {
println("Hello!")
}
`,
},
{
name: "for",
expected: 1,
source: `
... |
/*
* Copyright (c) 2017, https://github.com/nebulaim
* 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 2020 Antrea Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to ... |
package cmd
import (
"fmt"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
// configureCmd represents the configure command
var configureCmd = &cobra.Command{
Use: "configure",
Short: "Configure saves the provided global flags to the Config File",
Long: `Configure saves the provided global flags to the C... |
package gogroup
import (
"strings"
"testing"
"github.com/stretchr/testify/assert"
)
type vopts struct {
invalid bool
verrstr string
err bool
}
func testValidate(t *testing.T, g Grouper, opts vopts, imports string) {
proc := NewProcessor(g)
text := "package main\n" + imports
errValid, err := proc.Valida... |
package main
import (
"fmt"
)
var Commands map[string]string
func main() {
fmt.Println("Demo for maps")
LinuxCommands();
for k, v := range Commands {
fmt.Println(k, "=>", v)
}
WindowsCommands();
for k, v := range Commands {
fmt.Println(k, "=>", v)
}
delete(Commands , "Dir")
fmt.Println("Delete key a... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package elasticbeanstalk
import (
"context"
"time"
"github.com/aws/aws-sdk-go-v2/aws"
)
// WaitUntilEnvironmentExists uses the Elastic Beanstalk API operation
// DescribeEnvironments to wait for a condition to be met before returning.
// If the... |
package v2
import (
"fmt"
"strconv"
"strings"
)
//returns float64 or int
func (p *byteParser) ParseNumber() (Value, error) {
var (
sb strings.Builder
float bool
pos = p.Byte == '+'
sign = pos || p.Byte == '-'
idx = p.Index
err error
)
if !pos {
sb.WriteByte(p.Byte)
}
if sign && isWS(... |
// Copyright 2016-2021 The Libsacloud 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... |
package integration_test
import (
"bytes"
"context"
"encoding/json"
"io"
"os"
"testing"
"time"
"github.com/google/go-cmp/cmp"
"github.com/int128/kubelogin/integration_test/httpdriver"
"github.com/int128/kubelogin/integration_test/keypair"
"github.com/int128/kubelogin/integration_test/oidcserver"
"github.c... |
package gocbcore
import (
"encoding/json"
"errors"
"fmt"
"strings"
)
type wrappedError struct {
Message string
InnerError error
}
func (e wrappedError) Error() string {
return fmt.Sprintf("%s: %s", e.Message, e.InnerError.Error())
}
func (e wrappedError) Unwrap() error {
return e.InnerError
}
func wrapE... |
// Copyright 2021 Matrix Origin
//
// 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 ... |
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package build
import (
"internal/testenv"
"io"
"os"
"path/filepath"
"reflect"
"runtime"
"strings"
"testing"
)
func TestMatch(t *testing.T) {
ctxt :=... |
package events
import (
"github.com/awslabs/goformation/v3/cloudformation/policies"
)
// Rule_RunCommandParameters AWS CloudFormation Resource (AWS::Events::Rule.RunCommandParameters)
// See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-events-rule-runcommandparameters.html
type Rule_... |
/*
* MinIO Cloud Storage, (C) 2019 MinIO, 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 la... |
package iso20022
// Provides the details of the update(s) for the settlement transaction.
type SecuritiesSettlementTransactionDetails2 struct {
// Provides settlement type and identification information.
SettlementTypeAndAdditionalParameters *SettlementTypeAndAdditionalParameters5 `xml:"SttlmTpAndAddtlParams,omitem... |
package commands
var (
commands = []CommandItem{}
) |
// Copyright OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed t... |
// Licensed to Elasticsearch B.V. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. Elasticsearch B.V. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use ... |
// Copyright 2021 Monoskope 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... |
package authorization
import (
"bufio"
"bytes"
"fmt"
"io"
"net/http"
"strings"
"github.com/Sirupsen/logrus"
"github.com/docker/docker/pkg/ioutils"
)
const maxBodySize = 1048576 // 1MB
// NewCtx creates new authZ context, it is used to store authorization information related to a specific docker
// REST http... |
package resources
import (
"errors"
"strings"
"github.com/rancher/rancher-compose-executor/config"
"github.com/rancher/rancher-compose-executor/convert"
)
func getServiceOrder(containers, services map[string]*config.ServiceConfig) ([]string, error) {
var order []string
added := map[string]bool{}
for name := ... |
// Copyright 2016 Amazon.com, Inc. or its affiliates. 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. A copy of the
// License is located at
//
// http://aws.amazon.com/apache2.0/
//
// or in the "license" fil... |
// Code generated by "stringer -linecomment -type Preemption"; DO NOT EDIT.
package enum
import "strconv"
const _Preemption_name = "nonedso_localdso_preemptable"
var _Preemption_index = [...]uint8{0, 4, 13, 28}
func (i Preemption) String() string {
if i >= Preemption(len(_Preemption_index)-1) {
return "Preempti... |
package datastore
import (
"context"
"fmt"
"0chain.net/core/common"
)
/*Key - a type for the entity key */
type Key = string
/*IDField - Useful to embed this into all the entities and get consistent behavior */
type IDField struct {
ID Key `json:"id" yaml:"id"`
}
/*SetKey sets the key */
func (k *IDField) SetK... |
package leetcode
import (
"sort"
)
func rectangleArea(rectangles [][]int) int {
sat, res := SegmentAreaTree{}, 0
posXMap, posX, posYMap, posY, lines := discretization850(rectangles)
tmp := make([]int, len(posYMap))
for i := 0; i < len(tmp)-1; i++ {
tmp[i] = posY[i+1] - posY[i]
}
sat.Init(tmp, func(i, j int) ... |
package commands
import (
"fmt"
"os"
"strconv"
"github.com/concourse/fly/commands/internal/flaghelpers"
"github.com/concourse/fly/eventstream"
"github.com/concourse/fly/rc"
)
type WatchCommand struct {
Job flaghelpers.JobFlag `short:"j" long:"job" value-name:"PIPELINE/JOB" description:"Watches builds of... |
// 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
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in w... |
package types
import (
"fmt"
sdk "github.com/ownesthq/cosmos-sdk/types"
"github.com/ownesthq/cosmos-sdk/x/params"
)
// Parameter store keys
var (
KeyMintDenom = []byte("MintDenom")
KeyInflationRateChange = []byte("InflationRateChange")
KeyInflationMax = []byte("InflationMax")
KeyInflationMin ... |
// Copyright 2014 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.
// Stringer is a tool to automate the creation of methods that satisfy the fmt.Stringer
// interface. Given the name of a (signed or unsigned) integer type T th... |
package item
import (
ida96af0f171bb75f894a4013a6b3146a4397c58f11adb81a2b7cbea9314783a9 "github.com/microsoft/kiota/abstractions/go"
i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization"
i4a838ef194e4c99e9f2c63ba10dab9cb120a89367c1d4ab0... |
package index
import (
"reflect"
"github.com/didi/nightingale/src/common/dataobj"
"github.com/didi/nightingale/src/modules/tsdb/utils"
"github.com/didi/nightingale/src/toolkits/stats"
"github.com/toolkits/pkg/concurrent/semaphore"
"github.com/toolkits/pkg/logger"
)
type IndexSection struct {
ActiveDuration ... |
/*
* RingCentral Connect Platform API Explorer
*
* <p>This is a beta interactive API explorer for the RingCentral Connect Platform. To use this service, you will need to have an account with the proper credentials to generate an OAuth2 access token.</p><p><h2>Quick Start</h2></p><ol><li>1) Go to <b>Authentication > ... |
package logrus
import (
"io"
"fmt"
"path/filepath"
"runtime"
)
var (
// std is the name of the standard logger in stdlib `log`
std = New()
)
func getFuncPath(skip int) string {
var (
file = "unknown"
line = 0
ok = false
func_name = "unknown"
pc uintptr
)
pc, file, line, ok = runtime.Caller(2)
det... |
// Code generated by test DO NOT EDIT.
// *** WARNING: Do not edit by hand unless you're certain you know what you are doing! ***
package v1
import (
"context"
"reflect"
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
type Nursery struct {
pulumi.CustomResourceState
}
// NewNursery regis... |
// Copyright 2020 PingCAP, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to i... |
// *** 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 providerhub
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// API Version: 2020-11-20.
func LookupSkus(ctx *pulumi.Context, args *LookupSkusArgs,... |
package migrations
import (
"github.com/sergeyglazyrindev/uadmin/core"
)
var BMigrationRegistry *core.MigrationRegistry
func init() {
BMigrationRegistry = core.NewMigrationRegistry()
BMigrationRegistry.AddMigration(initial1623083053{})
BMigrationRegistry.AddMigration(createall1623263607{})
// placeholder to i... |
// Copyright 2020 ConsenSys Software 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 a... |
package permutations
type null int
// Shuffle using the nil method
// just return the same value
func (k null) Shuffle(n int64) int64 {
return n
} |
/*
* httprr.trys.cc
*
* A simple HTTP Request & Response Service.<br/> <br/> <b>Run locally: </b> <code>$ docker run -p 80:80 inherelab/httprr</code>
*
* API version: 0.0.1
* Contact: in.798@qq.com
* Generated by: Swagger Codegen (https://github.com/swagger-api/swagger-codegen.git)
*/
package app
import (
... |
// Copyright 2015 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 discovery
import (
"errors"
"io/ioutil"
"net/http"
"strings"
)
func FindNamespace(host string) (string, error) {
//Attempt to access the ho... |
// Code generated by "genenum.exe -typename=RespawnType -packagename=respawntype -basedir=enum"
package respawntype
import "fmt"
type RespawnType uint8
const (
ToHomeFloor RespawnType = iota // respawn to home floor
ToCurrentFloor // respawn to current floor
ToRandomFloor ... |
package db
import (
"encoding/json"
"log"
"strings"
"github.com/jinzhu/gorm"
)
type Tag struct {
gorm.Model
Tagindex string
Tag string
}
func (db *DB) CreateTag(str string, index string) Tag {
db.Instance.Create(&Tag{
Tagindex: index,
Tag: str,
})
var tag Tag
db.Instance.Last(&tag, "tag = ?... |
package runner
import (
"fmt"
"os"
"strings"
"github.com/karrick/godirwalk"
"github.com/projectdiscovery/gologger"
"github.com/projectdiscovery/nuclei/v2/internal/severity"
"github.com/projectdiscovery/nuclei/v2/pkg/parsers"
"github.com/projectdiscovery/nuclei/v2/pkg/types"
)
func (r *Runner) templateLogMsg... |
/*
Copyright 2014 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 installedapps
import (
i04eb5309aeaafadd28374d79c8471df9b267510b4dc2e3144c378c50f6fd7b55 "github.com/microsoft/kiota/abstractions/go/serialization"
i4a838ef194e4c99e9f2c63ba10dab9cb120a89367c1d4ab0daa63bb424e20d87 "github.com/microsoftgraph/msgraph-sdk-go/models/microsoft/graph"
)
// InstalledAppsResp... |
package main
import (
"fmt"
"os"
"github.com/FilipNikolovski/amigo/cmd"
)
func usage() {
fmt.Println(`NAME:
amigo - An AUR helper
USAGE:
amigo [option] [pkg] [pkg] [...]
COMMANDS:
-S Install package
-G Clone package in the current dir
-R Remove package
OPTIONS:
--help Show help
--version Show version
... |
package api // import "github.com/akss1/vksdk/5.92/api"
import (
"github.com/akss1/vksdk/5.92/object"
)
// StorageGetResponse struct
type StorageGetResponse []object.BaseRequestParam
// StorageGet returns a value of variable with the name set by key parameter.
//
// StorageGet always return array!
// https://vk.com... |
// Command timeto prints the time difference between the wall time and the time given on the command
// line. Times at the zero date (0000-01-01) are assumed to be relative to current time, such as
// '8pm' or '12' or '23:45' and will be evaluated using the wall time's date.
//
// This tries to parse a handful of time ... |
package file
import (
"context"
"io"
"os"
"path"
"path/filepath"
"strings"
"sync"
"github.com/containerssh/libcontainerssh/internal/auditlog/storage"
)
type fileStorage struct {
directory string
wg *sync.WaitGroup
}
func (s *fileStorage) Shutdown(_ context.Context) {
s.wg.Wait()
}
// OpenReader o... |
package fakes
import (
"k8s.io/apimachinery/pkg/types"
"sigs.k8s.io/controller-runtime/pkg/client"
)
const (
// Name is the default name given to fake objects.
Name = "foo"
// Namespace is the default namespace given to fake namespace-scoped objects.
Namespace = "bar"
// UID is the default UID given to fake ... |
package tenus
import (
"bytes"
"fmt"
"net"
"github.com/docker/libcontainer/netlink"
)
// Bridger embeds Linker interface and adds one extra function.
type Bridger interface {
// Linker interface
Linker
// AddSlaveIfc adds network interface to the network bridge
AddSlaveIfc(*net.Interface) error
}
// Bridge ... |
// Code generated by xns-informer-gen. DO NOT EDIT.
package v1beta1
import (
xnsinformers "github.com/maistra/xns-informer/pkg/informers"
v1beta1 "k8s.io/api/policy/v1beta1"
informers "k8s.io/client-go/informers/policy/v1beta1"
listers "k8s.io/client-go/listers/policy/v1beta1"
"k8s.io/client-go/tools/cache"
)
t... |
/*
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environments in more advanced ways ... |
package goagen_js
import (
"fmt"
"strings"
"text/template"
)
func newTemplate(args ...string) (*template.Template, error) {
tmpl := template.New("")
tmpl.Funcs(template.FuncMap{
"join": func(value []string, arg string) string {
return strings.Join(value, arg)
},
})
for _, t := range args {
var err err... |
/*
Copyright © 2019 NAME HERE <EMAIL ADDRESS>
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... |
// Copyright (c) Roman Atachiants and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for details.
package sorted
import (
bin "encoding/binary"
"reflect"
"sort"
"github.com/alrtve/binary"
)
// IntsCodecAs returns an int slice codec with the specified p... |
package main
import (
"context"
"github.com/ory/kratos/examples/go/pkg"
ory "github.com/ory/kratos-client-go"
)
// If you use Open Source this would be:
//
//var client = pkg.NewSDKForSelfHosted("http://127.0.0.1:4433")
var client = pkg.NewSDK("playground")
func performVerification(email string) *ory.SelfServic... |
package keys
import (
"bufio"
"fmt"
"github.com/spf13/cobra"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/input"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
)
// RenameKeyCommand renames a key from the key store.
func RenameKeyCommand() *cobra.Command {
cmd := &cobra.Command{
... |
// Copyright 2019 - 2021 The Samply Community
//
// 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 ... |
package flag
import (
"bytes"
"context"
"flag"
"testing"
"time"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/vimeo/dials"
"github.com/vimeo/dials/tagformat/caseconversion"
)
func TestDirectBasic(t *testing.T) {
ctx, cancel := context.WithTimeout(context.Background(... |
package golib
import (
"encoding/json"
"flag"
"fmt"
"io/ioutil"
"os"
"path/filepath"
)
var (
executable, pathError = os.Executable()
configDir = flag.String("conf", filepath.Dir(executable), "config.json at directory")
)
// LoadConfig is read the configuration from the JSON file into the structur... |
/*
Copyright 2018 Turbine Labs, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, softw... |
package main
import (
"fmt"
"os"
"os/user"
"github.com/tophatsteve/monkey/repl"
)
func main() {
user, err := user.Current()
if err != nil {
panic(err)
}
fmt.Printf("Hello %s! This is the Monkey programming language!\n", user.Username)
fmt.Printf("Feel free to type in commands\n")
repl.Start(os.Stdin, os... |
package conditions
import (
"fmt"
"gorm.io/gorm/clause"
)
type Expression struct {
}
func NewExpression() Expression {
return Expression{}
}
func (e Expression) Eq(column string, value interface{}) clause.Expression {
return e.addCondition(column, EQ, value)
}
func (e *Expression) addCondition(column string, k... |
// Copyright © 2016 Abcum Ltd
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this info 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 ... |
package api
import (
"github.com/pwood/middleauth/check"
"log"
"net/http"
)
type checkHandler struct {
checks []check.Checker
}
func (c checkHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
for _, chk := range c.checks {
result, err := chk.Check(r)
if err != nil {
log.Printf("check failed: %s... |
package gslb
type Gslbvserverdomainbinding struct {
Backupip string `json:"backupip,omitempty"`
Backupipflag bool `json:"backupipflag,omitempty"`
Cookiedomain string `json:"cookie_domain,omitempty"`
Cookiedomainflag bool `json:"cookie_domainflag,omitempty"`
Cookietimeout int `json:"cooki... |
// Copyright 2020 Marius Wilms. All rights reserved.
// Copyright 2018 Atelier Disko. All rights reserved.
//
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package author
import (
"os"
"path/filepath"
)
const (
// CanonicalBasename is the canonical name of... |
package step
import (
"fmt"
"regexp"
"testing"
"time"
corev1 "k8s.io/api/core/v1"
rtesting "knative.dev/pkg/reconciler/testing"
"github.com/tektoncd/pipeline/pkg/apis/config"
"github.com/tektoncd/pipeline/pkg/apis/pipeline/v1beta1"
tektoncloudevent "github.com/tektoncd/pipeline/pkg/reconciler/events/cloude... |
package controllers
import (
"fmt"
"io/ioutil"
"net/http"
"strconv"
"github.com/labstack/echo"
"github.com/qiz029/go-kms-gcp/src/cipher"
"github.com/qiz029/go-kms-gcp/src/keys"
"github.com/qiz029/go-kms-gcp/src/logic"
)
func Key(c echo.Context) error {
var key [32]byte
key = keys.GetKey()
return c.String(... |
package main
import (
"log"
"os"
"github.com/pkg/errors"
"github.com/smartcontractkit/chainlink/core/cmd"
"github.com/smartcontractkit/chainlink/core/config"
"github.com/smartcontractkit/chainlink/core/logger"
"github.com/smartcontractkit/chainlink/core/recovery"
"github.com/smartcontractkit/chainlink/core/s... |
// Copyright 2015 Keybase, Inc. All rights reserved. Use of
// this source code is governed by the included BSD license.
package libkb
import (
"encoding/hex"
"errors"
"fmt"
"io"
"regexp"
"time"
keybase1 "github.com/keybase/client/go/protocol/keybase1"
stellar1 "github.com/keybase/client/go/protocol/stellar1... |
/*
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, ... |
package tunnel
import (
"fmt"
C "github.com/Dreamacro/clash/constant"
log "github.com/sirupsen/logrus"
)
type Log struct {
LogLevel C.LogLevel
Payload string
}
func (l *Log) Type() string {
return l.LogLevel.String()
}
func print(data Log) {
switch data.LogLevel {
case C.INFO:
log.Infoln(data.Payload)
... |
package cmd
import (
"github.com/kelseyhightower/envconfig"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/unionj-cloud/go-doudou/cmd/internal/ddl"
"github.com/unionj-cloud/go-doudou/cmd/internal/ddl/config"
"github.com/unionj-cloud/go-doudou/toolkit/dotenv"
"github.com/unionj-cloud/go-doudou... |
// Copyright 2018 The Ebiten 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... |
/*
Copyright The Helm 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, software
distrib... |
package commands
import (
"fmt"
"github.com/concourse/concourse/fly/commands/internal/displayhelpers"
"github.com/concourse/concourse/fly/commands/internal/flaghelpers"
"github.com/concourse/concourse/fly/rc"
)
type PausePipelineCommand struct {
Pipeline flaghelpers.PipelineFlag `short:"p" long:"pipeline" desc... |
/*
Copyright 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, softw... |
// Copyright 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 in wri... |
package main
import (
"flag"
"fmt"
"os"
"github.com/wix-playground/govips/pkg/vips"
)
var (
flagIn = flag.String("in", "", "file to load")
flagMessage = flag.String("message", "", "message to write")
flagOut = flag.String("out", "", "file to write out")
reportLeaksFlag = flag.Bool("leaks... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.