text stringlengths 3.08k 10.4k |
|---|
package kubernetes
import (
"context"
"time"
"go.uber.org/zap"
coreV1 "k8s.io/api/core/v1"
metaV1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/client-go/kubernetes"
restClient "k8s.io/client-go/rest"
apisLoadTestV1 "github.com/hellofresh/kangal/pkg/kubernetes/apis/loadtest/v1"
loadTestV1 "github.com/hell... |
// Copyright (c) 2020 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... |
// *** 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 organizations
import (
"context"
"reflect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
// Get information about a Google Cloud Organ... |
package formula
import (
"fmt"
"os/exec"
"runtime"
"strings"
"github.com/ZupIT/ritchie-cli/pkg/api"
)
const (
PathPattern = "%s/formulas/%s"
TmpDirPattern = "%s/tmp/%s"
TmpBinDirPattern = "%s/tmp/%s/%s"
DefaultConfig = "config.json"
ConfigPattern =... |
// Package api is responsible for exporting services
// as an HTTP API.
package api
import (
"encoding/json"
"errors"
"fmt"
"io"
"net/http"
"time"
"github.com/shopspring/decimal"
log "github.com/sirupsen/logrus"
"github.com/katcipis/loaner/loan"
)
// CreateLoanPlanRequest is the request body required to cr... |
// Code generated by dol build. DO NOT EDIT.
// source: auto.go
package types
import (
"encoding/json"
"github.com/2637309949/dolphin/packages/null"
)
// OrganSchool defined
type OrganSchool struct {
// OSId defined
OSId null.Int `xorm:"int(11) pk notnull autoincr 'o_s_id'" json:"o_s_id" form:"o_s_id" xml:"o_s_... |
// Copyright 2020 Teserakt AG
//
// 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 writ... |
// Package segment defines a truncated cone-like object whose bottom is defined
// by a characteristic line segment (instead of a point). This object also has a
// characteristic "turning radius", which defines the sharpness of the curve
// from the bottom line segment to the edges.
//
// L \ / R
// \___/
//... |
// 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 darwin
// +build arm arm64
package app
/*
#cgo CFLAGS: -x objective-c
#cgo LDFLAGS: -framework Foundation -framework UIKit -framework GLKit -framewo... |
package basic
// generated by gen.js, don't edit
type Figure int
const (
NoFigure = Figure(0)
Pawn = Figure(1)
Knight = Figure(2)
Bishop = Figure(3)
Rook = Figure(4)
Queen = Figure(5)
King = Figure(6)
Lancer ... |
package main
import (
"bufio"
"flag"
"fmt"
"os"
)
var inputFile = flag.String("inputFile", "inputs/day20.input", "Relative file path to use as input.")
var minDoors = flag.Int("minDoors", 1000, "The minimum number of doors to count a room.")
type Coord struct {
X, Y int
}
// Track for each item in the queue, h... |
package service
/*
============================================================================
Name : deploy.go
Author : xiehui
Version : 1.0
Email : <EMAIL>
Copyright : Copyright © 2018 Lenovo Services. All rights reserved.
Description : 部署
============================================... |
// Copyright © 2022 Kaleido, Inc.
//
// SPDX-License-Identifier: Apache-2.0
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unle... |
package controller
import (
api "gitlab.com/mvenezia/redis-operator/pkg/apis/redis/v1alpha1"
apiextensionsclient "k8s.io/apiextensions-apiserver/pkg/client/clientset/clientset"
"k8s.io/client-go/kubernetes"
"github.com/sirupsen/logrus"
"gitlab.com/mvenezia/redis-operator/pkg/redis"
"gitlab.com/mvenezia/redis-op... |
package goKIT
// #cgo LDFLAGS: -ladvapi32
// #include "kit.h"
import "C"
import (
"encoding/binary"
"fmt"
"unsafe"
)
// Use KIT v0.2-alpha
const (
// Globals
KIT_DEFAULT_ID = "Local\\KIT"
// Types
KIT_TYPE_BIND = 0x1
KIT_TYPE_CONNECT = 0x2
KIT_TYPE_DISCONNECT = 0x3
KIT_TYPE_ACCEPT = 0x4
KIT_TY... |
package cache
import (
"context"
"crypto/sha256"
"encoding/base64"
"encoding/json"
"fmt"
"sort"
"github.com/cockroachdb/errors"
"github.com/sourcegraph/sourcegraph/lib/batches"
"github.com/sourcegraph/sourcegraph/lib/batches/execution"
"github.com/sourcegraph/sourcegraph/lib/batches/template"
)
type Cache... |
package leetcode
import (
"fmt"
"testing"
"github.com/stretchr/testify/assert"
)
func TestLeetCode26(t *testing.T) {
var tcs = []struct {
nums []int
ans int
}{
{
[]int{1, 1, 2},
2,
},
{
[]int{0, 0, 1, 1, 1, 2, 2, 3, 3, 4},
5,
}, // 可以有多个 testcase
}
fmt.Println("-----------------------... |
// 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 writ... |
package gost
import (
"crypto/tls"
"encoding/base64"
"errors"
"github.com/golang/glog"
"io"
"net"
"strings"
"time"
)
const (
Version = "2.4-dev20170303"
)
// Log level for glog
const (
LFATAL = iota
LERROR
LWARNING
LINFO
LDEBUG
)
var (
KeepAliveTime = 180 * time.Second
DialTimeout = 30 * time.Seco... |
// Copyright 2020 The Prometheus 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 (C) Microsoft. All rights reserved.
// Licensed under the MIT license.
// See LICENSE.txt file in the project root for full license information.
//-----------------------------------------------------------------------------
pa... |
package ini
import (
"bufio"
"bytes"
"errors"
"fmt"
"io"
"unicode"
)
var (
errInvalidSectionName = errors.New("invalid section name")
errInvalidKeyValue = errors.New("string literal not terminated")
)
// ReadFrom populates Ini with the data read from the reader.
// Leading and trailing whitespaces for the... |
package main
import (
"fmt"
//"unsafe"
)
func main() {
fmt.Println("test")
var a,b int
a = 1
c := 2
fmt.Println(a,b,c)
var d int = 3
fmt.Println(d)
var arr1 [10]int
arr1[8] = 1
fmt.Println(arr1)
arr2 := [10]int{10,2}
fmt.Println(arr2, len(arr2), cap(arr2))
//声明数组类型时,可以不指定具体元素个数
var arr3 []int = []in... |
// Copyright 2017 Google 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... |
//+build darwin
// Package ioreg provides a table wrapper around the `ioreg` macOS
// command.
//
// As the returned data is a complex nested plist, this uses the
// dataflatten tooling. (See
// https://godoc.org/github.com/kolide/launcher/pkg/dataflatten)
package ioreg
import (
"bytes"
"context"
"os/exec"
"stri... |
package main
import (
"bufio"
"bytes"
"compress/gzip"
"flag"
"fmt"
"io"
"io/ioutil"
"log"
"os"
"sort"
"github.com/Sirupsen/logrus"
"github.com/dgraph-io/dgraph/query/graph"
"github.com/dgraph-io/dgraph/rdf"
"github.com/dgraph-io/dgraph/x"
)
var (
src = flag.String("src", "", "Gzipped RDF data file.")... |
package tcp
import (
"net"
"reflect"
"strconv"
"sync"
"syscall"
"time"
"shadowsocks-go/pkg/access"
"shadowsocks-go/pkg/config"
"shadowsocks-go/pkg/connection/tcp/ssclient"
"shadowsocks-go/pkg/crypto"
"github.com/golang/glog"
"golang.org/x/net/context"
)
//TCPServer maintain a listener
type TCPServer st... |
package api
import (
"encoding/json"
"testing"
"time"
"github.com/fortytw2/leaktest"
"github.com/gobwas/glob"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"go-home.io/x/server/mocks"
"go-home.io/x/server/plugins/api"
"go-home.io/x/server/plugins/bus"
"go-home.io/x/server/plugi... |
package blockchain
import (
"crypto/ecdsa"
"crypto/sha256"
"encoding/hex"
"encoding/json"
"errors"
"fmt"
"math/big"
"github.com/ethereum/go-ethereum/crypto"
)
// Set of transaction data types.
const (
TxDataReward = "reward"
)
// ardanID is an arbitrary number for signing messages. This will make it
// cle... |
package styling
import (
"fmt"
"github.com/gdamore/tcell/v2"
"github.com/ja-he/dayplan/src/config"
"github.com/lucasb-eyer/go-colorful"
)
// DrawStyling is style information used for rendering text.
// It should represent foreground and background color as well as modifiers
// such as italicization.
// A DrawSty... |
// 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 goTimeWheel
import (
"time"
)
// TimeWheel Struct
type TimeWheel struct {
interval time.Duration // ticker run interval
ticker *time.Ticker
slots [][]*Task
keyPosMap map[interface{}]int // keep each timer's position
slotNum int
currPos int // timewheel current position
addChannel chan Task ... |
package webservice
import (
"fmt"
"io"
"mediaserver/mediaserver/dal"
"mediaserver/mediaserver/dal/diskstorage/mediaserverdb"
"mediaserver/mediaserver/domain"
"mediaserver/mediaserver/mediaserverjobs"
"mime/multipart"
"net/http"
"github.com/go-chi/chi"
"github.com/go-chi/render"
"github.com/jamesrr39/goutil... |
package runner
import (
"bufio"
"bytes"
"github.com/omegaup/quark/common"
"math/big"
"testing"
)
type VS common.ValidatorSettings
func TestScanNumericTokens(t *testing.T) {
validatorentries := []struct {
input string
tokens []Token
}{
{"hello, world!", []Token{}},
{"0 0\n 0\n-1", []Token{{"0", 1, 1},... |
package models
import (
"time"
)
// Product represents a Dairycart product
type Product struct {
ID uint64 `json:"id"` // id
ProductRootID uint64 `json:"product_root_id"` // product_root_id
PrimaryImageID *uint64 `json:"primary_image_id"` // primary_i... |
package hammy
import (
"fmt"
"strings"
"encoding/json"
"database/sql"
_ "github.com/ziutek/mymysql/godrv"
)
// Driver for retriving and saving state in MySQL database
// It's assumes the table structure like this:
//
// CREATE TABLE `states` (
// `host` varchar(255) NOT NULL,
// `state` text,
// `cas` ... |
// Copyright 2017 <NAME>. All rights reserved.
// Use of this source code is governed by a Modified
// BSD License that can be found in the LICENSE file.
package main
import (
"errors"
"flag"
"fmt"
"io"
"os"
"path/filepath"
"runtime"
"strings"
"github.com/tmthrgd/go-bindata"
"github.com/tmthrgd/go-bindata/... |
// Package band provides band specific defaults and configuration.
package band
import (
"errors"
"fmt"
"time"
"github.com/brocaar/lorawan"
)
// Name defines the band-name type.
type Name string
// Available ISM bands.
const (
AU_915_928 Name = "AU_915_928"
EU_863_870 Name = "EU_863_870"
US_902_928 Name = "U... |
package main
import (
"container/heap"
"log"
"math/rand"
"sort"
"time"
)
/**
题目:https://leetcode-cn.com/problems/top-k-frequent-elements/submissions/
前 K 个高频元素
给你一个整数数组 nums 和一个整数 k ,请你返回其中出现频率前 k 高的元素。你可以按 任意顺序 返回答案。
提示:
1 <= nums.length <= 105
k 的取值范围是 [1, 数组中不相同的元素的个数]
题目数据保证答案唯一,换句话说,数组中前 k 个高频元素的集合是唯一的
... |
package vless
import (
"bytes"
"io"
"net"
"net/url"
"strconv"
"github.com/e1732a364fed/v2ray_simple/netLayer"
"github.com/e1732a364fed/v2ray_simple/proxy"
"github.com/e1732a364fed/v2ray_simple/utils"
)
func init() {
proxy.RegisterClient(Name, ClientCreator{})
}
type ClientCreator struct{}
func (ClientCrea... |
package server
import (
"crypto/tls"
"fmt"
"net/http"
"github.com/julienschmidt/httprouter"
"github.com/meatballhat/negroni-logrus"
"github.com/ory/graceful"
"github.com/ory/herodot"
"github.com/ory/hydra/client"
"github.com/ory/hydra/config"
"github.com/ory/hydra/jwk"
"github.com/ory/hydra/oauth2"
"githu... |
package main
import (
"encoding/json"
"fmt"
"log"
"math/rand"
"net/http"
"os"
"strconv"
"strings"
)
//retrieve list of sounds from Github instead of Kaamelott soundboard website because their URL is regularly modified
//const kaamelottSoundsURL = "https://kaamelott-soundboard.2ec0b4.fr/sounds/sounds.a7b9de88.... |
package snappy
import (
"encoding/binary"
"math/bits"
"runtime"
"github.com/andybalholm/pack"
)
const inputMargin = 16 - 1
const minNonLiteralBlockSize = 1 + 1 + inputMargin
// MatchFinder is an implementation of the pack.MatchFinder interface based
// on the algorithm used by snappy.
type MatchFinder struct{}... |
// Copyright 2016 <NAME>. All rights reserved.
// Use of this source code is governed under the Apache License, Version 2.0
// that can be found in the LICENSE file.
package fastbezier
import (
"bytes"
"fmt"
"io"
"github.com/maruel/fastbezier/internal"
)
// LUT is a fast cubic bezier curve evaluator over uint16... |
package backuper
import (
"fmt"
"github.com/mwf/golidays/model"
"io/ioutil"
"os"
"path/filepath"
"sort"
"sync"
"time"
"github.com/mwf/golidays/service/logger"
"github.com/mwf/golidays/service/store"
"gopkg.in/yaml.v2"
)
const (
// no reason to keep it higher
minPeriod = time.Minute
)
type Backuper stru... |
/*
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 not use ... |
package sqltuple
import (
"fmt"
"strings"
"github.com/hidal-go/hidalgo/values"
)
type ErrorFunc func(err error) error
type Dialect struct {
Errors ErrorFunc
BytesType string
StringType string
BytesKeyType string
StringKeyType string
TimeType string
S... |
// Copyright 2020 The casbin Authors. 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 a... |
package hbn
import (
"os"
"fmt"
"time"
"net/http"
"io/ioutil"
"math/rand"
"sync/atomic"
"github.com/cheggaaa/pb/v3"
errs "github.com/out-of-mind/hbn/src/internal/errors"
)
// structure of HBN
type HBN struct {
url string
method string
duration int
workers int
useragents []string
headers... |
package cfn_macro
import (
"bytes"
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/feature/s3/manager"
"github.com/aws/aws-sdk-go-v2/service/cloudformation"
"github.com/aws/aws-sdk-go-v2/service/cloudformation/types"
"github.com/aws/aws-sdk-go-v2/service/s3"
"github.com/falcos... |
package servicebroker
import (
"errors"
"net/http"
"strconv"
"strings"
kerrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/labels"
"k8s.io/apimachinery/pkg/selection"
"k8s.io/apiserver/pkg/authentication/user"
kapi "k8s.io/kubernetes/pkg/api"
... |
//Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
//Licensed under the Universal Permissive License (UPL) Version 1.0 as shown at http://oss.oracle.com/licenses/upl.
package assertion
import (
"crypto/tls"
"crypto/x509"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
"strings"
"time"
ads... |
package api
import (
"k8s.io/api/core/v1"
storagev1 "k8s.io/api/storage/v1"
)
type StorageClassCreateInput struct {
ClusterResourceCreateInput
// Provisioner indicates the type of the provisioner.
Provisioner string `json:"provisioner"`
// Dynamically provisioned PersistentVolumes of this storage class are
/... |
// Copyright (c) 2013 The Gorilla WebSocket Authors. All rights reserved.
// https://github.com/gorilla/websocket/blob/master/LICENSE
package main
import (
"log"
"net/http"
"time"
"encoding/json"
"github.com/gorilla/websocket"
)
const (
writeWait = 10 * time.Second
pongWait = 60 * time.Second
pingPeriod = (p... |
// +build cairo
package png
import "github.com/evmar/gocairo/cairo"
// interface with all used cairo.Context methods
type cairoContext interface {
Rectangle(x, y, width, height float64) // pixel ratio required
GetLineWidth() float64 // pixel ratio required
LineTo(x, y float64) //... |
package astiav_test
import (
"errors"
"fmt"
"io/ioutil"
"testing"
"github.com/asticode/go-astiav"
"github.com/stretchr/testify/require"
)
func videoInputLastVideoFrame() (f *astiav.Frame, err error) {
if global.frame != nil {
return global.frame, nil
}
var fc *astiav.FormatContext
if fc, err = videoInpu... |
package state
import (
"math/big"
"github.com/nspcc-dev/neo-go/pkg/encoding/bigint"
"github.com/nspcc-dev/neo-go/pkg/io"
"github.com/nspcc-dev/neo-go/pkg/util"
)
// NEP5Tracker contains info about a single account in a NEP5 contract.
type NEP5Tracker struct {
// Balance is the current balance of the account.
B... |
package papilite
import (
"fmt"
"log"
)
const (
defaultPapiWrapperLatestPath string = "platform/latest"
defaultPapiWrapperPlatformPath string = "platform/10"
defaultPapiWrapperRanPath string = ""
defaultPapiWrapperServicePath string = ""
)
// OnefsCfg contains the configuration to connect to a OneFS cl... |
package store
import (
"context"
"sync"
"time"
format "github.com/ipfs/go-ipld-format"
"github.com/libp2p/go-libp2p-core/peer"
threadcbor "github.com/textileio/go-threads/cbor"
service "github.com/textileio/go-threads/core/service"
"github.com/textileio/go-threads/core/thread"
)
const (
addRecordTimeout = ... |
// Copyright 2018-2019 Workiva 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 trace
import (
"context"
"runtime"
"sync"
"time"
"go.opentelemetry.io/otel/api/global"
"go.opentelemetry.io/otel/api/trace"
export "go.opentelemetry.io/otel/sdk/export/trace"
)
var (
invalidTraceID trace.ID
)
const (
DefaultTimeout = 500 * time.Millisecond
)
type StackifySpanProcessor struct {
e ... |
// Code generated by entc, DO NOT EDIT.
package ent
import (
"fmt"
"strings"
"time"
"entgo.io/ent/dialect/sql"
"github.com/realotz/whole/internal/apps/admin/data/ent/role"
)
// Role is the model entity for the Role schema.
type Role struct {
config `json:"-"`
// ID of the ent.
ID int64 `json:"id,omitempty"`... |
package shadowsocks
import (
"crypto/cipher"
"crypto/md5"
"crypto/rc4"
"io"
"crypto/rand"
"crypto/aes"
"crypto/des"
"golang.org/x/crypto/blowfish"
"golang.org/x/crypto/cast5"
"github.com/codahale/chacha20"
"errors"
"github.com/go-playground/log"
)
// A copy from shadowsocks-go
const (
Decrypt DecOrEnc =... |
package main
import (
"flag"
"fmt"
"io/ioutil"
"net/http"
"os"
"os/signal"
"runtime"
"runtime/pprof"
"time"
"github.com/gin-contrib/zap"
"github.com/gin-gonic/gin"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
"github.com/prometheus/client_gol... |
package schemagen
import (
"encoding/json"
"path/filepath"
"strings"
"cuelang.org/go/cue"
"cuelang.org/go/encoding/openapi"
"cuelang.org/go/encoding/protobuf"
"github.com/rotisserie/eris"
"github.com/solo-io/anyvendor/anyvendor"
"github.com/solo-io/go-utils/stringutils"
"github.com/solo-io/solo-kit/pkg/code... |
package main
import (
selenosisfiber "github.com/Roman-Mitusov/selenosis-fiber"
"github.com/Roman-Mitusov/selenosis-fiber/browser"
"github.com/Roman-Mitusov/selenosis-fiber/config"
"github.com/fsnotify/fsnotify"
"github.com/gofiber/fiber/v2"
"github.com/gofiber/fiber/v2/middleware/recover"
"github.com/sirupsen/... |
//
// Copyright (c) 2016 Intel Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or... |
// Code generated by protoc-gen-go. DO NOT EDIT.
// source: envoy/config/retry/previous_priorities/previous_priorities_config.proto
package envoy_config_retry_previous_priorities
import (
fmt "fmt"
_ "github.com/envoyproxy/protoc-gen-validate/validate"
proto "github.com/golang/protobuf/proto"
math "math"
)
// Re... |
// Copyright 2017 The Chromium 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 common
import (
"context"
"fmt"
"net/http"
"os"
"go.chromium.org/luci/common/errors"
gcps "go.chromium.org/luci/common/gcloud/pubsub"
"go... |
/*
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 cmd
import (
"encoding/json"
"fmt"
"os"
"strings"
"github.com/aquasecurity/defsec/state"
"github.com/aquasecurity/tfsec/internal/pkg/legacy"
scanner "github.com/aquasecurity/defsec/scanners/terraform"
"github.com/aquasecurity/defsec/severity"
)
var showVersion = false
var runUpdate = false
var disa... |
package main
import (
"github.com/jf-tech/console/cgame"
"github.com/jf-tech/console/cgame/assets"
"github.com/jf-tech/console/cterm"
"github.com/jf-tech/console/cwin"
)
type myGame struct {
g *cgame.Game
winHeader cwin.Win
winArena cwin.Win
winStats cwin.Win
easyMode bool
invincible bool
}
... |
package boot
import (
"context"
"github.com/go-spring/spring-core/arg"
"github.com/go-spring/spring-core/bean"
"github.com/go-spring/spring-core/core"
"github.com/go-spring/spring-core/mq"
"github.com/go-spring/spring-core/web"
)
var gApp = NewApplication()
func ExpectSysProperties(pattern ...string) {
gApp.... |
package main
import (
"fmt"
"log"
"os"
"os/signal"
"time"
homedir "github.com/mitchellh/go-homedir"
"github.com/softpunks/ikukani"
"github.com/softpunks/ikukani/internal/notifier"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
const (
longInterval = time.Hour * 24
shortInterval = time.Minute * 30... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package rekognition
import (
"context"
"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/internal/awsutil"
)
type StartSegmentDetectionInput struct {
_ struct{} `type:"structure"`
// Idempotent token used to identify the start... |
// Copyright (c) 2013 Couchbase, 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 w... |
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT.
package appmesh
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"
)
type DescribeVirtualGatewayInput struct {
_ struct{} `type:"structure"`
... |
package parser
import (
"fmt"
"regexp"
"strings"
api "github.com/bleenco/abstruse/pb"
yaml "gopkg.in/yaml.v2"
)
// Job stage constants
const (
JobStageTest = "test"
JobStageDeploy = "deploy"
)
// RepoConfig defines structure for .abstruse.yml configuration files.
type RepoConfig struct {
Image str... |
package processing
// DCSO FEVER
// Copyright (c) 2017, DCSO GmbH
import (
"bytes"
"encoding/json"
"fmt"
"os"
"sync"
"time"
"github.com/DCSO/fever/types"
"github.com/DCSO/fever/util"
log "github.com/sirupsen/logrus"
)
// FlowAggregatorPerfStats contains performance stats written to InfluxDB
// for monitor... |
// Copyright 2017 VMware, 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 booklitdoc
import (
"errors"
"fmt"
"strings"
"github.com/alecthomas/chroma"
"github.com/alecthomas/chroma/styles"
"github.com/vito/booklit"
"github.com/vito/booklit/ast"
"github.com/vito/booklit/baselit"
chromap "github.com/vito/booklit/chroma"
)
func init() {
booklit.RegisterPlugin("booklitdoc", N... |
package deepmerge
import (
"errors"
"fmt"
"reflect"
)
// DeepMerge instantiates initial counters / keys for traversal
type DeepMerge struct {
map1 interface{}
map2 interface{}
// Stores the keys that we have processed as we iterate the maps
seenKeys map[interface{}]bool
// Keeps track of nested parent keys
... |
package vmcontroller
import (
"fmt"
"time"
log "github.com/sirupsen/logrus"
corev1 "k8s.io/api/core/v1"
errors "k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/util/runtime"
"k8s.io/apimachinery/pkg/util/wait"
"k8s.io/client-go/kubernetes"
"k8s.io/client-go/kubernetes/scheme"
typedcorev1 "k8s.i... |
package handler
import (
"QbittorrentAutoLimitShare/internal/consts"
"QbittorrentAutoLimitShare/internal/model/qbit/torrents"
"QbittorrentAutoLimitShare/internal/service"
"github.com/spf13/viper"
"log"
"os"
"strconv"
"strings"
"time"
)
var HandleCron = &handleCron{}
type handleCron struct {
conf *viper.Vip... |
package session
import (
"bufio"
"net"
"strings"
"sync"
"time"
"github.com/defsky/xtelnet/proto"
)
type TaskType int
const historyCmdLength = 1000
const (
Timer TaskType = iota
Ticker
)
type TaskHandler func()
type ScheduleTask struct {
ttype TaskType
handler TaskHandler
}
type TickTaskMap map[time.Du... |
// Copyright 2015 CoreOS, 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... |
package gateway
import (
"context"
"fmt"
"io"
"io/ioutil"
"net/http"
"net/url"
"strings"
"sync"
"time"
"github.com/TheRockettek/Sandwich-Daemon/structs"
jsoniter "github.com/json-iterator/go"
"golang.org/x/xerrors"
)
var json = jsoniter.ConfigCompatibleWithStandardLibrary
// Client represents the REST c... |
package keyimages
import (
"errors"
"fmt"
"github.com/nfnt/resize"
"image"
_ "image/jpeg" // for JPEG images
"net/http"
"strconv"
"sync"
)
const (
AlbumArt1x1 = "1x1"
AlbumArt2x2 = "2x2"
AlbumArt3x3 = "3x3"
cacheImageSize = 300
)
var (
coverCache map[string]image.Image
lock sync.Mutex
defau... |
// Copyright 2011 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package plugin
import (
"bytes"
"crypto/x509/pkix"
"encoding/asn1"
"errors"
"fmt"
"github.com/meshplus/crypto"
gm "github.com/meshplus/crypto-gm"
"gith... |
package tines
import (
"bytes"
"context"
"encoding/json"
"fmt"
"io"
"net/http"
"net/url"
"reflect"
"strings"
"github.com/google/go-querystring/query"
)
// httpClient defines an interface for an http.Client implementation so that alternative
// http Clients can be passed in for making requests
type httpClie... |
package athenahealth
import (
"context"
"encoding/json"
"io/ioutil"
"net/http"
"testing"
"time"
"github.com/stretchr/testify/assert"
)
func TestHTTPClient_CreateClaim(t *testing.T) {
assert := assert.New(t)
allowableAmount := json.Number("1")
allowableMax := json.Number("2")
allowableMin := json.Number("... |
/*
* Copyright 2021 Junebao
*
* 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... |
/*
Reference: github.com/bugra/kmeans
*/
package kmeans
import (
"math"
"math/rand"
"time"
)
type Vector []float64
type ClusteredVector struct {
ClusterNum int
Vector
}
func (lhs Vector) Add(rhs Vector) {
for i, _ := range lhs {
lhs[i] += rhs[i]
}
}
func (lhs Vector) Sub(rhs Vector) {
for i, _ :... |
package utils
import (
"archive/zip"
"fmt"
"io"
"os"
"path"
"path/filepath"
)
type UnzipState string
const (
UnzipStateStarting UnzipState = "unzip_starting"
UnzipStateProcessing UnzipState = "unzip_processing"
UnzipStateError UnzipState = "unzip_error"
UnzipStateOK UnzipState = "unzip_ok"
... |
package main
import (
"fmt"
"html/template"
"io"
"log"
"net/http"
"os"
"time"
"github.com/gorilla/sessions"
"github.com/labstack/echo-contrib/session"
"github.com/labstack/echo/v4"
"github.com/labstack/echo/v4/middleware"
"golang.org/x/net/context"
"github.com/nasu/lifelog-aggregator/constant"
"github.... |
package main
import (
"bufio"
"bytes"
"fmt"
"os"
"sort"
)
func main() {
reader := bufio.NewReader(os.Stdin)
N, K := readTwoNums(reader)
X := readNNums(reader, N)
res := solve(X, K)
if len(res) == 0 {
fmt.Println("-1")
} else {
var buf bytes.Buffer
buf.WriteString(fmt.Sprintf("%d\n", len(res)))
f... |
package bear
import (
"time"
"github.com/lindsaygelle/nook"
"github.com/lindsaygelle/nook/animal"
"github.com/lindsaygelle/nook/character"
"github.com/lindsaygelle/nook/gender"
"github.com/lindsaygelle/nook/personality"
"golang.org/x/text/language"
)
var (
dozerBirthday = nook.Birthday{
Day: 0,
Month: ... |
// Copyright (c) 2013-2018 <NAME>. All rights reserved.
// Licensed under a simplified BSD license (see LICENSE file).
package input_test
////////////////////////////////////////////////////////////////////////////////
import (
"fmt"
"testing"
"github.com/cozely/cozely"
"github.com/cozely/cozely/input"
"github... |
package main
import (
"bytes"
"flag"
"github.com/Symantec/scotty/pstore"
"github.com/Symantec/scotty/pstore/config/influx"
"github.com/Symantec/scotty/pstore/config/kafka"
"github.com/Symantec/scotty/pstore/config/tsdb"
"github.com/Symantec/tricorder/go/tricorder/types"
"github.com/Symantec/tricorder/go/tricor... |
package command
import (
"encoding/xml"
"fmt"
"io/ioutil"
"net/url"
"time"
uuid "github.com/gofrs/uuid"
"github.com/urfave/cli"
configModel "github.com/vkuznecovas/mouthful/config/model"
dbModel "github.com/vkuznecovas/mouthful/db/model"
"github.com/vkuznecovas/mouthful/api"
"github.com/vkuznecovas/mouthf... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.