text stringlengths 10 1.05M |
|---|
// +build go1.13
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
... |
// *** 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 v20190701
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// The source user image virtual hard disk. The virtual hard disk will be copied before ... |
package gateway
import (
"fmt"
gorm_logrus "github.com/onrik/gorm-logrus"
"gorm.io/driver/mysql"
"gorm.io/gorm"
)
func OpenMySQL(username, password, host string, port int, database string) (*gorm.DB, error) {
dsn := fmt.Sprintf("%s:%s@tcp(%s:%d)/%s?charset=utf8&parseTime=True&multiStatements=true", username, pa... |
package excelize1
import (
"fmt"
"github.com/xuri/excelize/v2"
_ "image/gif"
_ "image/jpeg"
_ "image/png"
"strings"
"testing"
)
const pathPrefix = "../../asset/"
// TestExcelizeHello 测试Excelize
func TestExcelizeHello(t *testing.T) {
f := excelize.NewFile()
// 创建一个工作表
index := f.NewSheet("Sheet2")
// 设置单元格... |
package main
import (
"os"
"testing"
)
func TestNewDeck(t *testing.T) {
d := newDeck()
if len(d) != 16 {
t.Errorf("Expected deck length of 16, but got %v", len(d))
}
if d[0] != "Ace of Spades" {
t.Errorf("Expected first card of Ace of Spades, but got %v", d[0])
}
if d[len(d)-1] != "Four of Clubs" {
t... |
package main
import (
"context"
"flag"
"fmt"
"strings"
"time"
"github.com/cheggaaa/pb/v3"
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/config"
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/datasource"
"github.com/VictoriaMetrics/VictoriaMetrics/app/vmalert/remotewrite"
"github.com/Vict... |
/*
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, ... |
// +build go1.13
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
... |
package main
type Altcoin struct {
Name string
PubKeyHashAddrID byte
PrivateKeyID byte
CoinType int
}
var altcoins = []Altcoin{
{"Ether", 0xff, 0xff, 60},
{"Bitcoin", 0x00, 0x80, 0},
{"42coin", 0x08, 0x88, -1},
{"Acoin", 0x17, 0xe6, -1},
{"Animecoin", 0x17, 0x97, -1},
{"Anoncoin", 0x... |
package kms
//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 grammar
import (
"errors"
"fmt"
)
type rawTokenBuilder struct {
name string
value string
code string
index int
gr string
}
func createRawTokenBuilder() RawTokenBuilder {
out := rawTokenBuilder{
name: "",
value: "",
code: "",
index: -1,
gr: "",
}
return &out
}
// Create initial... |
package xhttp
import (
"net/http"
"strconv"
"time"
"github.com/go-phorce/dolly/metrics"
"github.com/go-phorce/dolly/metrics/tags"
"github.com/go-phorce/dolly/xhttp/identity"
)
// a http.Handler that records execution metrics of the wrapper handler
type requestMetrics struct {
handler http.Handler
respo... |
package reference
type Reference struct {
AccountName *string `json:"accountName,omitempty"`
AccountNumber *string `json:"accountNumber,omitempty"`
Iban *string `json:"IBAN,omitempty"`
Reference *string `json:"reference,omitempty"`
SortCode *string `json:"sortCode,omitempty"`
}
type Get struc... |
package gcp
import (
"context"
"strings"
"github.com/turbot/steampipe-plugin-sdk/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/plugin"
"github.com/turbot/steampipe-plugin-sdk/plugin/transform"
"google.golang.org/api/bigquery/v2"
)
//// TABLE DEFINITION
func tableGcpBigQueryDataset(ctx context.Context) ... |
package indexer
import (
"fmt"
l2common "github.com/ethereum-optimism/optimism/l2geth/common"
"github.com/ethereum/go-ethereum/common"
)
// ParseL1Address parses a L1 ETH addres from a hex string. This method will
// fail if the address is not a valid hexidecimal address.
func ParseL1Address(address string) (comm... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: metrics/v3/ingestion_service.proto
package metrics
import (
context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
math "math"
)
/... |
package middleware
import (
"bufio"
"bytes"
"io"
"io/ioutil"
"net"
"net/http"
"github.com/linthan/echo/v4"
)
type (
// BodyDumpConfig defines the config for BodyDump middleware.
BodyDumpConfig struct {
// Skipper defines a function to skip middleware.
Skipper Skipper
// Handler receives request and r... |
/*
Copyright 2016-2019 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 agreed to in writing,... |
/*
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, ... |
package monitoring
import (
"context"
"fmt"
"testing"
"time"
"github.com/stretchr/testify/require"
"go.uber.org/goleak"
)
func TestPoller(t *testing.T) {
for _, testCase := range []struct {
name string
duration time.Duration
waitOnRead time.Duration
pollInterval time.Duration
r... |
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT license.
package requests
import (
"context"
"fmt"
"github.com/AzureAD/microsoft-authentication-library-for-go/internal/msalbase"
)
type openIDConfigurationEndpointManager interface {
getOpenIDConfigurationEndpoint(ctx context.Context, authorityI... |
package packages
const (
URL_PACKAGES_LIST = "/ark/open_api/v0/packages" // 订单列表路由
METHOD_PACKAGES_LIST = "package.getPackageList"
)
// TimeType startTime/endTime对应的时间类型
type TimeType int
const (
CREATED TimeType = iota + 1 // 创建时间
UPDATED // 更新时间
)
// Int ...
func (t TimeType) Int() int ... |
package sample
import (
. "github.com/onsi/ginkgo"
. "github.com/onsi/gomega"
)
var _ = Describe("Sample", func() {
Describe("Calculating square root", func() {
Context("of the number 4", func() {
It("should result 2", func() {
Setup()
Expect(GetResult()).To(Equal(2.0))
})
})
})
}) |
// Code generated by go-swagger; DO NOT EDIT.
// Copyright (c) 2020 Samuel Mutel <12967891+smutel@users.noreply.github.com>
//
// Permission to use, copy, modify, and distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
// copyright notice and this permission notic... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/datastore/v1/query.proto
package datastore // import "google.golang.org/genproto/googleapis/datastore/v1"
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import wrappers "github.com/golang/protobuf/ptypes/wrappers"
... |
package contractcourt
import (
"fmt"
"sync"
"sync/atomic"
"github.com/davecgh/go-spew/spew"
"github.com/lightningnetwork/lnd/chainntnfs"
"github.com/lightningnetwork/lnd/channeldb"
"github.com/lightningnetwork/lnd/lnwallet"
"github.com/roasbeef/btcd/chaincfg"
"github.com/roasbeef/btcd/chaincfg/chainhash"
"g... |
// Code generated by go-swagger; DO NOT EDIT.
package user
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
import (
"errors"
"net/url"
golangswaggerpaths "path"
"strings"
)
// UpdateUserURL generates an URL for the update user operatio... |
// Package label is a priority label based selector.
package label
import (
"context"
"sync"
"github.com/jinbanglin/go-micro/cmd"
"github.com/jinbanglin/go-micro/registry"
"github.com/jinbanglin/go-micro/selector"
)
/*
A priority based label selector. Rather than just returning nodes with specific labels
... |
package main
import (
"fmt"
"github.com/clnbs/wordChains/internal/app/wordchainsresolver"
"os"
"strings"
)
func usage(programName string) {
fmt.Println("usage :\t\t", programName, "path/to/wordlist.txt word1 word2")
fmt.Println("example :\t", programName, "./assets/app/small_en.txt cat dog")
}
func printSoluti... |
package testcontainers
import (
"archive/tar"
"bytes"
"context"
"fmt"
"io"
"io/ioutil"
"strings"
"testing"
"time"
"github.com/pkg/errors"
"github.com/romnnn/testcontainers-go/wait"
)
func Test_ContainerValidation(t *testing.T) {
type ContainerValidationTestCase struct {
Name string
Expec... |
package cache
import (
"encoding/base64"
"encoding/json"
"fmt"
"math/rand"
"sort"
"time"
log "github.com/sirupsen/logrus"
"github.com/neuvector/neuvector/controller/scan"
"github.com/neuvector/neuvector/share"
"github.com/neuvector/neuvector/share/cluster"
scanUtils "github.com/neuvector/neuvector/share/s... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: google/cloud/automl/v1/service.proto
package automl
import (
context "context"
fmt "fmt"
math "math"
proto "github.com/golang/protobuf/proto"
_ "google.golang.org/genproto/googleapis/api/annotations"
longrunning "google.golang.org/genproto/googleapis/... |
package wf
import (
"github.com/lyraproj/puppet-evaluator/eval"
"github.com/lyraproj/servicesdk/wfapi"
)
type stateless struct {
activity
function interface{}
}
func NewStateless(name string, when wfapi.Condition, input, output []eval.Parameter, function interface{}) wfapi.Stateless {
return &stateless{activity... |
/*
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, ... |
// SPDX-License-Identifier: Apache-2.0
// Copyright (c) 2020 Intel Corporation
package appcontext
import (
"fmt"
"strings"
log "github.com/open-ness/EMCO/src/orchestrator/pkg/infra/logutils"
"github.com/open-ness/EMCO/src/orchestrator/pkg/rtcontext"
pkgerrors "github.com/pkg/errors"
)
// metaPrefix used for de... |
package datadog
import (
"context"
"strings"
datadog "github.com/DataDog/datadog-api-client-go/api/v2/datadog"
"github.com/turbot/steampipe-plugin-sdk/v3/grpc/proto"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin"
"github.com/turbot/steampipe-plugin-sdk/v3/plugin/transform"
)
func tableDatadogRole(ctx conte... |
package types
import (
"encoding/json"
"math"
"strconv"
"strings"
"github.com/gogo/protobuf/proto"
"gopkg.in/yaml.v2"
sdk "github.com/cosmos/cosmos-sdk/types"
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
)
type TokenI interface {
GetSymbol() string
GetName() string
GetScale() uint32
GetMinUnit(... |
/*
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, ... |
// 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.
// +build windows
package win32
import (
"fmt"
"syscall"
"unicode/utf16"
"github.com/as/shiny/event/key"
"github.com/as/shiny/screen"
)
type Key = key.... |
// Copyright 2016 Nemanja Zbiljic
//
package main
import (
"encoding/json"
"errors"
"flag"
"fmt"
"net/http"
"net/url"
"os"
"strconv"
"strings"
"time"
)
const (
description = "CLI tool to search artifacts in maven central repository"
version = "0.2.0"
)
var (
fGroupId = flag.String("g", "", "spe... |
// Copyright 2022 The Okteto 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 ... |
package job_test
import (
"testing"
"github.com/stretchr/testify/assert"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/uuid"
k8upv1 "github.com/k8up-io/k8up/v2/api/v1"
"github.com/k8up-io/k8up/v2/operator/job"
)
func TestGroupByStatus(t *testing.T) {
successJob := createJob(comp... |
package server
import (
"net/http"
"github.com/maxmoehl/tt"
)
var StatusCodeMapping = map[tt.Error]int{
tt.ErrInvalidData: http.StatusBadRequest,
tt.ErrInternalError: http.StatusInternalServerError,
tt.ErrNotFound: http.StatusNotFound,
} |
//go:build go1.18
// +build go1.18
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// Code generated by Microsoft (R) AutoRest Code Generator.
// Changes may cause incorrect behavior and will be lost if the cod... |
// 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 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 lsprpc
import (
"context"
"encoding/json"
"fmt"
"sync"
"golang.org/x/tools/internal/event"
jsonrpc2_v2 "golang.org/x/tools/internal/jsonrpc2_v2"... |
package skyspark
import (
"encoding/json"
"fmt"
"regexp"
"strconv"
"strings"
"github.com/grafana/grafana/pkg/components/null"
"github.com/grafana/grafana/pkg/tsdb"
)
type ResponseParser struct{}
var (
legendFormat *regexp.Regexp
)
func init() {
legendFormat = regexp.MustCompile(`\[\[(\w+)(\.\w+)*\]\]*|\$\... |
package csp
/*
#include "common.h"
*/
import "C"
import (
"sync"
"unsafe"
)
type cb func(pbData *C.BYTE, cbData C.DWORD, fFinal bool) bool
var callbacks = make(map[int64]cb)
var idx int64
var mu sync.RWMutex
func registerCallback(cb cb) int64 {
mu.Lock()
defer mu.Unlock()
idx++
callbacks[idx] = cb
return... |
package internal
import (
"unsafe"
)
func f1798(ctx *Context, l0 int32) int32 {
var l1 int32
_ = l1
var s0i32 int32
_ = s0i32
var s1i32 int32
_ = s1i32
var s2i32 int32
_ = s2i32
var s3i32 int32
_ = s3i32
s0i32 = l0
s1i32 = 24708
*(*uint32)(unsafe.Pointer(&ctx.Mem[int(s0i32+0)])) = uint32(s1i32)
s0i32 =... |
// Copyright (c) 2013-2016 The btcsuite developers
// Copyright (c) 2015-2016 The Decred developers
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file.
package wire
import (
"crypto/rand"
"encoding/binary"
"fmt"
"io"
"math"
"time"
"github.com/HcashOrg/hcashd/chai... |
package router
import (
"github.com/gin-gonic/gin"
"github.com/Wan-Mi/ginWebService/server"
)
func ping(c *gin.Context) (int, interface{}, error) {
return server.StatusOK, "ping success", nil
}
func init() {
server.GET("/ping", ping)
} |
package destinations
import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
c "github.com/rudderlabs/terraform-provider-rudderstack/rudderstack/configs"
)
func init() {
c.Destinations.Register("vwo", c.ConfigMeta{
APIType: "VWO",
Properties: []c.ConfigProperty{
c.Simple("accountId", "account_... |
// Code generated by protoc-gen-stack. DO NOT EDIT.
// source: rpc/greeter.proto
package greeter
import (
fmt "fmt"
proto "github.com/golang/protobuf/proto"
math "math"
)
import (
context "context"
api "github.com/stack-labs/stack-rpc/api"
client "github.com/stack-labs/stack-rpc/client"
server "github.com/sta... |
// Copyright 2014 The go-ethereum Authors
// This file is part of the go-ethereum library.
//
// The go-ethereum library is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License... |
package cmd
import (
"fmt"
"github.com/spf13/cobra"
)
var (
name = "gomeet" // injected with -ldflags in Makefile
version = "latest" // injected with -ldflags in Makefile
)
//
// cliCmd represents the cli command
var (
versionCmd = &cobra.Command{
Use: "version",
Short: "Return version",
Long: `Use ... |
package fiximports
import (
"flag"
"fmt"
"github.com/corsc/go-tools/fiximports/fiximports/internal/filetools"
"strings"
)
// FilesFromArgs translates supplied inputs into a list of filenames
type FilesFromArgs interface {
FileNames() ([]string, error)
}
func FilesFromArgsFactory(numArgs int) FilesFromArgs {
sw... |
package app
import (
"os"
"os/signal"
"syscall"
libhoney "github.com/honeycombio/libhoney-go"
"github.com/honeycombio/samproxy/collect"
"github.com/honeycombio/samproxy/config"
"github.com/honeycombio/samproxy/logger"
"github.com/honeycombio/samproxy/metrics"
"github.com/honeycombio/samproxy/route"
"github.... |
/*
Copyright © 2021 lflxp <382023823@qq.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 law or agreed to in writin... |
package main
// A CNI IPAM plugin that takes /proc/cmdline and the environment variables and
// outputs the CNI configuration required for the external IP address for the
// pod in question. IPAM plugins send and receive JSON on stdout and stdin,
// respectively, and are passed arguments and configuration information... |
package tickets
import (
"archive/zip"
"bytes"
"context"
"database/sql"
"encoding/json"
"fmt"
"io"
"net/http"
"sync"
"time"
"github.com/jonas747/dcmd"
"github.com/jonas747/discordgo"
"github.com/jonas747/dstate"
"github.com/jonas747/yagpdb/analytics"
"github.com/jonas747/yagpdb/commands"
"github.com/j... |
// Copyright 2021 xgfone
//
// 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) 2016, 2018, 2021, Oracle and/or its affiliates. All rights reserved.
// This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may choose ei... |
// Code generated by smithy-go-codegen DO NOT EDIT.
package elasticloadbalancing
import (
"context"
"fmt"
awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware"
"github.com/aws/aws-sdk-go-v2/aws/signer/v4"
"github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types"
"github.com/aws/smithy-go/middlewar... |
// Copyright 2020 CUE 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 ... |
/*
* Tencent is pleased to support the open source community by making 蓝鲸 available.
* Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
* Licensed under the MIT License (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the Li... |
// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: combos/unmarshaler/types.proto
package types
import (
bytes "bytes"
fmt "fmt"
types "github.com/gogo/protobuf/types"
_ "github.com/tron-us/protobuf/gogoproto"
proto "github.com/tron-us/protobuf/proto"
github_com_tron_us_protobuf_types "github.com/tro... |
package policies
import (
"reflect"
"github.com/huaweicloud/golangsdk"
"github.com/huaweicloud/golangsdk/pagination"
)
type ListOpts struct {
// id and status are not supported in API, will filtered by FilterPolicies
ID string `json:"id"`
Status string `json:"status"`
Name string `q:"name"`
... |
// +build !windows
package gost
import (
"errors"
"fmt"
"net"
"syscall"
"github.com/go-log/log"
)
type tcpRedirectHandler struct {
options *HandlerOptions
}
// TCPRedirectHandler creates a server Handler for TCP redirect server.
func TCPRedirectHandler(opts ...HandlerOption) Handler {
h := &tcpRedirectHandl... |
package main
import (
"fmt"
"sync"
"time"
"github.com/google/uuid"
)
type Message struct {
ID string `json:"id"`
UserID string `json:"userId"`
User *User `json:"user"`
RoomID string `json:"roomId"`
Message string `json:"message"`
Timestamp int64 `json:"timestamp"`
}
type MessageStore... |
/*
* 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 ... |
package monitor_test
import (
"context"
"fmt"
"testing"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance"
"github.com/hashicorp/terraform-provider-azurerm/internal/acceptance/check"
"github.com/hashicorp/terraform-provider-azurerm/internal/clients"
"github.com/hashicorp/terraform-provider-a... |
// Derived from Inferno utils/6c/reg.c
// https://bitbucket.org/inferno-os/inferno-os/src/default/utils/6c/reg.c
//
// Copyright © 1994-1999 Lucent Technologies Inc. All rights reserved.
// Portions Copyright © 1995-1997 C H Forsyth (forsyth@terzarima.net)
// Portions Copyright © 1997-1999 Vita Nuova Limited
// Portio... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: moc_cloudagent_container.proto
package storage
import (
context "context"
fmt "fmt"
proto "github.com/golang/protobuf/proto"
wrappers "github.com/golang/protobuf/ptypes/wrappers"
common "github.com/microsoft/moc/rpc/common"
grpc "google.golang.org/grpc... |
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
package app
import (
"github.com/mattermost/mattermost-server/v6/services/imageproxy"
)
// Channels contains all channels related state.
type Channels struct {
srv *Server
imageProxy *imageproxy.ImageP... |
package json
import (
"encoding/json"
"github.com/mono83/cfg"
"io"
"io/ioutil"
)
// NewReaderSource reads all bytes from source reader and runs NewBytesSource
// creating configurer from JSON bytes
func NewReaderSource(source io.Reader) (cfg.Configurer, error) {
bts, err := ioutil.ReadAll(source)
if err != nil ... |
// Code generated by protoc-gen-entgrpc. DO NOT EDIT.
package entpb
import (
context "context"
runtime "entgo.io/contrib/entproto/runtime"
sqlgraph "entgo.io/ent/dialect/sql/sqlgraph"
empty "github.com/golang/protobuf/ptypes/empty"
ent "github.com/open-farms/inventory/ent"
location "github.com/open-farms/invento... |
// Copyright (c) 2019 VMware, Inc. All Rights Reserved.
// SPDX-License-Identifier: Apache-2.0
package cmd
import (
"fmt"
"os"
"github.com/spf13/cobra"
"github.com/vmware-tanzu/crash-diagnostics/exec"
"github.com/vmware-tanzu/crash-diagnostics/parser"
"github.com/vmware-tanzu/crash-diagnostics/script"
)
type ... |
// *** 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 v20210401preview
import (
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
// Maintenance configuration record type
func LookupMaintenanceConfiguration(ctx ... |
package protofiles
import (
"testing"
"github.com/stretchr/testify/assert"
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/types/known/structpb"
)
func TestYamlProto(t *testing.T) {
ast := assert.New(t)
jsonContext := map[string]interface{}{
"data": map[string]interface{}{
"value": 1,
},
... |
// Copyright 2018 JDCLOUD.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 law or agreed to in ... |
package insmgr
import (
"github.com/v2fly/VSign/instructions"
"sort"
)
type SortableInstructions struct {
instructions.Instruction
sortkey string
}
type SortableInstructionsHolder struct {
insa []SortableInstructions
ins []instructions.Instruction
}
func (s SortableInstructionsHolder) Len() int {
return len... |
package lib
import (
"fmt"
"os"
)
var (
DefaultApiVersionNumber = "45.0"
apiVersionNumber = DefaultApiVersionNumber
apiVersion = fmt.Sprintf("v%s", apiVersionNumber)
)
func ApiVersion() string {
return apiVersion
}
func ApiVersionNumber() string {
return apiVersionNumber
}
func (f *Force... |
package main
import (
"encoding/json"
"flag"
"os"
"path/filepath"
cf_http "code.cloudfoundry.org/cfhttp"
cf_lager "code.cloudfoundry.org/cflager"
cf_debug_server "code.cloudfoundry.org/debugserver"
"code.cloudfoundry.org/goshims/execshim"
"code.cloudfoundry.org/goshims/filepathshim"
"code.cloudfoundry.org/... |
//go:build !ignore_autogenerated
// +build !ignore_autogenerated
/*
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... |
package policy
import (
"context"
"strings"
"github.com/kopia/kopia/repo"
"github.com/kopia/kopia/snapshot"
)
// ApplyRetentionPolicy applies retention policy to a given source by deleting expired snapshots.
func ApplyRetentionPolicy(ctx context.Context, rep *repo.Repository, sourceInfo snapshot.SourceInfo, real... |
package game
import (
"go-agar/internal/util"
"math"
"sort"
"time"
)
type Player struct {
Id string
Name string
cells []*Cell
X float64
Y float64
targetX float64
targetY float64
Color string
TextColor s... |
/*
* Anchore Engine API Server
*
* This is the Anchore Engine API. Provides the primary external API for users of the service.
*
* API version: 0.1.16
* Contact: nurmi@anchore.com
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package external
import (
_context "cont... |
package mock
import (
"fmt"
"net/http"
)
// Test variables for MockClient and unit testing
var (
keyFmt = "%s:%s"
testJenkinsURL = "http://mockjenkins:8080"
testJobName = "test_pipeline"
jobPath = "%s/job/%s"
runPath = "%s/job/%s/%d/"
jobJSONPath = "/job/%s/api/js... |
// Copyright (c) 2018 The MATRIX Authors
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php
package reelection
import (
"errors"
"github.com/MatrixAINetwork/go-matrix/common"
"github.com/MatrixAINetwork/go-matrix/core"
"github.... |
// Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the Lice... |
// package main provides an implementation of netcat using the secio package.
// This means the channel is encrypted (and MACed).
// It is meant to exercise the spipe package.
// Usage:
// seccat [<local address>] <remote address>
// seccat -l <local address>
//
// Address format is: [host]:port
package main
imp... |
package render
import (
"errors"
"github.com/stretchr/testify/assert"
"net/http/httptest"
"testing"
)
func TestRenderYAML(t *testing.T) {
w := httptest.NewRecorder()
data := `
a : Easy!
b:
c: 2
d: [3, 4]
`
(YAML{data}).WriteContentType(w)
assert.Equal(t, "application/x-yaml; charset=utf-8", w.Header().Get(... |
package good
import (
"time"
tf "github.com/tensorflow/tensorflow/tensorflow/go"
"github.com/zartbot/go_utils/map2value"
"github.com/zartbot/golap/api/datastream"
)
func DefaultModelFunc(d *datastream.DataStream, m *ModelContainer, sess *tf.Session) {
startTime := time.Now()
imgBytes, err := map2value.MapToBy... |
// Code generated by informer-gen. DO NOT EDIT.
package externalversions
import (
"fmt"
v1alpha1 "github.com/aquasecurity/starboard/pkg/apis/aquasecurity/v1alpha1"
schema "k8s.io/apimachinery/pkg/runtime/schema"
cache "k8s.io/client-go/tools/cache"
)
// GenericInformer is type of SharedIndexInformer which will ... |
// Licensed to ClickHouse, Inc. under one or more contributor
// license agreements. See the NOTICE file distributed with
// this work for additional information regarding copyright
// ownership. ClickHouse, Inc. licenses this file to you under
// the Apache License, Version 2.0 (the "License"); you may
// not use this... |
package service
import (
"log"
"time"
"github.com/dgrijalva/jwt-go"
"github.com/mdouchement/standardfile/internal/model"
"github.com/mdouchement/standardfile/internal/server/serializer"
)
type userService20161215 struct {
userServiceBase
}
func (s *userService20161215) Register(params RegisterParams) (Render,... |
package automation
// Copyright (c) Microsoft and contributors. 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
//
// ... |
package models
type ElasticModel interface {
GetMapping() string
} |
/*
Copyright 2019 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... |
package dockerfile
import (
"fmt"
"os"
"path/filepath"
"strings"
"github.com/docker/docker/pkg/system"
)
// normaliseDest normalises the destination of a COPY/ADD command in a
// platform semantically consistent way.
func normaliseDest(cmdName, workingDir, requested string) (string, error) {
dest := filepath.F... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.