text stringlengths 10 1.05M |
|---|
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package autoscaling
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
// Please also see https://docs.aws.amazon.com/goto/WebAPI/autoscaling-2011-01-01/DescribeLifecycleHooksType
type Descri... |
// Copyright (c) Facebook, Inc. and its affiliates.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicabl... |
// skip because mode 'errorcheck -0 -l -d=wb' is not supported https://github.com/open2b/scriggo/issues/417
// errorcheck -0 -l -d=wb
// Copyright 2015 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.
// Test where write barr... |
/*
Copyright IBM Corp. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package statecouchdb
import (
"fmt"
"os"
"strings"
"testing"
"time"
"github.com/hyperledger/fabric/common/flogging"
"github.com/hyperledger/fabric/common/ledger/testutil"
"github.com/hyperledger/fabric/core/common/ccprovider"... |
package main
import (
"sync"
"time"
"github.com/corpix/formats"
logger "github.com/corpix/loggers/logger/logrus"
"github.com/sirupsen/logrus"
"github.com/cryptounicorns/queues"
"github.com/cryptounicorns/queues/consumer"
"github.com/cryptounicorns/queues/producer"
"github.com/cryptounicorns/queues/queue/cha... |
package main
import (
"bytes"
"context"
"encoding/json"
"flag"
v1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/klog"
"k8s.io/klog/klogr"
"k8s.io/test-infra-setup/webhook/pkg/kustomize"
"net/http"
"os"
ctrl "sigs.k8s.io/controller-runtime"
"s... |
package main
import (
"bufio"
"encoding/json"
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
"os/exec"
"strings"
"time"
eventtypes "github.com/docker/docker/api/types/events"
eventstestutils "github.com/docker/docker/daemon/events/testutils"
"github.com/docker/docker/pkg/integration/checker"
icmd "github.com/do... |
/*
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... |
package commands
import (
"errors"
"fmt"
git "github.com/libgit2/git2go"
"metro"
)
func execSwitch(repo *git.Repository, positionals []string, _ map[string]string) error {
if len(positionals) < 1 {
return errors.New("Branch name required.")
}
if len(positionals) > 1 {
return errors.New("Unexpected argument... |
// merge-binvox takes a filename prefix and reads in all files matching
// prefix*.binvox. It merges the binvox files together as VShells, then writes
// out prefix.vsh as a merged model.
package main
import (
"flag"
"fmt"
"log"
"os"
"path/filepath"
"github.com/gmlewis/stldice/v4/vshell"
)
var (
force = flag... |
// Copyright (c) 2022 Target Brands, Inc. All rights reserved.
//
// Use of this source code is governed by the LICENSE file in this repository.
package api
import (
"context"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"strconv"
"strings"
"time"
"github.com/go-vela/server/router/middleware/org"
"github.... |
package miniprogram
import (
"encoding/json"
"fmt"
"github.com/fintcloud/wechat/util"
)
const (
code2SessionURL = "https://api.weixin.qq.com/sns/jscode2session?appid=%s&secret=%s&js_code=%s&grant_type=authorization_code"
)
// ResCode2Session 登录凭证校验的返回结果
type ResCode2Session struct {
util.CommonError
OpenID ... |
// 475. Heaters
// Winter is coming! Your first job during the contest is to design a standard heater with fixed warm radius to warm all the houses.
// Now, you are given positions of houses and heaters on a horizontal line, find out minimum radius of heaters so that all houses could be covered by those heaters.
// So... |
package main
import (
"fmt"
"io/ioutil"
"net/http"
"os"
"os/signal"
"path"
"syscall"
"time"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promhttp"
"github.com/prometheus/common/log"
kingpin "gopkg.in/alecthomas/kingpin.v2"
yaml "gopkg.in/yaml.v2"
)
typ... |
/*
* 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 may ... |
// 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 pkg
import (
"encoding/json"
"fmt"
"log"
)
// TicketRes response structure for ticket
type TicketRes struct {
Ticket Ticket `json:"ticket"`
}
// TicketListRes response structure for ticket list
type TicketListRes struct {
Tickets []Ticket `json:"tickets"`
Count int `json:"count"`
}
// Ticket st... |
// 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... |
package main
import (
"flag"
"github.com/lysu/rtvk"
"strings"
"github.com/coreos/etcd/raft/raftpb"
)
func main() {
cluster := flag.String("cluster", "http://127.0.0.1:9021", "comma separated cluster peers")
id := flag.Int("id", 1, "node ID")
kvport := flag.Int("port", 9121, "key-value server port")
join := f... |
package command
import (
"SchoolDay/env"
"SchoolDay/extension"
"time"
"github.com/bwmarrin/discordgo"
)
func Csat(s *discordgo.Session, m *discordgo.MessageCreate, args []string) {
channelId := m.ChannelID
date, err := extension.NtpTimeKorea()
if err != nil {
log.Warningln(err)
return
}
csatDate, err ... |
// MIT License. Copyright (c) 2020 CQFN
// https://github.com/cqfn/degitx/blob/master/LICENSE
package transaction
import (
"context"
)
// Ballot number of proposals in Paxos algorithm
type Ballot uint16
// Proposal for Paxos protocol
type Proposal struct {
// Ballot number of the proposal
Ballot
// Proposer ID,... |
package influxdb
import (
"testing"
"github.com/grafana/grafana/pkg/components/simplejson"
"github.com/grafana/grafana/pkg/models"
. "github.com/smartystreets/goconvey/convey"
)
func TestInfluxdbQueryParser(t *testing.T) {
Convey("Influxdb query parser", t, func() {
parser := &InfluxdbQueryParser{}
dsInfo ... |
package baidupcs
import (
"crypto/md5"
"encoding/hex"
"errors"
"github.com/qjfoidnh/BaiduPCS-Go/baidupcs/pcserror"
"github.com/qjfoidnh/BaiduPCS-Go/pcsutil/cachepool"
"github.com/qjfoidnh/BaiduPCS-Go/pcsutil/escaper"
"github.com/qjfoidnh/BaiduPCS-Go/requester/downloader"
"io"
"mime"
"net/http"
"path"
"strc... |
package blocktoattr
import (
"github.com/hashicorp/hcl/v2"
"github.com/hashicorp/terraform/internal/configs/configschema"
"github.com/zclconf/go-cty/cty"
)
func ambiguousNames(schema *configschema.Block) map[string]struct{} {
if schema == nil {
return nil
}
ambiguousNames := make(map[string]struct{})
for nam... |
package websocket
import (
"sync"
"github.com/kataras/iris/context"
"github.com/gorilla/websocket"
)
type (
// ConnectionFunc is the callback which fires when a client/connection is connected to the Server.
// Receives one parameter which is the Connection
ConnectionFunc func(Connection)
// websocketRoomPay... |
package editor
import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"
"github.com/therecipe/qt/core"
"github.com/therecipe/qt/gui"
"github.com/therecipe/qt/svg"
"github.com/therecipe/qt/widgets"
)
type Filelist struct {
WSitem *WorkspaceSideItem
widget *widgets.QWidget
Fileitems []*Fileitem
act... |
package input
import (
"context"
"crypto/tls"
"errors"
"fmt"
"strconv"
"strings"
"sync"
"time"
"github.com/Jeffail/benthos/v3/internal/checkpoint"
"github.com/Jeffail/benthos/v3/internal/docs"
"github.com/Jeffail/benthos/v3/lib/input/reader"
"github.com/Jeffail/benthos/v3/lib/log"
"github.com/Jeffail/ben... |
// Copyright 2018 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 internal_gengo is internal to the protobuf module.
package internal_gengo
import (
"fmt"
"go/ast"
"go/parser"
"go/token"
"math"
"strconv"
"st... |
package dependencies
import (
"encoding/xml"
"fmt"
gofrogcmd "github.com/jfrog/gofrog/io"
"github.com/jfrog/jfrog-cli-go/artifactory/utils/nuget"
"github.com/jfrog/jfrog-client-go/artifactory/buildinfo"
"github.com/jfrog/jfrog-client-go/utils/errorutils"
"github.com/jfrog/jfrog-client-go/utils/io/fileutils"
"g... |
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
// Package pluginenv provides high level functionality for discovering and launching plugins.
package pluginenv
import (
"fmt"
"io/ioutil"
"net/http"
"path/filepath"
"sync"
"github.com/pkg/errors"
... |
package main
import (
"bytes"
log "github.com/Sirupsen/logrus"
"io"
"strings"
)
type TestClient struct {
logger *log.Entry
reader io.Reader
output *bytes.Buffer
closed bool
}
func NewTestClient(data string) *TestClient {
return &TestClient{
reader: strings.NewReader(data),
output: new(bytes.Buffer),
l... |
/*
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 hasuradb
import (
"encoding/json"
"fmt"
"strings"
log "github.com/sirupsen/logrus"
)
const (
TuplesOK = "TuplesOk"
CommandOK = "CommandOk"
)
type HasuraInterfaceBulk struct {
Type string `json:"type" yaml:"type"`
Args []interface{} `json:"args" yaml:"args"`
}
func (h *HasuraInterfaceBulk) R... |
/*
* 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 may ... |
// Copyright 2010 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 cipher_test
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"testing"
)
func TestCFB(t *testing.T) {
block, err := aes.NewCipher(com... |
package lite
import (
"reflect"
"testing"
)
func Test_decodeImages(t *testing.T) {
body := `
image: cn-app-integration:v1.0.0
image: registry.cn-shanghai.aliyuncs.com/cnip/cn-app-integration:v1.0.0
imagePullPolicy: Always
image: cn-app-integration:v1.0.0
# image: cn-app-... |
package dbc
import (
"bytes"
"fmt"
"math"
"strconv"
"strings"
"text/scanner"
"unicode/utf8"
)
const defaultScannerMode = scanner.ScanIdents | scanner.ScanFloats
const (
defaultWhitespace = scanner.GoWhitespace
significantNewline = defaultWhitespace & ^uint64(1<<'\n')
significantTab = defaultWhitespace... |
/*
* Copyright 2019-2020 The NATS 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 vsphere
import (
"context"
"errors"
"fmt"
"log"
"strings"
"github.com/hashicorp/terraform/helper/schema"
"github.com/hashicorp/terraform/helper/validation"
"github.com/terraform-providers/terraform-provider-vsphere/vsphere/internal/helper/structure"
"github.com/vmware/vic/pkg/vsphere/tags"
)
const (... |
// Copyright 2021 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 main
import (
"crypto/tls"
"encoding/json"
"flag"
"fmt"
"log"
"os"
"strconv"
"github.com/jle35/proxmox-api-go/proxmox"
)
func main() {
var insecure *bool
insecure = flag.Bool("insecure", false, "TLS insecure mode")
proxmox.Debug = flag.Bool("debug", false, "debug mode")
taskTimeout := flag.Int("t... |
package wallet
import "github.com/planetdecred/dcrlibwallet"
// NewBlock is sent when a block is attached to the multiwallet.
type NewBlock struct {
WalletID int
Height int32
}
// TxConfirmed is sent when a transaction is confirmed.
type TxConfirmed struct {
WalletID int
Height int32
Hash string
}
type... |
// 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 2016-2020 Datadog, Inc.
package event
import (
"github.com/DataDog/datadog-agent/pkg/trace/pb"
"g... |
package rke
func loadK8sVersionDockerInfo() map[string][]string {
return map[string][]string{
"1.8": {"1.11.x", "1.12.x", "1.13.x", "17.03.x"},
"1.9": {"1.11.x", "1.12.x", "1.13.x", "17.03.x", "18.06.x", "18.09.x", "19.03.x"},
"1.10": {"1.11.x", "1.12.x", "1.13.x", "17.03.x", "18.06.x", "18.09.x", "19.03.x"},... |
/*
*
* k6 - a next-generation load testing tool
* Copyright (C) 2019 Load Impact
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation, either version 3 of the
* License, or (at your o... |
/*
Copyright 2018 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 2020 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 ... |
package client
const (
RESTORE_FROM_BACKUP_INPUT_TYPE = "restoreFromBackupInput"
)
type RestoreFromBackupInput struct {
Resource
BackupId string `json:"backupId,omitempty" yaml:"backup_id,omitempty"`
}
type RestoreFromBackupInputCollection struct {
Collection
Data []RestoreFromBackupInput `json:"data,omitemp... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package pinpoint
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"
)
// Please also see https://docs.aws.amazon.com/goto/WebAPI/pinpoint-2016-1... |
// 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 (
"sync"
"testing"
"github.com/spf13/viper"
"github.c... |
/*
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 logger
import (
"fmt"
"github.com/getsentry/sentry-go"
)
// A SentryLogger
type SentryLogger struct {
l Logger
//ctx LogContext
}
// NewSentryLogger constructs a SentryLogger based off the provided TrailsLogger.
func NewSentryLogger(tl *TrailsLogger, dsn string) Logger {
err := sentry.Init(sentry.Clien... |
/*
* Copyright 2018-2020 the original author or 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
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a... |
package config
import (
"time"
)
type CatsConfig interface {
GetIncludeApps() bool
GetIncludeBackendCompatiblity() bool
GetIncludeCapiNoBridge() bool
GetIncludeContainerNetworking() bool
GetIncludeCredhubAssisted() bool
GetIncludeCredhubNonAssisted() bool
GetIncludeDetect() bool
GetIncludeDocker() bool
GetI... |
package json
import (
"testing"
"github.com/dotamixer/doom/pkg/lion/source"
)
func TestValues(t *testing.T) {
data := []byte(`{"foo": "bar", "baz": {"bar": "cat"}}`)
testData := []struct {
path []string
value string
}{
{
[]string{"foo"},
"bar",
},
{
[]string{"baz", "bar"},
"cat",
},
}... |
// Copyright 2018 Twitch Interactive, 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. A copy of the License is
// located at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// or in the "license"... |
package types
type SnippetStorage interface {
AddSnippet(snippet Snippet) (SnippetId, error)
GetSnippetsByUser(user UserId) ([]Snippet, error)
GetSnippetsByLanguage(language ProgrammingLanguage) ([]Snippet, error)
GetSnippet(snippet SnippetId) (Snippet, error)
DeleteSnippet(snippet SnippetId) error
SetSnippetHig... |
// Copyright 2015 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 stats
// Miscellaneous helper algorithms
import (
"fmt"
"github.com/aclements/go-moremath/mathx"
)
func maxint(a, b int) int {
if a > b {
retur... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.23.0
// protoc v3.14.0
// source: envoy/config/filter/network/client_ssl_auth/v2/client_ssl_auth.proto
package envoy_config_filter_network_client_ssl_auth_v2
import (
core "github.com/cilium/proxy/go/envoy/api/v2/core"
_ "git... |
package gossip
import (
"github.com/ethereum/go-ethereum/common"
"github.com/Fantom-foundation/go-lachesis/hash"
"github.com/Fantom-foundation/go-lachesis/inter"
"github.com/Fantom-foundation/go-lachesis/inter/idx"
"github.com/Fantom-foundation/go-lachesis/inter/pos"
"github.com/Fantom-foundation/go-lachesis/ve... |
// Package certificate contains functions for handling TLS certificates.
package certificate
import (
"crypto/tls"
"crypto/x509"
"io/ioutil"
"net/url"
"github.com/pkg/errors"
)
// LoadPEM loads certificates from a PEM file and returns a cert pool containing
// the certificates.
func LoadPEM(path string) (*x509.... |
package alertmetrics
import (
"context"
"database/sql"
"github.com/target/goalert/util"
)
type Store struct {
db *sql.DB
}
func NewStore(ctx context.Context, db *sql.DB) (*Store, error) {
p := &util.Prepare{DB: db, Ctx: ctx}
return &Store{
db: db,
}, p.Err
} |
// Code generated by go-swagger; DO NOT EDIT.
package spaces
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"net/http"
"github.com/go-openapi/runtime"
"github.com/suse/carrier/shim/models"
)
// AssociateAuditorWithSp... |
// Copyright 2019-2020 The NATS 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 ... |
/*
* Copyright 2020 Saffat Technologies, Ltd.
*
* 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 effect
import (
"fmt"
"gotracker/internal/player/intf"
)
// RowJump defines a row jump effect
type RowJump uint8 // 'C'
// PreStart triggers when the effect enters onto the channel state
func (e RowJump) PreStart(cs intf.Channel, ss intf.Song) {
ss.SetCurrentRow(uint8((e>>4)*10 + (e & 0x0f)))
}
// Start... |
// SPDX-License-Identifier: Apache-2.0
// Copyright Authors of Cilium
//go:build !privileged_tests
// +build !privileged_tests
package fqdn
import (
"context"
"net"
"sync"
"time"
. "gopkg.in/check.v1"
"github.com/cilium/cilium/pkg/fqdn/dns"
"github.com/cilium/cilium/pkg/identity"
"github.com/cilium/cilium/... |
/*
Copyright 2018 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 editor is a collection of utilities to find and spawn a sensible editor
package editor
import (
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
"strings"
)
const bugMessage = "This is a bug in sensible; please file at https://github.com/ernestrc/sensible/issues"
// inspired by i3-sensible-editor
// Th... |
package node
import (
"fmt"
"strings"
"github.com/run-ai/runai-cli/pkg/client"
"github.com/run-ai/runai-cli/pkg/nodes"
"github.com/run-ai/runai-cli/pkg/types"
"github.com/run-ai/runai-cli/pkg/ui"
)
var (
defaultHiddenFields = ui.EnsureStringPaths(types.NodeView{}, []string{
"GPUs.InUse",
})
unhealthyGpus... |
package ufwhandler
import (
"bytes"
"fmt"
"log"
"net"
"os/exec"
"strconv"
"strings"
"github.com/docker/docker/api/types"
)
func checkIP(ip string) bool {
return net.ParseIP(ip) != nil
}
func checkCIDR(cidr string) bool {
_, _, err := net.ParseCIDR(cidr)
return err == nil
}
func CreateUfwRule(ch <-chan *... |
// 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... |
// Copyright 2016 José Santos <henrique_1609@me.com>
//
// 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 l... |
// Copyright 2021 Northern.tech AS
//
// 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 ... |
package continuity
import (
"fmt"
"io"
"log"
"os"
"sort"
pb "github.com/containerd/continuity/proto"
"github.com/golang/protobuf/proto"
)
// Manifest provides the contents of a manifest. Users of this struct should
// not typically modify any fields directly.
type Manifest struct {
// Resources specifies all... |
package dependency
import (
"fmt"
"github.com/loft-sh/devspace/pkg/devspace/build"
"github.com/loft-sh/devspace/pkg/devspace/config"
"github.com/loft-sh/devspace/pkg/devspace/dependency/types"
"github.com/loft-sh/devspace/pkg/devspace/deploy"
"github.com/loft-sh/devspace/pkg/devspace/pullsecrets"
"os"
"path/fi... |
// 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.
// This file contains the test for unkeyed struct literals.
package main
import (
"cmd/vet/internal/whitelist"
"flag"
"go/ast"
"go/types"
"strings"
)
va... |
package main
import (
"bytes"
"crypto/rand"
"fmt"
"log"
"net"
"golang.org/x/crypto/nacl/box"
)
// Shared constants representing a known message types,
// sizes used to establish buffers, and service signature
// to easily drop unknown traffic.
const (
MessageHandshake byte = iota
MessageDisconnected
Message... |
package model
import (
"gorm.io/gorm"
"time"
)
type Stat struct {
gorm.Model
Time time.Time
StreamID uint
Viewers int
} |
package pwd
import (
"encoding/base64"
)
// Base64Encrypt base64 encrypt
func Base64Encrypt(plainText []byte) []byte {
return []byte(base64.StdEncoding.EncodeToString(plainText))
}
// Base64Decrypt base64 decrypt
func Base64Decrypt(cipherText []byte) ([]byte, error) {
return base64.StdEncoding.DecodeString(string... |
package queryio
import (
"encoding/json"
"io"
"reflect"
"github.com/brimdata/zed"
"github.com/brimdata/zed/zio/zjsonio"
"github.com/brimdata/zed/zson"
)
type ZJSONWriter struct {
encoder *json.Encoder
marshaler *zson.MarshalZNGContext
stream *zjsonio.Stream
}
var _ controlWriter = (*ZJSONWriter)(nil)
... |
// Code generated by protoc-gen-goten-client
// Service: Secrets
// DO NOT EDIT!!!
package secrets_client
import (
gotenclient "github.com/cloudwan/goten-sdk/runtime/client"
gotenresource "github.com/cloudwan/goten-sdk/runtime/resource"
)
// proto imports
import (
encryption_client "github.com/cloudwan/edgelq-sdk... |
package keeper_test
import (
"fmt"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/osmosis-labs/osmosis/v7/x/gamm/types"
)
func (suite *KeeperTestSuite) TestBalancerPoolSimpleMultihopSwapExactAmountIn() {
type param struct {
routes []types.SwapAmountInRoute
tokenIn sdk.Coin
token... |
package doctor
import (
"fmt"
"github.com/spf13/cobra"
"goharvest2/pkg/color"
"goharvest2/pkg/conf"
"goharvest2/pkg/tree"
harvestyaml "goharvest2/pkg/tree/yaml"
"gopkg.in/yaml.v3"
"io/ioutil"
"os"
"strings"
)
type options struct {
ShouldPrintConfig bool
Color string
BaseTemplate strin... |
// SPDX-License-Identifier: Apache-2.0
// Copyright Authors of Cilium
//go:build !privileged_tests
// +build !privileged_tests
package agent
import (
"net"
"testing"
. "gopkg.in/check.v1"
"github.com/cilium/cilium/pkg/monitor/agent/listener"
)
func Test(t *testing.T) { TestingT(t) }
type ListenerSuite struct... |
/*
* Twilio - Api
*
* This is the public Twilio REST API.
*
* API version: 1.25.0
* Contact: support@twilio.com
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package openapi
// ApiV2010SipIpAccessControlListMapping struct for ApiV2010SipIpAccessControlListMapping
typ... |
package agq
import "github.com/rannoch/cldr"
var currencies = []cldr.Currency{
{Currency: "AED", DisplayName: "Dilàm è Yùnaetɛ Alab Emelɛ̀", Symbol: ""},
{Currency: "AOA", DisplayName: "Kwanzà è Àŋgolà", Symbol: ""},
{Currency: "AUD", DisplayName: "Dɔlà e Ùsɨ̀tɛ̀lɛlìa", Symbol: ""},
{Currency: "BHD", DisplayName:... |
// 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.
// Package draw provides image composition functions.
//
// See "The Go image/draw package" for an introduction to this package:
// http://golang.org/doc/artic... |
/*
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 main
import (
"fmt"
"github.com/spf13/viper"
)
type Config struct {
// self host details
host string
port int
// k8s configs
namespace string
}
func (c *Config) Init() {
viper.SetDefault("host", "localhost")
viper.SetDefault("port", 9090)
viper.SetDefault("namespace", "default")
}
func (c *Confi... |
package reactor
import "fmt"
var (
_ Alarm = (*ThresholdAlarm)(nil)
)
// NewThresholdAlarm returns a new threshold alarm.
func NewThresholdAlarm(name string, valueProvider func() float64, severityProvider func(float64) Severity) *ThresholdAlarm {
ta := &ThresholdAlarm{
Name: name,
ValueProvider: ... |
package namespace
import (
"context"
"time"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/wait"
typedcorev1 "k8s.io/client-go/kubernetes/typed/core/v1"... |
// Code generated by go-swagger; DO NOT EDIT.
package models
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
import (
"context"
"github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// EncryptedCardData EncryptedCardDat... |
package merkle
import (
"bytes"
"golang.org/x/crypto/ripemd160"
. "github.com/intfoundation/go-common"
"github.com/intfoundation/go-wire"
)
const proofLimit = 1 << 16 // 64 KB
type IAVLProof struct {
LeafHash []byte
InnerNodes []IAVLProofInnerNode
RootHash []byte
}
func (proof *IAVLProof) Verify(key []... |
package docs
import "bgm38/config"
// OpenAPI
func OpenAPI() string {
SwaggerInfo.Version = config.Version
return (&s{}).ReadDoc()
} |
package query
import (
"database/sql"
"html/template"
"net/http"
"github.com/budden/semdict/pkg/apperror"
"github.com/budden/semdict/pkg/sddb"
"github.com/budden/semdict/pkg/user"
"github.com/gin-gonic/gin"
)
// parameters
type lwsEditParamsType struct {
Lwsid int64 // 0 when creating
Sduserid int64 ... |
package manager
import (
"context"
"fmt"
"io"
"os"
"os/exec"
"path/filepath"
"reflect"
"strings"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
"gopkg.in/yaml.v2"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/runtime"
"github.com/longhorn/longhorn-manager/util"
)
var VERSION = "v0.3.0"
type Bu... |
package go_koans
import (
"io/ioutil"
"strings"
)
func aboutFiles() {
filename := "about_files.go"
contents, _ := ioutil.ReadFile(filename)
lines := strings.Split(string(contents), "\n")
assert(lines[0] == "package go_koans") // handling files is too trivial
assert(lines[5] == ")") // handling ... |
package types
import (
"fmt"
yaml "gopkg.in/yaml.v2"
sdk "github.com/cosmos/cosmos-sdk/types"
paramtypes "github.com/cosmos/cosmos-sdk/x/params/types"
"github.com/ethereum/go-ethereum/core/vm"
ethermint "github.com/cosmos/ethermint/types"
)
var _ paramtypes.ParamSet = &Params{}
// Parameter keys
var (
Par... |
/*
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, ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.