text
stringlengths
3.08k
10.4k
package server import ( "encoding/json" "image" "reflect" "strings" "testing" "time" "github.com/rwcarlsen/goexif/exif" "github.com/rwcarlsen/goexif/mknote" "github.com/rwcarlsen/goexif/tiff" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" ) const emptyPhotoJSON = `{"id":"","delete...
package main import ( "fmt" "strings" "time" "github.com/evalphobia/stripe-event-search/lib" "github.com/evalphobia/stripe-event-search/stripesearch" "github.com/mkideal/cli" ) // parameters of 'multi' command. type multiT struct { cli.Helper APIKey string `cli:"apikey" usage:"api key for stripe A...
// Package test_structure allows to set up tests and their environment. package test_structure import ( "fmt" "os" "path/filepath" "strings" go_test "testing" "github.com/gruntwork-io/terratest/modules/files" "github.com/gruntwork-io/terratest/modules/logger" "github.com/gruntwork-io/terratest/modules/terraf...
package main import ( "bytes" "encoding/json" "fmt" "net/http" ) // GQLRequest is the GraphQL request containing Query and Variables type GQLRequest struct { Query string `json:"query"` Variables map[string]interface{} `json:"variables"` } // GQLResponse is the response from GraphQL server ...
// Copyright 2019 The LUCI 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...
// @description wechat 是腾讯微信公众平台 api 的 golang 语言封装 // @link https://github.com/magicshui/wechat for the canonical source repository // @license https://github.com/magicshui/wechat/blob/master/LICENSE // @authors chanxuehong(<EMAIL>) package client import ( "encoding/json" "fmt" "net/http" "sync" "...
package zndx import ( "strconv" "strings" "gopkg.in/gorp.v1" "xutils/xdebug" "xutils/xhttp" ) /* CREATE TABLE `devicedetaillog` ( `Id` bigint(20) NOT NULL AUTO_INCREMENT, `OperateTime` varchar(50) DEFAULT NULL COMMENT 'yyyy-MM-dd HH:mm:ss', `OperateUserId` int(11) DEFAULT NULL, `DeviceId` varchar(50) D...
package main import ( "context" "fmt" "net/http" "os" "strings" "time" "github.com/go-chi/chi" "github.com/go-chi/chi/middleware" lru "github.com/hashicorp/golang-lru" _ "github.com/joho/godotenv/autoload" "github.com/rs/cors" "github.com/rs/zerolog" "github.com/rs/zerolog/log" "gosrc.io/xmpp" "github...
package main import ( "fmt" "os" "regexp" "runtime/debug" "strings" "github.com/infracost/infracost/internal/config" "github.com/infracost/infracost/internal/events" "github.com/infracost/infracost/internal/spin" "github.com/infracost/infracost/internal/update" "github.com/infracost/infracost/internal/versi...
/* * 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 main import ( "encoding/json" "errors" "flag" "fmt" "io/ioutil" "log" "net/http" "os" "path" "github.com/aws/aws-lambda-go/lambda" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/ssm" "github.com/inconshreveable/log15" "github.com/psanf...
/* Copyright © 2020 <NAME> 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, publish, distribute, sublicense...
package notaryserver import ( "context" "path" "time" goharborv1alpha2 "github.com/goharbor/harbor-operator/apis/goharbor.io/v1alpha2" harbormetav1 "github.com/goharbor/harbor-operator/apis/meta/v1alpha1" "github.com/goharbor/harbor-operator/controllers" "github.com/pkg/errors" appsv1 "k8s.io/api/apps/v1" co...
package scaleway import ( "context" "github.com/scaleway/scaleway-sdk-go/api/rdb/v1" "github.com/scaleway/scaleway-sdk-go/scw" "github.com/turbot/steampipe-plugin-sdk/v3/grpc/proto" "github.com/turbot/steampipe-plugin-sdk/v3/plugin" "github.com/turbot/steampipe-plugin-sdk/v3/plugin/transform" ) //// TABLE DEF...
package static import ( "encoding/json" "errors" "fmt" "io/ioutil" "os" "os/exec" "path/filepath" "strings" ) const polymerConfig = "polymer.json" const polymerFragmentsKey = "fragments" //listClientFragments returns a list of all client fragments that should be //merged into polymer.config given the static ...
package env import ( "errors" "fmt" "io" "io/ioutil" "os" "path/filepath" "encoding/json" "github.com/caarlos0/env" "github.com/joho/godotenv" "github.com/shibukawa/configdir" "gopkg.in/yaml.v1" ) const ( vendor = "Shopify" appname = "Themekit" filename = "variables" ) var ( cdir = config...
package zoom import ( "context" "github.com/himalayan-institute/zoom-lib-golang" "github.com/turbot/steampipe-plugin-sdk/grpc/proto" "github.com/turbot/steampipe-plugin-sdk/plugin" "github.com/turbot/steampipe-plugin-sdk/plugin/transform" ) func tableZoomMeeting(ctx context.Context) *plugin.Table { return &pl...
package samples import ( "fmt" "os" "os/signal" log "github.com/sirupsen/logrus" "github.com/spf13/afero" "github.com/spf13/cobra" "github.com/stripe/stripe-cli/pkg/ansi" "github.com/stripe/stripe-cli/pkg/config" gitpkg "github.com/stripe/stripe-cli/pkg/git" "github.com/stripe/stripe-cli/pkg/samples" "git...
// Copyright 2015 The Golang Plus 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 bytesp import ( "errors" "io" "strconv" "unicode/utf8" ) // Slice is a wrapper type for []byte. // Its pointer form, *Slice, implements i...
/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, ...
// Copyright (c) 2015, <NAME>. All rights reserved. // Use of this source code is governed by an MIT license // that can be found in the LICENSE file. package ast import "github.com/goulash/lex" const ( // We continue where the reserved types left off typeText lex.Type = (lex.TypeEOF + 1) + iota typeComment typ...
package main /* * Copyright 2021 OpsMx, 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 plugins import ( "encoding/json" "strings" "github.com/PuerkitoBio/goquery" "github.com/koffeinsource/go-URLextract/webpage" "github.com/koffeinsource/go-klogger" ) type ieeeInfo struct { UserInfo struct { Institute bool `json:"institute"` Member bool `json:"member"` Indivi...
package farm import ( "testing" "github.com/stretchr/testify/require" swap "github.com/okex/exchain/x/ammswap/types" "github.com/okex/exchain/x/farm/keeper" "github.com/okex/exchain/x/farm/types" sdk "github.com/cosmos/cosmos-sdk/types" abci "github.com/tendermint/tendermint/abci/types" ) func TestBeginBloc...
// Copyright 2020 Nokia // Licensed under the BSD 3-Clause License. // SPDX-License-Identifier: BSD-3-Clause package clab import ( "crypto/rand" "fmt" "os" "path" "path/filepath" "strings" "text/template" log "github.com/sirupsen/logrus" "github.com/srl-labs/containerlab/types" "github.com/srl-labs/contain...
// Copyright (c) 2021 Terminus, 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 agree...
package logging import ( "fmt" "os" "sync" "time" ) type Level int const ( FATAL Level = iota ERROR WARNING INFO DEBUG ) type Record struct { Level Level Component string Message string } const ( CLEARLINE = "\x1b[2K" ) func Debugf(msg string, args ...interface{}) { defaultLogBroker.Records <-...
package rum import ( "net/http" "strings" "github.com/gin-gonic/gin" "github.com/go-jarvis/rum-gonic/pkg/httpx" "github.com/go-jarvis/statuserrors" "github.com/tangx/ginbinder" ) // 接口检查 var _ Operator = (*RouterGroup)(nil) var _ GroupOperator = (*RouterGroup)(nil) type GroupOperator interface { routerGroup(...
// Copyright 2018 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. package trace import ( "context" "fmt" "sync/atomic" _ "unsafe" ) type traceContextKey struct{} // NewTask creates a task instance with the type taskType...
// +build linux darwin package privsep import ( "bufio" "errors" "fmt" "io" "os" "os/exec" "os/user" "runtime" "strconv" "syscall" "github.com/fastly/go-utils/executable" ) const ( exitOK = 0 exitOSFailure = 1 exitDescribedFailure = 2 exitFailsafe = 3 statusOK = "ok" ...
package httplog import ( "context" "database/sql" "time" "github.com/rs/zerolog" "github.com/rs/zerolog/log" ) // logRespController determines which, if any, of the logging methods // you wish to use will be employed func responseLogController(ctx context.Context, log zerolog.Logger, db *sql.DB, t *tracker, opt...
package optest import ( "crypto/sha256" "encoding/base64" "encoding/json" "fmt" "io" "net/http" "net/url" "strings" "testing" "time" "github.com/lestrrat-go/jwx/jwk" "github.com/lestrrat-go/jwx/jwt" "github.com/stretchr/testify/require" ) type testData struct { baseURL string redirectUrl strin...
package main import ( "context" "net/http" "os" "runtime/debug" "strconv" "sync" "time" // importing this automatically registers the pprof api to our metrics server _ "net/http/pprof" ipc "libp2p_ipc" capnp "capnproto.org/go/capnp/v3" logging "github.com/ipfs/go-log/v2" "github.com/prometheus/client_g...
//Package rest implements Equinix REST client package rest import ( "context" "encoding/json" "fmt" "net/http" "os" "github.com/equinix/rest-go/internal/api" "github.com/go-resty/resty/v2" ) const ( //LogLevelEnvVar is OS variable name that controlls logging level LogLevelEnvVar = "EQUINIX_REST_LOG" ) //Cl...
package plugin import ( "fmt" "sync" "github.com/docker/libnetwork/drivers/remote/api" "github.com/docker/libnetwork/types" . "github.com/weaveworks/weave/common" "github.com/weaveworks/weave/common/docker" "github.com/weaveworks/weave/common/odp" "github.com/weaveworks/weave/plugin/skel" "github.com/vishv...
package cmd import ( "fmt" "os" "github.com/Azure/go-autorest/autorest/azure/auth" "github.com/openshift/windows-machine-config-bootstrapper/tools/windows-node-installer/pkg/cloudprovider" "github.com/openshift/windows-machine-config-bootstrapper/tools/windows-node-installer/pkg/cloudprovider/azure" "github.com...
package httpfake import ( "bytes" "fmt" "io/ioutil" "net/http" "strings" "testing" ) const assertErrorTemplate = "assertion error: %s" // Assertor provides an interface for setting assertions for http requests type Assertor interface { Assert(r *http.Request) error Log(t testing.TB) Error(t testing.TB, err ...
// Package billmodel contains the types for schema 'equinox'. package billmodel // GENERATED BY XO. DO NOT EDIT. import ( "database/sql" "github.com/lib/pq" ) // Comentry represents a row from 'equinox.comentry'. type Comentry struct { Ceperiod sql.NullString `json:"ceperiod"` // ceperiod Cecrnum...
package infrastructure import ( "context" "sync" "sync/atomic" uuid "github.com/satori/go.uuid" "github.com/alekns/tinyrstats/internal/monitor" "github.com/alekns/tinyrstats/pkg/helpers/str" ) // @TODO: Use from config const preDeclaredDataSize = 64 type ( taskByIDBucket = map[monitor.TaskID]*monitor.Task ...
package admin import ( "context" "fmt" "strconv" "strings" "github.com/golang/protobuf/ptypes/empty" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "github.com/DrmagicE/gmqtt" "github.com/DrmagicE/gmqtt/persistence/subscription" "github.com/DrmagicE/gmqtt/pkg/packets" ) type subscriptionSe...
// Copyright (c) 2021 PaddlePaddle 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...
package main import ( "bufio" "fmt" "io/ioutil" "os" ) var ( fileName = "default" unitConfig = map[string]string{ "Description": "Build by github.com/yzy613/create-systemd-service", "Documentation": "", "Requires": "", "RequiresOverridable": "", "Requisite": "", "...
package client import ( "bytes" "fmt" "io/ioutil" "net" "net/http" "net/http/httputil" "net/url" "path" "sync" "time" logutil "github.com/docker/infrakit/pkg/log" "github.com/docker/infrakit/pkg/rpc" "github.com/docker/infrakit/pkg/run/local" "github.com/docker/infrakit/pkg/spi" "github.com/gorilla/rpc...
// Copyright (c) 2017 Tigera, 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 applica...
// Copyright 2018 The xfsgo Authors // This file is part of the xfsgo library. // // The xfsgo library is free software: you can redistribute it and/or modify // it under the terms of the MIT Lesser General Public License as published by // the Free Software Foundation, either version 3 of the License, or // (at your o...
package sirene import ( "archive/zip" "crypto/sha256" "fmt" "hash" "io" "log" "net/http" "os" "path/filepath" "strconv" "strings" "github.com/jclebreton/opensirene/progress" "github.com/pkg/errors" "github.com/jclebreton/opensirene/opendata/gouvfr/api" ) const ( sirenID = "5862206588ee38254d3...
package window import ( "bytes" "encoding/base64" "fmt" "image" "image/draw" "image/png" "math" humanize "github.com/dustin/go-humanize" "github.com/rs/jplot/data" "github.com/wcharczuk/go-chart" "github.com/wcharczuk/go-chart/drawing" //"github.com/wcharczuk/go-chart/seq" ) func Init() { chart.DefaultB...
package main import ( "bufio" "crypto/tls" "flag" "fmt" "os" "strings" "sync" "text/tabwriter" "time" "github.com/Sirupsen/logrus" "github.com/mitchellh/colorstring" ) const ( // BANNER is what is printed for help/info output. BANNER = "certok - %s\n" // VERSION is the binary version. VERSION = "v0.1...
// Copyright (c) 2017 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...
/* Copyright © 2021 <NAME> <<EMAIL>> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, softw...
package terraform import ( "bytes" "encoding/json" "fmt" "io" "io/ioutil" "os" "os/exec" "path/filepath" "strings" "sync" "github.com/pkg/errors" "github.com/sirupsen/logrus" ) //go:generate go-bindata -pkg terraform -nocompress -o terraformfile.go ./cluster.tf const ( terraformDefaultFilename = "clust...
package forwarder_test import ( "context" "testing" "time" "github.com/sidkik/watermill" "github.com/sidkik/watermill/components/forwarder" "github.com/sidkik/watermill/message" "github.com/sidkik/watermill/pubsub/gochannel" "github.com/stretchr/testify/suite" ) var ( logger = watermill.NewStdLogger(true, t...
package models type User struct { Username string `json:"-"` FullName string `json:"full_name,omitempty"` Email string `json:"email,omitempty"` Roles []string `json:"roles"` Password *string `json:"password,omit...
package limiter import ( "container/list" "context" "fmt" "sync" "time" "github.com/platinummonkey/go-concurrency-limits/core" ) type fifoElement struct { ctx context.Context releaseChan chan core.Listener } func (e *fifoElement) setListener(listener core.Listener) { select { case e.releaseChan <-...
package main import ( "bufio" "fmt" "hash/fnv" "io" "log" "math/rand" "os" "runtime" "strconv" "time" "github.com/sebnyberg/gobloom" "github.com/sebnyberg/protoio" "github.com/segmentio/ksuid" "google.golang.org/protobuf/types/known/timestamppb" ) func printHelp() { fmt.Println("go run main.go [gen-fi...
package main import ( "errors" "fmt" "os" "time" "github.com/concourse/atc" "github.com/concourse/fly/rc" "github.com/concourse/go-concourse/concourse" "github.com/dgrijalva/jwt-go" blink1 "github.com/hink/go-blink1" flags "github.com/jessevdk/go-flags" ) func main() { // TODO like "fly build": // --pipe...
package connect import ( "errors" "fmt" "io" "net" "sort" "strings" "sync" "time" "github.com/zhengxiaoyao0716/util/console" "github.com/zhengxiaoyao0716/util/cout" ) var ( // BufSize . BufSize int ) // Mode [UNUSED:000][UNUSED:000][GUEST:000][USER:000][ROOT:000], 000:rwx, r:read,...
package argsutil import ( module "github.com/shihray/gserver/module" "github.com/shihray/gserver/utils" ) var ( NULL = "null" //nil null BOOL = "bool" //bool INT = "int" //int32 SHORT = "int32" //int LONG = "long" //long64 FLOAT = "float" //float32 DO...
package soap import ( "encoding/xml" "errors" "fmt" "io" "io/ioutil" "math/rand" "mime" "mime/multipart" "net/textproto" "reflect" "strings" ) type mtomEncoder struct { writer *multipart.Writer } // Binary enables binary data to be enchanged in MTOM mode with XOP encoding // When MTOM is not used, the fi...
package main import ( "html/template" "log" "net/http" "os" "path/filepath" "sort" "strings" ) type Server struct { BaseDir string DisallowDirectories bool *UserStore } // ServeHTTP implements http.Handler by wrapping Handler with error handling and authentication func (s *Server) ServeHTTP(w ...
package bls import ( "crypto/rand" "math/big" "testing" bn256 "github.com/ethereum/go-ethereum/crypto/bn256/cloudflare" "github.com/keep-network/keep-core/pkg/internal/testutils" ) func TestSignAndVerify(t *testing.T) { pi, _ := new(big.Int).SetString("3141592653589793238462643383279502884197169399375105820974...
package account import ( "crypto/rand" "encoding/hex" "encoding/json" "fmt" "time" config "github.com/aeternity/aepp-sdk-go/v9/config" uuid "github.com/satori/go.uuid" "golang.org/x/crypto/argon2" "golang.org/x/crypto/nacl/secretbox" ) const ( cryptoSecretType = "ed25519" cryptoSymmetricAlg = "xsalsa20-...
package wingui import ( "errors" "log" "strconv" "syscall" "unsafe" "github.com/lxn/win" ) // Widget inspect dialog item. type Widget interface { WndProc(msg uint32, wParam, lParam uintptr) uintptr AsWindowBase() *WindowBase } // DialogConfig TODO. type DialogConfig struct { Style uint32 //Widgets will b...
// *** WARNING: this file was generated by the Pulumi SDK Generator. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** package v1beta import ( "context" "reflect" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // Get an OS Config guest policy. func LookupGuestPolicy(ctx *pulumi...
package secret import ( "fmt" "time" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" utilruntime "k8s.io/apimachinery/pkg/util/runtime" "k8s.io/apimachinery/pkg/util/wait" coreinformers "k8s.io/client-go/informers/core/v1" "k8s.io/client-go/kuber...
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package lexmodelbuildingservice 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...
/* Copyright 2020 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 law or agreed to in ...
// Copyright 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 agreed...
package cli // ////////////////////////////////////////////////////////////////////////////////// // // // // Copyright (c) 2020 ESSENTIAL KAOS // // Apache License, Version 2.0 <htt...
package execenv import ( "bytes" "fmt" "io" "os" "path/filepath" "strings" "time" "github.com/dnephin/dobi/logging" git "github.com/gogits/git-module" "github.com/metakeule/fmtdate" "github.com/pkg/errors" fasttmpl "github.com/valyala/fasttemplate" ) const ( startTag = "{" endTag = "}" execI...
package stats import ( "encoding/json" "errors" "fmt" "sort" "strconv" "strings" "github.com/Blue-Pix/abc/lib/util" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/lambda" "github.com/aws/aws-sdk-go/service/lambda/lambdaiface" "github.com/olekukonko/tablewriter" "github.com/spf13/cobra"...
// Copyright 2020 Google LLC // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in ...
/* Copyright AppsCode Inc. and Contributors 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 (c) 2016 <NAME> // Licenced under the MIT License. package dual import ( "fmt" "math" "math/cmplx" "strings" ) // A Complex represents a dual complex number as an ordered array of two // complex128 values. type Complex [2]complex128 var ( // Symbols for the canonical dual complex basis. symbCompl...
package kt import ( "fmt" "strconv" "strings" "github.com/Shopify/sarama" ) const OffsetResume int64 = -3 type Offset struct { Relative bool Start int64 Diff int64 } func OldestOffset() Offset { return Offset{Relative: true, Start: sarama.OffsetOldest} } func NewestOffset() Offset { return Offset{Rel...
/* * Tencent is pleased to support the open source community by making Blueking Container Service available. * Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. * Licensed under the MIT License (the "License"); you may not use this file except * in compliance with the License. You may obta...
package k8s import ( "fmt" "log" "strings" "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/fields" "k8s.io/client-go/kubernetes" "k8s.io/client-go/rest" pb "github.com/kinvolk/inspektor-gadget/pkg/gadgettracermanager/api" "github.com/kinvolk/inspektor-gadget/pkg...
// Package cmd will contain the logic for a CLI deployment // of hashclock package cmd import ( "encoding/json" "fmt" "os" "strconv" "github.com/ZalgoNoise/hashclock/clock" "github.com/ZalgoNoise/hashclock/flags" ) // printResponse function is a generic fork based on the input `toJSON` value // to either run `...
package alicloud import ( "fmt" "strings" "time" "github.com/aliyun/alibaba-cloud-sdk-go/services/slb" "github.com/hashicorp/terraform/helper/resource" "github.com/hashicorp/terraform/helper/schema" ) func resourceAliyunSlbAttachment() *schema.Resource { return &schema.Resource{ Create: resourceAliyunSlbAt...
package ftx // Copyright (c) 2015-2019 Bitontop Technologies Inc. // Distributed under the MIT software license, see the accompanying // file COPYING or http://www.opensource.org/licenses/mit-license.php. import ( "encoding/json" "time" "github.com/bitontop/gored/exchange" ) type JsonResponse struct { Success b...
package rdb import ( "time" "github.com/jinzhu/gorm" "github.com/x-color/vue-trello/model" "github.com/x-color/vue-trello/usecase" ) // List is List data model for DB. type List struct { ID string `gorm:"primary_key"` UserID string `gorm:"primary_key"` BoardID string Title string Before *...
package main import ( "fmt" "github.com/fiatjaf/lightningd-gjson-rpc" "github.com/tidwall/gjson" "os" "strings" "time" ) type LnClient struct { *lightning.Client ui *UI } var ln *LnClient var NodeCache = make(map[string]Node) var lastCacheLookup time.Time const cacheFor = time.Second * 60 func NewClient(ui ...
package hosting import ( "context" "fmt" "net/url" "strings" "code.gitea.io/sdk/gitea" "github.com/git-town/git-town/v7/src/giturl" "golang.org/x/oauth2" ) // GiteaDriver provides access to the API of Gitea installations. type GiteaDriver struct { apiToken string client *gitea.Client hostname strin...
package psutil import ( "fmt" "net" "strconv" "time" "github.com/hyperpilotio/node-agent/pkg/snap" psutilnet "github.com/shirou/gopsutil/net" ) var netIOCounterLabels = map[string]label{ "bytes_sent": label{ unit: "", description: "", }, "bytes_recv": label{ unit: "", description: "", ...
package trace import ( "log" "os" "sync" "time" ) const ( _maxLevel = 64 // hard code reset probability at 0.00025, 1/4000 _probability = 0.00025 ) // NewTracer new a tracer. func NewTracer(serviceName string, report reporter, disableSample bool) Tracer { sampler := newSampler(_probability) // default inte...
package trino import ( "context" "crypto/tls" "crypto/x509" "database/sql/driver" "fmt" "io" "io/ioutil" "math" "net/http" "net/url" "strconv" "time" "gopkg.in/jcmturner/gokrb5.v6/client" "gopkg.in/jcmturner/gokrb5.v6/config" "gopkg.in/jcmturner/gokrb5.v6/keytab" ) // Conn is a Trino connection. imple...
package uicontrols import ( "github.com/gazercloud/gazerui/canvas" "github.com/gazercloud/gazerui/ui" "github.com/gazercloud/gazerui/uievents" "github.com/gazercloud/gazerui/uiinterfaces" "github.com/gazercloud/gazerui/uiresources" "github.com/go-gl/glfw/v3.3/glfw" "golang.org/x/image/colornames" "image" ) ty...
//************************************************************************// // API "Omnibus": Models // // Generated with goagen v0.0.1, command line: // $ goagen // --out=$(GOPATH)/src/omnibus // --design=omnibus/design // // The content of this file is auto-generated, DO NOT MODIFY //********************************...
// The timestamp command annotates lines read from standard input // with the time that they were read. This is useful for seeing // timing information on running commands from the shell. // // With no file arguments, timestamp prints lines read // from standard input prefixed with a timestamp, // the time since the ti...
package web import ( m "github.com/smilix/running/server/models" "github.com/gin-gonic/gin" "strconv" "fmt" "time" ) type Runs struct { } func NewRuns(group *gin.RouterGroup) *Runs { r := new(Runs) group.Use(CheckAuthMiddleware()) group.GET("", r.listRuns) group.POST("", r.createRun) group.GET("/:id", r....
package sortedmap import "fmt" func (tree *btreeTreeStruct) Dump() (err error) { tree.Lock() defer tree.Unlock() if nil != tree.nodeCache { fmt.Printf("B+Tree @ %p has Node Cache @ %p\n", tree, tree.nodeCache) fmt.Printf(" .evictLowLimit = %v\n", tree.nodeCache.evictLowLimit) fmt.Printf(" .evictHighLimit...
// Copyright 2016-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 appli...
package storage import ( "bytes" "crypto/aes" "crypto/cipher" "crypto/rand" "encoding/base64" "encoding/json" "errors" "fmt" "io" "io/ioutil" "os" "os/user" "path/filepath" "github.com/yitsushi/totp-cli/util" ) // Storage structure represents the credential storage type Storage struct { File strin...
package grpc import ( "context" "errors" "fmt" "testing" "time" grpc "github.com/Haba1234/sysmon/internal/grpc/api" "github.com/Haba1234/sysmon/internal/mocks" "github.com/Haba1234/sysmon/internal/sysmon" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/suite" "go.uber.org/goleak" "google.g...
package process import ( "bufio" "fmt" "io" "os" "os/exec" "os/user" "strings" "sync" "syscall" "time" "github.com/mylxsw/asteria/log" ) // OutputType command output type type OutputType string const ( // LogTypeStderr stderr output LogTypeStderr = OutputType("stderr") // LogTypeStdout stdout output ...
// Package configs contains templates for the configuration files to be used in testing. package configs import ( "bytes" "fmt" "text/template" ) var ( pubTmpl = ` :Z: . . [ :S: [ {{ range .L2TLDs }} :A: {{ .TLD }} [ :deleg: ed25519 {{ .PubKey }} :redir: ns.{{ .TLD }}. ] ...
// Copyright 2015 The Go Authors. All rights reserved. // Use of this source code is governed by a BSD-style // license that can be found in the LICENSE file. // Package gl contains an OpenGL implementation of the gxui.Driver interface. package gl import ( "container/list" "image" "runtime" "sync/atomic" "time" ...
// Copyright 2013 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 main import ( "go/ast" "go/parser" "go/token" "os" "path" "runtime" "strings" ) func isGoFile(dir os.FileInfo) bool { return !dir.IsDir() && ...
package uroncha import ( "encoding/json" "fmt" "io" "net" "net/http" "net/http/httputil" "os" "strings" "time" _ "github.com/joho/godotenv/autoload" "github.com/julienschmidt/httprouter" "github.com/rs/xid" "github.com/sirupsen/logrus" "github.com/zjyl1994/caasiu" "github.com/zjyl1994...
package DLocker import ( "log" "strconv" "sync" "time" "github.com/jetume/go-zk-lock/modules" "github.com/samuel/go-zookeeper/zk" ) type Dlocker struct { lockerPath string prefix string basePath string timeout time.Duration innerLock *sync.Mutex } func NewLocker(path string, timeout time.Durati...