text
stringlengths
3.08k
10.4k
package kubernetes import ( "github.com/c-bata/go-prompt" ) const ( Pod = "pod" Namespace = "namespace" Secret = "secret" ServiceAccount = "serviceaccount" Context = "context" ConfigMap = "configmap" ComponentStatus = "compone...
package qemu import ( "fmt" "io/ioutil" "os" "os/exec" "strconv" "syscall" "time" ) // Machine represents a QEMU virtual machine type Machine struct { Cores int // Number of CPU cores Memory uint64 // RAM quantity in megabytes cd string display string vnc string monitor string drives []Dr...
package cmd import ( "fmt" "os" "strings" "time" "k8s.io/klog/v2" "github.com/ray-project/kuberay/cli/pkg/cmd/cluster" "github.com/ray-project/kuberay/cli/pkg/cmd/config" "github.com/ray-project/kuberay/cli/pkg/cmd/info" "github.com/ray-project/kuberay/cli/pkg/cmd/template" "github.com/ray-project/kuberay/...
/* Copyright 2022 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
// Copyright 2020 The Amadeus 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 agre...
package proxy import ( "encoding/json" "strings" "github.com/mattermost/mattermost-server/v6/model" "github.com/mattermost/mattermost-plugin-apps/apps" "github.com/mattermost/mattermost-plugin-apps/server/config" "github.com/mattermost/mattermost-plugin-apps/server/store" ) func mergeBindings(bb1, bb2 []apps....
package foundation import ( dsg "github.com/bwmarrin/discordgo" ) /* # Big Bot Boye * This struct defines the authentication info and config details for the bot * * The fields are self explanitory so I'm not going to detail them. * * TODO: I think the auth section needs to be either a different json file or * ...
// Copyright (c) 2016, 2018, 2022, 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...
package index import ( "errors" "sync" "github.com/ruial/busca/pkg/analysis" "github.com/ruial/busca/pkg/core" "github.com/ruial/busca/pkg/search" "github.com/sajari/fuzzy" ) var ( ErrDuplicateDocument = errors.New("Cannot index duplicate document") ErrNonExistentDocument = errors.New("Document does not ex...
// Copyright 2021 dairongpeng <<EMAIL>>. 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...
// // (C) Copyright 2020 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 ...
/* Copyright 2018 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
// Copyright © 2020 The Knative 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 agr...
// Copyright 2022 Staex GmbH (https://staex.io) // 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...
// Copyright 2020 Insolar Network Ltd. // All rights reserved. // This material is licensed under the Insolar License version 1.0, // available at https://github.com/insolar/insolar/blob/master/LICENSE.md. package secrets import ( "bytes" "crypto" "encoding/json" "encoding/pem" "fmt" "io" "io/ioutil" "github...
//go:build example // +build example // Copyright 2021 <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 b...
// Package rpcclient contains the types and functions used to connect to a bitcoin compliant jsonrpc server. package rpcclient import ( "bytes" "encoding/json" "net/http" "fmt" "context" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) // JSONRPCRequest is used to create a jsonrpc request object to se...
package main import ( "bytes" "encoding/base64" "fmt" "io/ioutil" "os" "path/filepath" "regexp" "strings" "text/template" "gopkg.in/yaml.v3" ) const configFile = ".x.yml" func render() error { if err := os.MkdirAll("dist", os.ModePerm); err != nil { return err } examples, err := loadExamples() if e...
// Copyright (c) 2022 The Parca 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 2014 The Cockroach 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...
package main import ( "bytes" "context" "encoding/json" "fmt" "runtime" "sync/atomic" "time" "github.com/dustin/go-humanize" elasticsearch "github.com/elastic/go-elasticsearch/v7" "github.com/elastic/go-elasticsearch/v7/esutil" "ginner/db/es" "ginner/logger" ) type dataSaveEngine struct { ESCli ...
// *** 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 rds import ( "context" "reflect" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // Use this data source to get information about a DB P...
/* Copyright 2020 The Crossplane Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
// Code generated by gotdgen, DO NOT EDIT. package tg import ( "context" "errors" "fmt" "sort" "strings" "go.uber.org/multierr" "github.com/nnqq/td/bin" "github.com/nnqq/td/tdp" "github.com/nnqq/td/tgerr" ) // No-op definition for keeping imports. var ( _ = bin.Buffer{} _ = context.Background() _ = fmt...
package main import ( "bytes" "context" "os" "testing" "time" "github.com/blang/semver" "github.com/sirupsen/logrus" "github.com/urfave/cli" bcli "github.com/aperturerobotics/bifrost/cli" nats "github.com/aperturerobotics/bifrost/pubsub/nats" nats_controller "github.com/aperturerobotics/bifrost/pubsub/nat...
package discord import ( "fmt" "log" "regexp" "strings" "time" "github.com/bwmarrin/discordgo" "github.com/maxsupermanhd/FactoCord-3.0/commands" "github.com/maxsupermanhd/FactoCord-3.0/support" ) // fuck golang. it's shit func min(x, y int) int { if x < y { return x } return y } var Session *discordgo...
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package backup import ( "context" "time" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" "github.com/aws/aws-sdk-go-v2/private/protocol" ) // Please also see https://docs.aws.amazon.com/goto/WebAPI/backup-20...
// Copyright (c) 2016 Uber Technologies, Inc. // // 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...
/* * 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 ...
// Package ginproc implements a gin frontend for procapi. package ginproc import ( "encoding/json" "html/template" "net/http" "github.com/pkg/errors" "github.com/gin-gonic/gin" "github.com/gin-gonic/gin/binding" "gopkg.in/birkirb/loggers.v1" ) // Caller allows to process and mock pgcall.Caller independently ...
package marshaldb import ( "encoding/json" "io" "os" "path/filepath" "github.com/leeola/errors" ald "github.com/leeola/motley" ) // data is the core data structure written to json on the fs. type data struct { Groups map[string]archData } type archData map[string]machineReplicates type machineReplicates map[...
/* Simple multithreaded algorithm to show how the 4 phases of a genetic algorithm works (Evaluation, Selection, Crossover and Mutation) https://en.wikipedia.org/wiki/Genetic_algorithm Link to the same algorithm implemented in python: https://github.com/TheAlgorithms/Python/blob/master/genetic_algorithm/basic_string.py...
/* * Copyright 2018-2019 The NATS Authors * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed ...
// Code generated - DO NOT EDIT. // This file is a generated binding and any manual changes will be lost. package ethereum import ( "math/big" "strings" ethereum "github.com/ethereum/go-ethereum" "github.com/ethereum/go-ethereum/accounts/abi" "github.com/ethereum/go-ethereum/accounts/abi/bind" "github.com/ethe...
package api_test import ( "testing" "encoding/json" "time" "github.com/TetAlius/GoSyncMyCalendars/api" "github.com/TetAlius/GoSyncMyCalendars/logger" ) var contOutlook = []byte(` { "CreatedDateTime": "2018-06-11T18:05:01.2183293Z", "LastModifiedDateTime": "2018-06-11T18:05:01.2495814Z", "ChangeKey": "<KE...
// +build integration package integration import ( "fmt" "log" "sort" "strings" "sync" "testing" "github.com/cpu/yylint/v3" "github.com/cpu/yylint/v3/lint" ) // lintCertificate lints the provided work item's certificate to produce // a certResult that can be used to determine which lint results the certific...
package pewpew import ( "bytes" "crypto/tls" "errors" "io/ioutil" "net" "net/http" "net/url" "strings" "time" reggen "github.com/lucasjones/reggen" http2 "golang.org/x/net/http2" ) //splits on delim into parts and trims whitespace //delim1 splits the pairs, delim2 splits amongst the pairs //like parseKeyV...
// Termwrap wraps stdio in a terminal where output doesn't interefere with // input package main /* * termwrap.go * Wrap stdio in a less frustrating terminal * By <NAME> * Created 20180114 * Last Modified 20180114 */ import ( "flag" "fmt" "io" "io/ioutil" "os" "os/exec" "strings" "unicode" "github.com...
package main import ( "bytes" "encoding/json" "fmt" "io/ioutil" "net/http" "os" "os/exec" "path/filepath" "strings" "sync" texttemplate "text/template" "time" "github.com/cihub/seelog" "github.com/gorilla/websocket" "github.com/julienschmidt/httprouter" "github.com/satori/go.uuid" ) var ( upgrader ...
package requests import ( "bytes" "crypto/tls" goJson "encoding/json" "errors" "fmt" "io" "io/ioutil" "net/http" "net/http/cookiejar" "strings" "sync" "time" ) var ( argsPool = sync.Pool{ New: func() interface{} { return new(args) }, } httpClientPool = sync.Pool{ New: func() interface{} { ...
// Copyright 2016 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 aliopengo import ( "net/http" "net/url" "github.com/melman-go/aliopengo/util" "fiwbee/helpers" "bytes" "io/ioutil" "github.com/ngaut/log" "fmt" "sort" "strings" ) const ( ERROR_CODE_SERVER_ERROR = 10000//系统异常了,无法处理 ERROR_CODE_ILLEGAL_PARAM = 10001//参数错误 ERROR_CODE_RECORD_ALREADY_EXIST = 20001//记录已...
package discovery import ( "bytes" "encoding/gob" "github.com/actumn/searchgoose/state" "github.com/actumn/searchgoose/state/transport" "github.com/sirupsen/logrus" "sync" ) type PreVoteCollector struct { preVotes map[state.Node]*PreVoteResponse leader state.Node response PreVoteResponse el...
package uchess import ( "fmt" "os" "strings" "github.com/freeeve/uci" "github.com/notnil/chess" "github.com/notnil/chess/image" ) // selectEngine returns the UCI engine and its corresponding config based upon the current turn func selectEngine(game *chess.Game, us UCIState) (*uci.Engine, *UCIEngine) { var eng...
// Copyright (c) 2017 <NAME> // // MIT License // // 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, merg...
// 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 Datadog, Inc. package restful import ( "errors" "math" "net/http/httptest" "testing" "gi...
package hls import ( "context" "time" "github.com/aler9/gortsplib" "github.com/aler9/gortsplib/pkg/aac" "github.com/aler9/gortsplib/pkg/h264" "github.com/asticode/go-astits" ) const ( segmentMinAUCount = 100 ) type writerFunc func(p []byte) (int, error) func (f writerFunc) Write(p []byte) (int, error) { re...
/* * Copyright 2020 Intel Corporation, 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...
package main import ( "database/sql" "flag" "fmt" "log" "os" "runtime/debug" "time" "github.com/FreeFeed/clio-restore/internal/config" "github.com/FreeFeed/clio-restore/internal/dbutil" "github.com/davidmz/mustbe" _ "github.com/lib/pq" ) const ( commentTypeHidden = 3 hiddenCommentBody = "Comment is in a...
package fight import ( "lab051/lab008/util" ) type ArmyGroup struct { ArmyGroupId int ArmyFormationId int ArmyFormationSide int //集团军初始位置在战场的哪边(constsUtil里面有常量) Armys []*Army } type Army struct { Hero *Hero Soldier *Soldier ArmyFieldId int //在...
package services import ( "github.com/MehmetHanGulter/RubyRuby/auth" "github.com/MehmetHanGulter/RubyRuby/configs" "github.com/MehmetHanGulter/RubyRuby/models" "github.com/MehmetHanGulter/RubyRuby/repositories" "google.golang.org/api/calendar/v3" "strconv" "strings" "time" ) const ( ANNUAL = iota + 1 DEATH ...
package main import ( "fmt" "math" "os" "time" "github.com/c-14/grue/config" "github.com/mmcdole/gofeed" "gopkg.in/gomail.v2" ) type FeedFetcher struct { mailer gomail.Sender init bool sem chan int finished chan int } type RSSFeed struct { config config.AccountConfig LastFetched int64 ...
package main import ( "encoding/json" "flag" "fmt" "github.com/julienschmidt/httprouter" "github.com/oschwald/geoip2-golang" "io/ioutil" "log" "net" "net/http" "os" "path/filepath" "time" ) // main configuration strct type configuration struct { IP string `json:"server.ip"` Port int ...
package clusterpolicy import ( "context" "fmt" "strings" gpuv1 "github.com/NVIDIA/gpu-operator/pkg/apis/nvidia/v1" promv1 "github.com/coreos/prometheus-operator/pkg/apis/monitoring/v1" secv1 "github.com/openshift/api/security/v1" configv1 "github.com/openshift/client-go/config/clientset/versioned/typed/config...
// 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...
package tenure import ( "container/list" "errors" "sync" ) type Callback func(key interface{}, value interface{}) type LRUController interface { Get(key interface{}) (value interface{}, ok bool) Put(key, value interface{}) (wasEvicted bool) Del(key interface{}) (wasDeleted bool) Keys() []interface{} Peek(key...
package test import ( "fmt" "path/filepath" "testing" "time" crawler "github.com/Genesis-Palace/go-scrapy/scrapy" ) func TestNewMap(t *testing.T) { var m = crawler.NewMap() for i := 0; i < 50; i++ { go func(i int) { m.Add(map[string]interface{}{string(i): i}) }(i) } time.Sleep(time.Second) t.Log(m.S...
/* Package avltree implements a height-balanced binary tree with array-like indexing capability. An AVL tree (Adel'son-Vel'skii & Landis) is a binary search tree in which the heights of the left and right subtrees of the root differ by at most one and in which the left and right subtrees are again AVL trees. With eac...
// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"). You may // not use this file except in compliance with the License. A copy of the // License is located at // // http://aws.amazon.com/apache2.0/ // // or in the "license" file ...
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package kms import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" ) type ListKeysInput struct { _ struct{} `type:"structure"` // Use this parameter to specify the maximum number of items to ret...
/* * @file * @copyright defined in aergo/LICENSE.txt */ package p2p import ( "github.com/Cofresi/aergo-lib/log" "github.com/Cofresi/aergo/message" "github.com/Cofresi/aergo/p2p/p2pcommon" "github.com/Cofresi/aergo/types" lru "github.com/hashicorp/golang-lru" "time" ) const ( RequiredSendCount int = 1 ) con...
package repository import ( "fmt" "io/ioutil" "os" "testing" "github.com/stretchr/testify/require" "gitlab.com/gitlab-org/gitaly-proto/go/gitalypb" "gitlab.com/gitlab-org/gitaly/internal/testhelper" "gitlab.com/gitlab-org/gitaly/streamio" "google.golang.org/grpc/codes" ) func TestGetArchiveSuccess(t *testin...
/* * * k6 - a next-generation load testing tool * Copyright (C) 2017 Load Impact * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU Affero General Public License as * published by the Free Software Foundation, either version 3 of the * License, or (at your o...
// Copyright 2016 DeepFabric, 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 t...
package nebula import ( "github.com/rcrowley/go-metrics" "github.com/sirupsen/logrus" ) type Bits struct { length uint64 current uint64 bits []bool firstSeen bool lostCounter metrics.Counter dupeCounter metrics.Counter outOfWindowCounter metrics.Cou...
// Copyright (C) MongoDB, Inc. 2017-present. // // 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 distinctopt import ( "reflect" "time" ...
package model import ( "crypto" "encoding/hex" "encoding/json" "github.com/go-redis/redis/v7" "log" "net/url" "redisInAction/Chapter02/common" "redisInAction/Chapter02/repository" "redisInAction/utils" "strings" "sync/atomic" "time" ) type Client struct { Conn *redis.Client } func NewClient(conn *redis....
// Copyright 2013 The Go Circuit Project // Use of this source code is governed by the license for // The Go Circuit Project, found in the LICENSE file. // // Authors: // 2014 <NAME> <<EMAIL>> /* Virus is a simple, mildly-resilient to failure mechanism that runs around a cluster and delivers its payload (a proces...
package chicken 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 ( hectorBirthday = nook.Birthday{ Day: 0, Mon...
package www import ( "bytes" "compress/gzip" "io/ioutil" "mime" "net/http" "path" "path/filepath" "strings" "sync" "time" "github.com/gorilla/handlers" "github.com/gorilla/mux" "github.com/urfave/negroni" ) type Server struct { rootPath string } // ListenAndServe creates a new WWW server, that handles...
package gosql import ( "time" ) type Configer interface { GetClusterConfig() *ClusterConfig GetShardsConfig() []*ShardConfig } type ClusterConfiger interface { GetReplicationConfig() *ReplicationConfig GetDbPartitionConfig() *DbPartitionConfig GetTablePartitionConfig() *TablePartitionConfig } type DbPartition...
package trade import ( "errors" "fmt" "sort" "sync" "sync/atomic" "time" "github.com/gofrs/uuid" "github.com/openware/pkg/common" "github.com/openware/pkg/log" "github.com/openware/pkg/kline" "github.com/openware/pkg/order" ) // Setup creates the trade processor if trading is supported func (p *Processor)...
// Copyright 2018 The MATRIX Authors as well as Copyright 2014-2017 The go-ethereum Authors // This file is consisted of the MATRIX library and part of the go-ethereum library. // // The MATRIX-ethereum library is free software: you can redistribute it and/or modify it under the terms of the MIT License. // // Permissi...
package storage import ( "bufio" "fmt" "mime" "os" "path/filepath" "runtime" "strings" "unicode/utf8" "fyne.io/fyne" ) type uri struct { raw string } // NewFileURI creates a new URI from the given file path. func NewFileURI(path string) fyne.URI { // URIs are supposed to use forward slashes. On Windows, ...
/* Copyright 2021 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 ( "flag" "fmt" "os" "runtime" "runtime/pprof" "strconv" "strings" . "github.com/amanjpro/zahak/engine" . "github.com/amanjpro/zahak/perft" . "github.com/amanjpro/zahak/search" . "github.com/amanjpro/zahak/strength" . "github.com/amanjpro/zahak/tuning" . "github.com/amanjpro/zahak/uci"...
package status import ( "bytes" "fmt" "io/ioutil" "net" "os" "os/exec" "strings" "time" uuid "github.com/satori/go.uuid" "github.com/shirou/gopsutil/cpu" "github.com/shirou/gopsutil/host" "github.com/shirou/gopsutil/mem" ) // DeviceRegistered when device was registered type DeviceRegistered struct { Sta...
package client import ( "context" "crypto/tls" "errors" "fmt" "net" "net/http" "regexp" "time" "golang.org/x/oauth2" "golang.org/x/oauth2/clientcredentials" ) const ( defaultHTTPTimeout = 10 * time.Second ) var ( ErrInvalidDNSResolver = errors.New("invalid DNS resolver specified. Required format ...
package main import ( "context" "database/sql" "flag" "fmt" "log" "net/http" "time" _ "github.com/denisenkom/go-mssqldb" "github.com/gin-gonic/gin" ) var ( password = flag.String("password", "<PASSWORD>", "the database password") port = flag.Int("port", 1433, "the database port") server = flag.Stri...
// Copyright © 2016 Yieldbot <<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 cmd import ( "context" "fmt" "github.com/zrepl/zrepl/zfs" "sort" "time" ) type IntervalAutosnap struct { task *Task DatasetFilter zfs.DatasetFilter Prefix string SnapshotInterval time.Duration } func (a *IntervalAutosnap) filterFilesystems() (fss []*zfs.DatasetPath, stop boo...
package job import ( "context" "fmt" "sync" "time" "github.com/cockroachdb/rksql/pkg/util/log" "github.com/jinzhu/gorm" ) type jobSpec struct { jobID string periodMillis int64 jobConfig string } // jobSpecs creates and returns a slice of jobSpec objects according to the // parameters specified. T...
// Copyright 2017 <NAME>. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // dnsprove is a utility that submits DNSSEC signatures to an Ethereum oracle, // allowing you to prove the (non)existence and contents of DNS records onchain. package ...
package route import ( "time" "code.cloudfoundry.org/eirini" "code.cloudfoundry.org/eirini/models/cf" "code.cloudfoundry.org/eirini/route" "code.cloudfoundry.org/lager" set "github.com/deckarep/golang-set" apps_v1 "k8s.io/api/apps/v1" "k8s.io/api/core/v1" meta "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/...
// Copyright 2018 psgo 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 main import ( "flag" "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/ec2" "io" "os" "strings" "sync" ) type CLI struct { outStream, errStream io.Writer } const ( output_header string = "Na...
package main import ( "fmt" "strings" dg "github.com/bwmarrin/discordgo" "github.com/go-snart/snart/db" "github.com/go-snart/snart/log" "github.com/go-snart/snart/route" "github.com/superloach/mapper/types" ) // Searcher is a wrapper that creates a function suitable for route. func (m *Mapper) Searcher( fil...
/* * Copyright (c) 2021 <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 * * https * * Unless required by applicable law or agreed to in writing, software * distributed un...
package menu import ( "bytes" "crypto/md5" "encoding/hex" "errors" "io/ioutil" "log" "net/http" "net/url" "os" "path/filepath" "sort" "strings" "text/template" "github.com/ghodss/yaml" "github.com/mitchellh/go-homedir" "github.com/yargevad/filepathx" ) // Param struct: a parameter for a action type P...
package sitewise import ( "crypto/rand" "crypto/rsa" "crypto/tls" "crypto/x509" "crypto/x509/pkix" "encoding/json" "encoding/pem" "errors" "fmt" "math/big" "net" "net/http" "net/http/httptest" "testing" "time" "github.com/grafana/iot-sitewise-datasource/pkg/models" "github.com/stretchr/testify/requir...
// Copyright 2017, 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.md file. package teststructs type InterfaceA interface { InterfaceA() } type ( StructA struct{ X string } // Equal method on value receiver StructB struct{ X st...
/* 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, ...
/** * Created by GoLand. * User: 姜伟 * Date: 2020/2/2 0002 * Time: 22:27 */ package mppush import ( "crypto/tls" "net/url" "sort" "strconv" "time" "github.com/a07061625/gompf/mpf" "github.com/a07061625/gompf/mpf/api" "github.com/a07061625/gompf/mpf/mpconstant/errorcode" "github...
package plugin_summary import ( "log" "net/http" "time" . "github.com/wgsP/engine/v3" . "github.com/wgsP/utils/v3" "github.com/shirou/gopsutil/cpu" "github.com/shirou/gopsutil/disk" "github.com/shirou/gopsutil/mem" "github.com/shirou/gopsutil/net" ) // Summary 系统摘要数据 var Summary ServerSummary var config = s...
package gendata import ( "fmt" "os" "path/filepath" "runtime" "github.com/neelance/parallel" "sourcegraph.com/sourcegraph/srclib/dep" "sourcegraph.com/sourcegraph/srclib/graph" "sourcegraph.com/sourcegraph/srclib/unit" ) type SimpleRepoCmd struct { GenDataOpt NFiles []int `short:"f" long:"files" descript...
package sqx import ( "fmt" "github.com/bingoohuang/gg/pkg/shellwords" "github.com/bingoohuang/gg/pkg/ss" "net" "strings" "github.com/sirupsen/logrus" "github.com/spf13/pflag" ) // CompatibleMySQLDs make mysql datasource be compatible with raw, mysql or gossh host format. func CompatibleMySQLDs(s string) strin...
package tools import ( "bytes" "encoding/json" "fmt" "os" "strconv" "strings" "time" "github.com/beego/beego/v2/core/logs" "github.com/ethereum/go-ethereum/common" "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/rlp" "github.com/urfave/cli" "gorm.io/gorm" "land-bridge/...
package types import ( "errors" "fmt" "strings" "github.com/YuriyLisovskiy/borsch-lang/Borsch/common" "github.com/YuriyLisovskiy/borsch-lang/Borsch/util" ) func checkArgument(parameter *FunctionParameter, arg common.Value, isVariadic bool) error { if parameter == nil { return errors.New("checkArgument: param...
package main import ( "context" "database/sql" "database/sql/driver" "fmt" "net" "time" "github.com/lib/pq" pb "github.com/tcncloud/protoc-gen-persistdocs/test" "google.golang.org/grpc" ) func main() { db, err := sql.Open("postgres", "user=postgres password=<PASSWORD> dbname=postgres sslmode=disable") if ...
package goshopify import ( "fmt" "testing" "time" "github.com/jarcoal/httpmock" "github.com/shopspring/decimal" ) func TransactionTests(t *testing.T, transaction Transaction) { // Check that the ID is assigned to the returned transaction expectedID := int64(389404469) if transaction.ID != expectedID { t.Er...