text stringlengths 3.08k 10.4k |
|---|
// Copyright (c) 2018 Cisco and/or 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... |
package initial
import (
"bufio"
"crypto/tls"
"mctl/cmd"
"net/http"
"os"
"path/filepath"
"strings"
"text/template"
"github.com/iancoleman/strcase"
"github.com/kris-nova/logger"
"github.com/spf13/cobra"
)
var Init = &cobra.Command{
Use: "init",
Short: "\tInitial Tile or Deployment... |
package metrics
import (
"context"
"strings"
"github.com/docker/go-events"
metrics "github.com/docker/go-metrics"
"github.com/docker/swarmkit/api"
"github.com/docker/swarmkit/manager/state/store"
)
var (
ns = metrics.NewNamespace("swarm", "manager", nil)
// counts of the various objects in swarmkit
nodesM... |
/****************************************************************************
* Copyright 2019-2020, Optimizely, Inc. and contributors *
* *
* Licensed under the Apache License, Version 2.0 (the "License"); *
* you m... |
/*
Copyright 2009-2016 Weibo, Inc.
All files licensed under the Apache License, Version 2.0 (the "License");
you may not use these files 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 writ... |
/*
Copyright 2019 The OpenEBS 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 libcoap
/*
#cgo LDFLAGS: -lcoap-2-openssl
#include <coap2/coap.h>
#include "callback.h"
*/
import "C"
import "unsafe"
type Resource struct {
ptr *C.coap_resource_t
handlers map[Code]MethodHandler
isRemovable bool
isBlockwiseInProgress bool
customerId *int
}
type ResourceFlags int
c... |
package artifactory
import (
"fmt"
"gopkg.in/yaml.v2"
"math"
"net/http"
"reflect"
"strings"
"testing"
"github.com/go-resty/resty/v2"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/terraform"
)
func fmtMapToHcl(fields map[string]interface{}) stri... |
/*
Copyright 2015 Home Office All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in ... |
package unpackerr
import (
"fmt"
"sync"
"golift.io/cnfg"
)
/* This file contains all the unique bits for each app. When adding a new app,
duplicate the lidarr.go file and rename all the things, then add the new app
to the various places below, in this file.
*/
// DefaultQueuePageSize is how many items we r... |
/*
Copyright © 2022 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... |
package efgs
import (
"context"
"encoding/json"
"fmt"
efgsdatabase "github.com/covid19cz/erouska-backend/internal/functions/efgs/database"
"github.com/covid19cz/erouska-backend/internal/functions/efgs/redis"
"github.com/covid19cz/erouska-backend/internal/functions/efgs/redismutex"
efgsutils "github.com/covid19c... |
// Copyright 2019 Bubble. All rights reserved.
// Use of this source code is governed by a MIT-style
// license that can be found in the LICENSE file.
package master
import (
"bubble/cron"
"bubble/def"
"bubble/env"
"fmt"
"io/ioutil"
"os"
"path"
"path/filepath"
"sort"
"strconv"
"sync"
log "github.com/cihu... |
// Copyright (C) 2014 The Syncthing Authors.
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this file,
// You can obtain one at https://mozilla.org/MPL/2.0/.
package scanner
import (
"bytes"
"context"
"fmt"
"hash"
"io"
... |
/*
* Tencent is pleased to support the open source community by making TKEStack
* available.
*
* Copyright (C) 2012-2019 Tencent. 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 th... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package elasticbeanstalk
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type ListPlatformVersionsInput struct {
_ struct{} `type:"structure"`
// Criteria for restricting the resulting ... |
// Copyright 2021 The Cloudprober 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... |
// Copyright 2017-2018 DigitalOcean.
//
// 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... |
package processor
import (
"bytes"
"cloud.google.com/go/pubsub"
"context"
"crypto/sha256"
"encoding/json"
"fmt"
"github.com/ONSdigital/ssdc-rm-pubsub-adapter/config"
"github.com/ONSdigital/ssdc-rm-pubsub-adapter/logger"
"github.com/ONSdigital/ssdc-rm-pubsub-adapter/models"
"github.com/pkg/errors"
"github.co... |
// Copyright © 2017 Joyent, 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 ... |
// 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-present Datadog, Inc.
package fetch
import (
"fmt"
"sort"
"strings"
"github.com/cihub/see... |
// Copyright (c) 2015 Mattermost, Inc. All Rights Reserved.
// See License.txt for license information.
package api
import (
l4g "code.google.com/p/log4go"
"fmt"
"github.com/gorilla/mux"
"github.com/mattermost/platform/model"
"github.com/mattermost/platform/utils"
"net/http"
"net/url"
)
func InitOAuth(r *mux.... |
// Code generated by entc, DO NOT EDIT.
package ent
import (
"fmt"
"strings"
"entgo.io/ent/dialect/sql"
"github.com/mrzack99s/netcoco/ent/device"
"github.com/mrzack99s/netcoco/ent/ipaddress"
)
// IPAddress is the model entity for the IPAddress schema.
type IPAddress struct {
config `json:"-"`
// ID of the en... |
package hydratables
import (
"fmt"
"math"
"strconv"
"ecksbee.com/telefacts/pkg/attr"
"ecksbee.com/telefacts/pkg/serializables"
)
type LabelLinkLabel struct {
Label string
Role string
Lang string
CharData string
}
type LabelArc struct {
Order float64
Arcrole string
From string
To st... |
package fastrand64
import (
"reflect"
"testing"
"time"
"unsafe"
"github.com/stretchr/testify/assert"
)
type UnsafePcg32RNG struct {
state uint64
inc uint64
}
func (r *UnsafePcg32RNG) SetState(initstate uint64, initseq uint64) {
r.state = 0
r.inc = (initseq << 1) | 1
r.Uint32()
r.state += initstate
r.U... |
// Copyright (C) 2019-2021, Ava Labs, Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package network
import (
"crypto"
"crypto/tls"
"time"
"github.com/ava-labs/avalanchego/ids"
"github.com/ava-labs/avalanchego/network/dialer"
"github.com/ava-labs/avalanchego/network/throttling"
"github... |
/*
Copyright 2021 IBM All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package gateway
import (
"fmt"
"sort"
"sync"
"github.com/golang/protobuf/proto"
dp "github.com/hyperledger/fabric-protos-go/discovery"
"github.com/hyperledger/fabric-protos-go/gossip"
"github.com/hyperledger/fabric/common/flogg... |
/*
Copyright (C) 2017 Verizon. All Rights Reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in... |
package main
import (
"flag"
"os"
"github.com/openshift/online-analytics/pkg/useranalytics"
osclient "github.com/openshift/origin/pkg/client"
"github.com/openshift/origin/pkg/cmd/util/clientcmd"
restclient "k8s.io/client-go/rest"
kclientcmd "k8s.io/client-go/tools/clientcmd"
kclientset "k8s.io/kubernetes/pk... |
package lite
import (
"io"
"os"
"sync"
"github.com/cosmos/cosmos-sdk/client"
"github.com/cosmos/cosmos-sdk/client/flags"
"github.com/cosmos/cosmos-sdk/client/tx"
"github.com/cosmos/cosmos-sdk/codec"
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
"github.com/cosmos/cosmos-sdk/crypto/keyring"
sdk "gith... |
// Package wkhtmltoimage provides a simple wrapper around wkhtmltoimage (http://wkhtmltopdf.org/) binary.
package wkhtmltopdf
import (
"bytes"
"encoding/base64"
"encoding/json"
"errors"
"fmt"
"image/jpeg"
"image/png"
"io"
"os"
"os/exec"
"path/filepath"
"strconv"
"strings"
)
// ImageOptions represent the ... |
package pdiutil
import (
"fmt"
"log"
"regexp"
"strings"
"github.com/imroc/req"
"github.com/tidwall/gjson"
)
// PDIClient for programming
type PDIClient struct {
// pdi user name
username string
// pdi user password
password string
// pdi tenant hostname
hostname string
// tenant release version
release... |
package common
import (
"bytes"
"context"
"crypto/md5"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"path/filepath"
"runtime"
"strconv"
"strings"
"time"
)
func RemoveFileExtension(inputFile string) string {
ext := filepath.Ext(inputFile)
if ext != "" {
return strings.T... |
/*
Copyright 2019 The kaamer 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 install
import (
"github.com/aliyun/aliyun_assist_client/thirdparty/service"
"github.com/aliyun/aliyun_assist_client/agent/util"
)
const (
systemdScript = `[Unit]
Description={{.Description}}
ConditionFileIsExecutable={{.Path|cmdEscape}}
{{range $i, $dep := .Dependencies}}
{{$dep}} {{end}}
[Service]
Sta... |
package messagequeue
import (
"context"
"sync"
"time"
"github.com/ipfs/go-block-format"
gsmsg "github.com/ipfs/go-graphsync/message"
gsnet "github.com/ipfs/go-graphsync/network"
logging "github.com/ipfs/go-log"
"github.com/libp2p/go-libp2p-core/peer"
)
var log = logging.Logger("graphsync")
const maxRetries... |
package hls
import (
"bytes"
"fmt"
"io"
"strconv"
"time"
"github.com/aler9/gortsplib"
"github.com/aler9/gortsplib/pkg/aac"
"github.com/aler9/gortsplib/pkg/h264"
"github.com/asticode/go-astits"
)
const (
mpegtsPCROffset = 400 * time.Millisecond // 2 samples @ 5fps
)
type muxerVariantMPEGTSSegment struct {
... |
// Copyright 2015 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable... |
package scanner
import (
"strconv"
"strings"
"unicode"
"unicode/utf8"
"github.com/youla-dev/godenv/internal/token"
)
// nolint:gochecknoglobals // TODO (titusjaka): rewrite this code in future.
var escaper = strings.NewReplacer(
`\n`, "\n",
`\t`, "\t",
`\r`, "\r",
`\v`, "\v",
`\f`, "\f",
)
const (
bom = ... |
package generator
import (
"encoding/json"
"fmt"
"golang.org/x/net/html"
"io/ioutil"
"net/http"
"strconv"
"strings"
)
type rawExifTag struct {
Id uint16 `json:"id"`
Name string `json:"name"`
TypeName string `json:"typeName"`
Description string `json:"description"`
}
type rawExif struct ... |
package main
import (
"context"
"encoding/json"
"flag"
"fmt"
"os"
"time"
"github.com/libp2p/go-libp2p"
core "github.com/libp2p/go-libp2p-core"
"github.com/libp2p/go-libp2p-core/peer"
"github.com/libp2p/go-libp2p-core/protocol"
"github.com/libp2p/go-libp2p-kad-dht/crawler"
"github.com/multiformats/go-multi... |
package form
import (
"fmt"
"html/template"
"strings"
)
const (
// CheckboxInput is a fieldset that groups a number of "checkbox" inputs for the same variable.
CheckboxInput ElementType = "checkbox"
// ColorInput is an input element with type "color".
ColorInput ElementType = "color"
// DateInput is an input ... |
package main
import (
"strings"
"sync"
"time"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/common/log"
"github.com/soniah/gosnmp"
)
const prefix = "apc_inrow_"
var (
upDesc *prometheus.Desc
airflowDesc *prometheus.Desc
rackInetTemp *prometheus.Desc
supplyAi... |
package task
import (
"fmt"
"time"
"github.com/google/uuid"
"github.com/pkg/errors"
"github.com/determined-ai/determined/master/pkg/actor"
"github.com/determined-ai/determined/master/pkg/model"
)
var (
preemptionTimeoutDuration = time.Hour
errNoPreemptionStatus = errors.New("no preemption status availa... |
// Copyright (c) 2019-present Mattermost, Inc. All Rights Reserved.
// See License for license information.
package oauther
import (
"net/http"
"time"
"golang.org/x/oauth2"
pluginapi "github.com/mattermost/mattermost-plugin-api"
"github.com/mattermost/mattermost-plugin-api/experimental/bot/logger"
"github.com... |
package logging
import (
"context"
"encoding/json"
"fmt"
"math"
"math/rand"
"time"
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/credentials"
"github.com/aws/aws-sdk-go/aws/credentials/stscreds"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws... |
package dbmerr
import (
"fmt"
"strings"
)
type msgErr string
func (e msgErr) Error() string {
return string(e)
}
func newMsgErr(mainMsg, tableName, mutexName string, err error) msgErr {
return msgErr(formatMsg(mainMsg, tableName, mutexName, err))
}
func formatMsg(mainMsg, tableName, mutexName string, err error... |
// Author <NAME>
// License MIT
// SerialForwarder connection library.
package moteconnection
import "io"
import "time"
import "errors"
import "fmt"
import "bufio"
import "strconv"
import "net"
type SfConnection struct {
BaseMoteConnection
Host string
Port uint16
conn net.Conn
connbuf *bufio.Reader
}
fu... |
/*
Copyright 2019 The Predictive Horizontal Pod Autoscaler 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 main
import (
"context"
"encoding/base64"
"encoding/json"
"fmt"
"log"
"net/http"
"os"
"strings"
"github.com/aws/aws-sdk-go/aws/arn"
"github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
"github.com/aws/aws-lambda-go/lambdacontext"
"github.com/aws/aws-sdk-go/aws"
"github.co... |
// Options package holds the option settings for a single graph generation.
package options
import (
"net/http"
"net/url"
"strconv"
"strings"
"time"
"github.com/gorilla/mux"
"github.com/kiali/kiali/graph"
"github.com/kiali/kiali/graph/appender"
"github.com/kiali/kiali/services/models"
)
const (
AppenderAl... |
// Copyright 2019 The Go Cloud Development Kit 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 appli... |
// Copyright 2020 <NAME>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, ... |
package main
import (
"encoding/json"
"fmt"
// "os"
"github.com/tzaffi/go-bitbucket"
"golang.org/x/crypto/ssh/terminal"
"reflect"
"sort"
"strconv"
"syscall"
)
func getMyRepos(client *bitbucket.Client, owner string, team string, options ...string) interface{} {
opt := &bitbucket.RepositoriesOptions{
Owner:... |
package websocket
import (
"encoding/json"
"net/http"
"log"
"sync"
"github.com/gorilla/websocket"
"github.com/imba3r/thunder"
"github.com/imba3r/thunder/store"
)
type WebSocketOperation string
const (
// Incoming
Subscribe WebSocketOperation = "SUBSCRIBE"
Add WebSocketOperation = "ADD"
Set W... |
// *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
package serviceAccount
import (
"github.com/pkg/errors"
"github.com/pulumi/pulumi/sdk/go/pulumi"
)
// Allows management of a [Google Cloud Platf... |
package config
import (
"fmt"
"github.com/iancoleman/strcase"
"sort"
"strings"
)
type NamingConvention interface {
// ToCQLColumn converts a GraphQL/REST name to a CQL column name.
ToCQLColumn(tableName string, fieldName string) string
// ToCQLColumn converts a GraphQL/REST name to a CQL table name.
ToCQLTab... |
package base64
/*
#cgo CFLAGS: -I../c-deps/base64/include
#cgo LDFLAGS: -L../c-deps/base64/lib -lbase64
#include <stddef.h>
#include "libbase64.h"
*/
import "C"
import (
"errors"
"unsafe"
)
// The values below force the use of a given codec, even if that codec
// is a no-op in the current build. Used in testing. S... |
package golf
import (
"fmt"
)
func (l *Logger) genMsg(attrs map[string]interface{}, level int, msg string, va ...interface{}) *Message {
newMsg := l.NewMessage()
newMsg.Level = level
if len(va) > 0 {
newMsg.ShortMessage = fmt.Sprintf(msg, va...)
} else {
newMsg.ShortMessage = msg
}
newMsg.Attrs = attrs
re... |
// Copyright Yahoo. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
// vespa clone command
// author: bratseth
package cmd
import (
"archive/zip"
"errors"
"fmt"
"io"
"log"
"net/http"
"os"
"path/filepath"
"strings"
"time"
"github.com/spf13/cobra"
"github.com/vespa-engi... |
// Package lock implements coordinated etcd locking across multiple locks to
// provide a safe experience between different parts of the volplugin system.
//
// Currently this package coordinates create, remove, mount and snapshot locks.
// Snapshot locks in particular are special; they are a secondary lock that
// exi... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: pkg/version/version.proto
/*
Package version is a generated protocol buffer package.
It is generated from these files:
pkg/version/version.proto
It has these top-level messages:
Info
*/
package version
import proto "github.com/golang/protobuf/proto"
impo... |
package database
import (
"fmt"
"strings"
"github.com/Sirupsen/logrus"
"github.com/marema31/kamino/datasource"
"github.com/marema31/kamino/provider/common"
"github.com/marema31/kamino/provider/types"
)
func (saver *DbSaver) questionMarkByEngine(qm *[]string) string {
switch saver.engine {
case datasource.Mys... |
// Code generated by easyjson for marshaling/unmarshaling. DO NOT EDIT.
package icqbot
import (
json "encoding/json"
easyjson "github.com/mailru/easyjson"
jlexer "github.com/mailru/easyjson/jlexer"
jwriter "github.com/mailru/easyjson/jwriter"
)
// suppress unused package warning
var (
_ *json.RawMessage
_ *jle... |
// Package machinebox provides access to Facebox Remoto services.
package machinebox
import (
"github.com/matryer/remoto/remototypes"
)
// Facebox provides facial detection and recognition in images.
type Facebox interface {
// TeachFile teaches Facebox a new face from an image file.
TeachFile(TeachFileRequest) T... |
//
// Copyright © 2018 Aljabr, 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 ... |
package main
import (
"errors"
"reflect"
)
//Node represents a given point on a map
//g is the total distance of the node from the start
//h is the estimated distance of the node from the ending
//f is the total value of the node (g + h)
type node struct {
Parent *node
Position *Position
g int
h ... |
package main
import (
"os/exec"
"fmt"
"os"
"log"
"strings"
"bufio"
"regexp"
)
func main() {
var proxy string
if len(os.Args) != 2 {
ip := execCmd("w | grep ${USER} | awk '{print $3}' | uniq | tail -n 1")
ip = strings.TrimSpace(ip)
port := "8888"
proxy = "http://" + ip + ":" + port
} else {
proxy ... |
// Package page 保存Downloader下载结果,并且用于Processer解析页面。
package page
import (
"log"
"net/http"
"strings"
"github.com/PuerkitoBio/goquery"
"github.com/bitly/go-simplejson"
"github.com/viixv/crawler/core/commons/request"
"github.com/viixv/crawler/core/commons/result"
)
// Page代表了从Downloader下载到的一个页面,可能是HTML,也可能是JSON... |
package main
import (
"flag"
"fmt"
"io/ioutil"
"os"
"strings"
"time"
"rabbitmq-upgrade-preparation/logger"
"rabbitmq-upgrade-preparation/rabbitmqctl"
"rabbitmq-upgrade-preparation/versions"
"github.com/cenkalti/backoff"
)
func main() {
if os.Args[3] == "shutdown-cluster-if-cookie-changed" {
shutdownClu... |
// Copyright (C) 2019 rameshvk. All rights reserved.
// Use of this source code is governed by a MIT-style license
// that can be found in the LICENSE file.
// Package digest summarizes emails
package digest
import (
"encoding/base64"
"errors"
"github.com/jaytaylor/html2text"
"io/ioutil"
"mime"
"mime/multipart"... |
// termbox is a library for creating cross-platform text-based interfaces
package termbox
// public API, common OS agnostic part
type (
InputMode int
OutputMode int
EventType uint8
Modifier uint8
Key uint16
Attribute uint16
)
// This type represents a termbox event. The 'Mod', 'Key' a... |
// Copyright 2019 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 ... |
/*
Copyright 2021 The Kubernetes Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, ... |
/*
* Tencent is pleased to support the open source community by making TKEStack
* available.
*
* Copyright (C) 2012-2021 Tencent. 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 th... |
package main
import (
"encoding/json"
"fmt"
"log"
"net"
"net/http"
"time"
)
type CPUTempObj struct {
TimeStamp time.Time
HostAddress string
CPUTemp float64
}
// A single Broker will be created in this program. It is responsible
// for keeping a list of which clients are currently attached
// and broad... |
package cluster
import (
"fmt"
"github.com/aws/aws-sdk-go/service/ecs"
"github.com/stitchfix/flotilla-os/config"
"github.com/stitchfix/flotilla-os/state"
"testing"
)
type testResourceClient struct {
t *testing.T
listCalled int
}
func (trc *testResourceClient) DescribeClusters(input *ecs.DescribeClust... |
package resource
import (
"os"
"path/filepath"
bosherr "github.com/cloudfoundry/bosh-utils/errors"
boshcmd "github.com/cloudfoundry/bosh-utils/fileutil"
boshsys "github.com/cloudfoundry/bosh-utils/system"
bicrypto "github.com/cloudfoundry/bosh-cli/crypto"
)
type ArchiveImpl struct {
files []File
... |
package discord
import (
"fmt"
"time"
"github.com/andersfylling/disgord"
)
// Goal is to have this file as small as possible, the purpose of this file isn't about delegation so to say
// It's acting as an intermediary; separating global vars from the business logic
// This means the more code/logic I can get out ... |
package cmd
import (
"fmt"
"os"
"strings"
"text/tabwriter"
c "github.com/cnrancher/autok3s/cmd/common"
"github.com/cnrancher/autok3s/pkg/cluster"
"github.com/cnrancher/autok3s/pkg/common"
"github.com/cnrancher/autok3s/pkg/utils"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
var (
describeCmd = ... |
/*
Copyright 2021.
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 un... |
package webhookmodels
import (
"encoding/json"
"testing"
. "github.com/smartystreets/goconvey/convey"
)
var subscriptionCreatedWebhookRequest = []byte(`{
"id": "sub_00000000000000",
"plan": {
"interval": "year",
"name": "Developer",
"created": 1412968872,
"amount": 2394... |
/*
package account
repository.go
database operation (CRUD) for account package.
repository/ datastore layer is the bridge that establish communication
between application and database server
*/
package account
import (
"context"
"github.com/jackc/pgconn"
"github.com/jackc/pgx/v4"
)... |
// Copyright 2020 The Swarm 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 cmd
import (
"errors"
"fmt"
"github.com/galenliu/gateway/pkg/logging"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/spf13/... |
package xlsxwriter
import (
"archive/zip"
"bytes"
"context"
"encoding/xml"
"fmt"
"io"
"runtime"
"sync"
"github.com/klauspost/compress/flate"
)
type XLSXWriter struct {
w io.Writer
zw *zip.Writer
sheet io.Writer
lineNum int
}
func New(w io.Writer) (*XLSXWriter, error) {
zw := zip.NewWriter... |
package main
import (
"errors"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/nicklasfrahm/infrastructure/pkg/dns"
"github.com/nicklasfrahm/infrastructure/pkg/github"
)
const (
StackDNS = "dns"
StackGitHub = "github"
StackKubernetes = "kubernetes"
)
func main() {
pulumi.Run(func(ctx *pu... |
// Copyright 2020 The Fuchsia 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 tracking
import (
"context"
"flag"
"fmt"
"os"
"time"
"go.fuchsia.dev/fuchsia/src/sys/pkg/testing/host-target-testing/artifacts"
systemTes... |
// Copyright 2019 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 ... |
package main
/*
#cgo CPPFLAGS: -DTESTCALSTATS
#cgo CPPFLAGS: -I.
#include <u.h>
#include "calstats.h"
static Calstatspoint nvmpt[7];
static Calstatsstate state = {
.cur.calstate= -1,
.f.npt= 1,
};
Calstats stats = {
.state= &state,
.period= 30,
.msperstep = 60000,
.pt= &nvmpt[0],
.nptmax= 7,
};
Calstats st... |
package explorer
import (
"bytes"
"encoding/hex"
"math/big"
"strconv"
"github.com/ethereum/go-ethereum/common"
core2 "github.com/harmony-one/harmony/core"
"github.com/harmony-one/harmony/core/types"
common2 "github.com/harmony-one/harmony/internal/common"
"github.com/harmony-one/harmony/internal/utils"
sta... |
// Copyright 2019 The gVisor Authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agree... |
package cmd
import (
"bufio"
"bytes"
"fmt"
"io/ioutil"
"log"
"net/http"
"os"
"strconv"
"syscall"
"time"
"github.com/suggest-go/suggest/pkg/store"
"github.com/spf13/cobra"
"github.com/suggest-go/suggest/pkg/dictionary"
"github.com/suggest-go/suggest/pkg/suggest"
)
var (
dict string
host string
)
fu... |
// Copyright The 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 ag... |
// Copyright 2020 The ZKits Project 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 o... |
// Code generated by entc, DO NOT EDIT.
package ent
import (
"encoding/json"
"fmt"
"strings"
"time"
"github.com/facebookincubator/ent/dialect/sql"
"github.com/google/uuid"
"github.com/minskylab/asclepius/ent/schedule"
"github.com/minskylab/asclepius/ent/task"
)
// Task is the model entity for the Task schem... |
/*
* gomacro - A Go interpreter with Lisp-like macros
*
* Copyright (C) 2017-2019 <NAME>
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
*
* se... |
// Copyright © 2019 moooofly <<EMAIL>>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publi... |
package crypto
// xlCrypto_go/rsa.go
import (
"bytes"
//"code.google.com/p/go.crypto/ssh"
"crypto/rsa"
"encoding/base64"
"encoding/binary"
"fmt"
"golang.org/x/crypto/ssh"
"math/big"
)
var _ = fmt.Print
// -- rsaPublicKey --------------------------------------------------
type rsaPublicKey rsa.PublicKey
// ... |
package twitter
import (
"encoding/json"
"fmt"
"net/http"
"net/http/httptest"
"os"
"testing"
"github.com/gorilla/pat"
"github.com/markbates/goth"
"github.com/mrjones/oauth"
"github.com/stretchr/testify/assert"
"github.com/silinternational/wecarry-api/domain"
)
const TwitterKey = "TestTwitterKey"
const Tw... |
package rout
import (
"errors"
"fmt"
"regexp"
"strings"
"sync"
u "unsafe"
)
const (
segmentPattern = `([^/?#]+)`
segmentTemplate = `{}`
subsCap = 8
)
var regexpCache sync.Map
// Susceptible to "thundering herd" but probably good enough.
func cachedRegexp(pattern string) *regexp.Regexp {
val, ok :... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.