text
stringlengths
3.08k
10.4k
package ackhandler import ( "time" "github.com/lucas-clemente/quic-go/internal/protocol" "github.com/lucas-clemente/quic-go/internal/utils" "github.com/lucas-clemente/quic-go/internal/wire" ) // number of ack-eliciting packets received before sending an ack. const packetsBeforeAck = 2 type receivedPacketTracker...
// Copyright 2012 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 collate import ( "unicode" ) // weights holds the decoded weights per collation level. type weights struct { primary uint32 secondary uint16 ter...
/* Copyright AppsCode Inc. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distri...
package handlers import ( "encoding/json" "fmt" "github.com/go-openapi/runtime/middleware" "github.com/go-openapi/swag" "github.com/google/uuid" keptnapi "github.com/keptn/go-utils/pkg/api/utils" keptnutils "github.com/keptn/go-utils/pkg/lib/keptn" keptnv2 "github.com/keptn/go-utils/pkg/lib/v0_2_0" "github.co...
package handler import ( "bytes" "context" "fmt" "io" "os" "strings" "time" "crypto/hmac" "crypto/sha256" "encoding/json" "io/ioutil" "net/http" "github.com/ysugimoto/doorkeeper/entity" "github.com/ysugimoto/doorkeeper/github" "github.com/ysugimoto/doorkeeper/rule" ) const ( githubEventNamePullReque...
// Package stack provides utilities to capture and pass around stack traces. // // This is useful for building errors that know where they originated from, to // track where a certain log event occured and so on. package stack import ( "bytes" "fmt" "os" "path/filepath" "runtime" "strings" ) const maxStackSize ...
// Copyright 2021 dfuse Platform 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 agre...
// Copyright (c) 2021 Aiven, Helsinki, Finland. https://aiven.io/ package controllers import ( "context" "fmt" "strconv" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/meta" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/clien...
// Copyright 2020 The Gitea Authors. All rights reserved. // Use of this source code is governed by a MIT-style // license that can be found in the LICENSE file. package gitea import ( "log" "testing" "time" "github.com/stretchr/testify/assert" ) // TestIssue is main func witch call all Tests for Issue API // (...
package webhook import ( "code.cloudfoundry.org/cf-k8s-networking/cfroutesync/models" "crypto/sha256" "errors" "fmt" "sort" log "github.com/sirupsen/logrus" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // "mesh" is a special reserved word on Istio VirtualServices // https://istio.io/docs/reference/config/n...
package continuous import ( "github.com/jtejido/ggsl/specfunc" "github.com/jtejido/stats" "github.com/jtejido/stats/err" smath "github.com/jtejido/stats/math" "math" "math/rand" ) // Beta distribution // https://en.wikipedia.org/wiki/Beta_distribution type Beta struct { baseContinuousWithSource alpha, beta fl...
package m2go import "fmt" type ItemNotFoundError struct { ItemID int } func (a *ItemNotFoundError) Error() string { return fmt.Sprintf("itemID '%d' is non-existent", a.ItemID) } type Cart struct { ID int `json:"id"` CreatedAt string `json:"created_at...
/* Copyright 2020 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 internal import ( "os" "testing" "github.com/tamada/rrh" ) func ExampleListCommand() { var dbFile = rrh.Rollback("../testdata/database.json", "../testdata/config.json", func(config *rrh.Config, oldDB *rrh.Database) { var list, _ = ListCommandFactory() list.Run([]string{}) }) defer os.Remove(dbFile)...
package main import ( "bytes" "hash/crc32" "io/ioutil" "os" "path/filepath" "regexp" "strconv" ) // Game in a steam library. May or may not be installed. type Game struct { // Official appID or custom shortcut ID ID string // Warning, may contain Unicode characters. Name string // Tags, including user-cre...
package db import ( "database/sql/driver" "errors" "fmt" "time" ) // DB interface provides access to a persistent database. type DB interface { // AddGHInstallation records a new installation. AddGHInstallation(installationID, accountID, senderID int64) error // RemoveGHInstallation removes an installation. R...
/* 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 writing, software dis...
// +------------------------------------------------------------------------- // | Copyright (C) 2016 Yunify, Inc. // +------------------------------------------------------------------------- // | Licensed under the Apache License, Version 2.0 (the "License"); // | you may not use this work except in compliance with t...
// Copyright 2016 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...
/* Copyright 2016 The Kubernetes 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 applicable law or ag...
// Package influx provides the backend for storing stats. package influx import ( "fmt" "sort" "strconv" "strings" "time" "github.com/influxdata/influxdb/client/v2" "github.com/jcelliott/lumber" "github.com/spf13/viper" "github.com/nanopack/pulse/plexer" ) var clientConn client.Client func Query(sql strin...
package broker_test import ( "acceptance/helpers" "encoding/json" "fmt" "os" "strings" "github.com/cloudfoundry-incubator/cf-test-helpers/cf" "github.com/cloudfoundry-incubator/cf-test-helpers/generator" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" "github.com/onsi/gomega/gbytes" . "github.com/ons...
package main import ( "github.com/chenjianmei111/go-state-types/big" "github.com/chenjianmei111/go-state-types/exitcode" "github.com/chenjianmei111/specs-actors/actors/builtin" "github.com/chenjianmei111/lotus/conformance/chaos" "github.com/chenjianmei111/go-address" . "github.com/chenjianmei111/test-vectors/...
// Copyright Istio 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 wri...
package main import ( "bufio" "fmt" "os" "unicode/utf8" ) func main() { // string change_character_in_string() take_substring() loop_in_string() number_of_xx_in_string() // array and slice array_and_slice_make_init() cut_last_elemnet_in_arrary() use_lable_to_break() map_make_init_usage() struct_make...
package events import ( "context" "strings" "sync" "time" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/scheme" typedcorev1 "k8s.io/client-go/kubernetes/t...
// Code generated by protoc-gen-gogo. DO NOT EDIT. // source: github.com/m3db/m3/src/metrics/generated/proto/transformationpb/transformation.proto // Copyright (c) 2018 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated document...
// Copyright (c) 2017 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...
package collector import ( "fmt" "strings" "time" autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/kubernetes" "k8s.io/metrics/pkg/apis/custom_metrics" ) const ( rpsQuery = `scalar(sum(rate(skipper...
package appid import ( "context" "encoding/base64" "io" "log" "net/http" "os" appid "github.com/IBM/appid-management-go-sdk/appidmanagementv4" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/mitchellh/go-homedir" ) func resourceAp...
package graph import ( "testing" "runtime" "strings" "github.com/StepLg/go-erx/src/erx" "github.com/orfjackal/gospec/src/gospec" . "github.com/orfjackal/gospec/src/gospec" ) func init() { // adding to erx directory prefix to cut from file names _, file, _, _ := runtime.Caller(0) dirName := file[0:strings.Las...
package data import ( "context" "fmt" "github.com/hashicorp/go-hclog" protos "github.com/shizhongwang/myswagger/currency/protos/currency" ) // ErrProductNotFound is an error raised when a product can not be found in the database var ErrProductNotFound = fmt.Errorf("Product not found") // Product defines the str...
package api import ( "fmt" "net/http" "strconv" "time" "github.com/blockblu-io/leaderlog-api/pkg/api/dto" "github.com/blockblu-io/leaderlog-api/pkg/auth" "github.com/blockblu-io/leaderlog-api/pkg/db" "github.com/gin-gonic/gin" ) // groupByDates takes a look at the given leader log and groups the assigned // ...
// Copyright 2018 the Service Broker Project Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applic...
// // stnfilter.go - Simple Timesheet Notation filter. // // @author <NAME>, <<EMAIL>> // copyright (c) 2021 all rights reserved. // Released under the BSD 2-Clause license. // See: http://opensource.org/licenses/BSD-2-Clause // package main import ( "bufio" "fmt" "os" "time" // My packages "github.com/rsdoiel/...
package spacelift import ( "context" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/shurcooL/graphql" "github.com/spacelift-io/terraform-provider-spacelift/spacelift/internal" "github.com/spacelift-io/terraform-provider-spacelift/spa...
package model import ( "encoding/json" "errors" "log" "sort" "github.com/ebittleman/voting/eventstore" "github.com/ebittleman/voting/voting" ) var ( // ErrIssueNotOnPoll returned when a Ballot is cast with a Selection to an // Issue not on the poll. ErrIssueNotOnPoll = errors.New("Issue on submitted ballot ...
package hardware import ( "encoding/json" "testing" "github.com/filanov/bm-inventory/internal/validators" "github.com/filanov/bm-inventory/internal/common" "github.com/sirupsen/logrus" "github.com/alecthomas/units" "github.com/filanov/bm-inventory/models" "github.com/go-openapi/strfmt" "github.com/google/...
package boyar import ( "encoding/json" "fmt" "github.com/orbs-network/boyarin/boyar/config" "github.com/orbs-network/boyarin/strelets/adapter" "github.com/orbs-network/boyarin/version" "sort" "strings" "text/template" ) func getDefaultNginxResponse(status string) string { rawVersion, _ := json.Marshal(versio...
// +build test package ninchat import ( "fmt" "log" "math/rand" "os" "sort" "strconv" "testing" ) const numDeliverMessages = 10 var deliverMessageType = "test" + strconv.Itoa(rand.Int()) func init() { log.SetFlags(log.Flags() | log.Lmicroseconds) } func TestDialogueMessageDelivery(t *testing.T) { testMes...
// Copyright © 2019 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...
package http import ( "context" "fmt" "net" "net/http" "strings" "time" "github.com/go-orion/Orion/orion/handlers" "github.com/go-orion/Orion/utils/log" "github.com/gorilla/mux" "google.golang.org/grpc" ) //NewHTTPHandler creates a new HTTP handler func NewHTTPHandler(config Config) handlers.Handler { ret...
// Copyright 2016 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" fil...
// Copyright © 2021 The Things Network Foundation, The Things Industries B.V. // // 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 // // Un...
package logger import ( "fmt" "os" "runtime" "strconv" "sync" "time" ) const Version = "17.9.5" // log level, from low to high, more high means more serious const ( TraceLevel = iota DebugLevel InfoLevel WarnLevel ErrorLevel FatalLevel ) const ( Ltime = 1 << iota // show the time Lfile ...
// SPDX-License-Identifier: Unlicense OR MIT package layout import ( "image" "gioui.org/f32" "gioui.org/op" "gioui.org/unit" ) // Constraints represent the minimum and maximum size of a widget. // // A widget does not have to treat its constraints as "hard". For // example, if it's passed a constraint with a mi...
package calcium import ( "bufio" "context" "io" "strconv" "sync" "github.com/google/uuid" "github.com/pkg/errors" enginetypes "github.com/projecteru2/core/engine/types" "github.com/projecteru2/core/log" "github.com/projecteru2/core/strategy" "github.com/projecteru2/core/types" "github.com/projecteru2/cor...
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. package model import ( "encoding/json" "fmt" "io" "net/http" "regexp" "strings" "unicode/utf8" ) const ( CLASS_CONTACT_NAME_MAX_LENGTH = 64 CLASS_DESCRIPTION_MAX_LENGTH = 255 CLASS_DISPLAY_NAME_...
package mysqlstream import ( "context" "database/sql" "sync" "time" "github.com/moiot/gravity/pkg/core" "github.com/moiot/gravity/pkg/inputs/helper" "github.com/juju/errors" "github.com/mitchellh/mapstructure" log "github.com/sirupsen/logrus" "github.com/moiot/gravity/pkg/config" "github.com/moiot/gravi...
// Copyright (c) 2021 Red Hat, Inc. // Copyright Contributors to the Open Cluster Management project package proxy import ( "bytes" "compress/gzip" "io/ioutil" "log" "net/http" "net/url" "strings" "testing" "github.com/open-cluster-management/rbac-query-proxy/pkg/util" ) func TestNewEmptyMatrixHTTPBody(t *...
package selector import "fmt" type Operator string const ( // doubleEqualSignOpeator represents == DoubleEqualSignOperator Operator = "==" // notEqualOperator represents != NotEqualOperator Operator = "!=" // inOperator represents in InOperator Operator = "in" // notInOperator represents notin NotInOperator ...
package main import ( "flag" carbon "github.com/marpaia/graphite-golang" "log" "math" "net/http" "os" "os/signal" "sort" "strconv" "strings" "syscall" "time" ) var httpUrl = flag.String("url", "http://localhost/", "The URL to issue the GET to.") var carbonHost = flag.String("carbon-host", "localhost", "Ca...
/* Copyright 2021 The pdfcpu 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, s...
// Code generated by MockGen. DO NOT EDIT. // Source: github.com/m3db/m3/src/m3ninx/index/segment/mem (interfaces: ReadableSegment) // Copyright (c) 2020 Uber Technologies, Inc. // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (th...
package provisioner import ( "context" "crypto/x509" "regexp" "strings" "time" "github.com/pkg/errors" "github.com/smallstep/certificates/errs" "golang.org/x/crypto/ssh" ) // Controller wraps a provisioner with other attributes useful in callback // functions. type Controller struct { Interface Audiences ...
package trees import ( "encoding/binary" "github.com/tap-group/tdsvc/util" ) // Internal node in Prefix Tree type prefixInternalNode struct { parent prefixNode hash []byte leftChild prefixNode rightChild prefixNode partialPrefix []byte } // Leaf node representation in Prefix Tree type ...
package patch import ( "encoding/json" "fmt" f "github.com/elimity-com/scim/internal/filter" "github.com/elimity-com/scim/schema" "github.com/scim2/filter-parser/v2" "strings" ) // Op represents the possible value the operation is to perform. // Possible values are one of "add", "remove", or "replace". type Op ...
package batch import ( "bufio" "encoding/json" "fmt" "os" "github.com/pkg/errors" ) // CollectionSchema is used to unmarshal the JSON results of a list collections API call type CollectionSchema struct { ID string `json:"id,omitempty"` Name string `json:"name" header:"Schema"` Type string `json:"type"` } ...
// Copyright 2019 PingCAP, 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 i...
/* Copyright 2016 <NAME> Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed ...
package engine import ( "github.com/mumax/3cl/opencl" "github.com/mumax/3cl/data" "github.com/mumax/3cl/util" "math" ) type RK56 struct { } func (rk *RK56) Step() { m := M.Buffer() size := m.Size() if FixDt != 0 { Dt_si = FixDt } t0 := Time // backup magnetization m0 := opencl.Buffer(3, size) defer ...
package pipelines import ( "context" "encoding/json" "log" "net/http" "strconv" "github.com/go-resty/resty/v2" "github.com/hashicorp/terraform-plugin-sdk/v2/diag" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation" ) type SystemProper...
package storage import ( "bufio" "fmt" "os" "path" "strconv" "time" "github.com/spf13/afero" ) type AferoShard struct { fs afero.Fs FileShard } type Afero struct { fs afero.Fs path string mode Mode flag int perm os.FileMode } func NewAfero(fs afero.Fs, path string, mode Mode, perm os.FileMode) *Afe...
package originate import ( "bufio" "bytes" "io" "log" "net/http" "strings" "asterisk-dialer/config" "github.com/gin-gonic/gin" "github.com/heltonmarx/goami/ami" ) type ( OriginateRequest struct { Phone string `form:"phone"` Template string `form:"template"` Channel string `form:"channel"` ...
package secret import ( "context" "encoding/json" "errors" "strings" "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/aws/aws-sdk-go/service/ssm/ssmiface" "go.uber.org/zap" ) var ( log *zap.Logger // ErrSSMMissingRegion is a typed ...
package main import ( "context" "embed" "log" "net/http" "net/url" "os" "os/signal" "time" "github.com/davidoram/kratos-selfservice-ui-go/api_client" "github.com/davidoram/kratos-selfservice-ui-go/handlers" "github.com/davidoram/kratos-selfservice-ui-go/middleware" "github.com/davidoram/kratos-selfservice...
package wander_test import ( "context" "fmt" "log" "net/http" "net/url" "os" "regexp" "sync" "testing" "time" "github.com/KillianMeersman/wander" "github.com/KillianMeersman/wander/limits" "github.com/KillianMeersman/wander/request" "github.com/KillianMeersman/wander/util" "github.com/PuerkitoBio/goque...
package main import ( "github.com/bwmarrin/discordgo" "log" "strings" "time" ) // DiscordConnect make a new connection to Discord func (b *Bot) DiscordConnect() (err error) { b.dg, err = discordgo.New("Bot " + b.config.DiscordToken) if err != nil { log.Println("FATAL: błąd tworzenia sesji Discord,", err) re...
package command import ( "fmt" "strings" "github.com/jfrerich/mattermost-plugin-bookmarks/server/pluginapi" "github.com/mattermost/mattermost-server/v5/model" "github.com/mattermost/mattermost-server/v5/plugin" ) const ( routeAPIPrefix = "/api/v1" routeAutocompleteLabels = "/autocomplete/labels...
// Package closure provides closure transform for MIR representation. // // Closure transform is a process to move all functions to toplevel of program. // If a function does not contain any free variables, it can be moved to toplevel simply. // But when containing any free variables, the function must take a closure s...
package httprouter import ( "fmt" "log" "net/http" "strings" "github.com/ericyaoxr/mcube/http/context" "github.com/ericyaoxr/mcube/http/response" "github.com/ericyaoxr/mcube/http/router" "github.com/ericyaoxr/mcube/logger" httppb "github.com/ericyaoxr/mcube/pb/http" "github.com/julienschmidt/httprouter" ) ...
package cli import ( "context" "fmt" "runtime" "time" "github.com/spf13/cobra" "github.com/tilt-dev/tilt/internal/analytics" "github.com/tilt-dev/tilt/internal/docker" "github.com/tilt-dev/tilt/internal/dockercompose" "github.com/tilt-dev/tilt/pkg/logger" "github.com/tilt-dev/tilt/pkg/model" ) type doctor...
// Copyright 2017 <NAME>, Inc. All rights reserved. // Licensed under the Apache License, version 2.0: // http://www.apache.org/licenses/LICENSE-2.0 package datetime import ( "strings" "testing" "time" "github.com/attic-labs/noms/go/chunks" "github.com/attic-labs/noms/go/marshal" "github.com/attic-labs/noms/go...
// Copyright 2020 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 lsp import ( "context" "io" "path/filepath" "strings" "golang.org/x/tools/internal/event" "golang.org/x/tools/internal/gocommand" "golang.org/x...
package play import ( "net/url" "reflect" "strconv" jsoniter "github.com/json-iterator/go" "github.com/pkg/errors" ) /* This file is generated automatically by go generate. Do not edit. Created 2020-12-18 15:58:02.386833736 -0600 CST m=+0.000171080 */ // Changed func (o *KubeOptions) Changed(fieldName string...
package github import ( "context" "io" "time" "github.com/augmentable-dev/vtab" "github.com/shurcooL/githubv4" "go.riyazali.net/sqlite" "golang.org/x/time/rate" ) type fetchStarredReposOptions struct { Client *githubv4.Client Login string PerPage int StartCursor *githubv4.String Order ...
package message import ( "encoding/binary" "fmt" "log" "github.com/clmul/cutevpn" ) type IPv4 = cutevpn.IPv4 const ( tHello = 1 tLinkStateUpdate = 4 tLinkStateACK = 5 ) type header struct { // The type t byte // Where does the packet come from? // Note that ospf packets won't be forwarded. ...
package apis import ( "fmt" log "github.com/Sirupsen/logrus" lru "github.com/hashicorp/golang-lru" "github.com/intuit/katlas/service/db" "github.com/intuit/katlas/service/util" "github.com/mitchellh/mapstructure" ) // IMetaService define interfaces for metadata type IMetaService interface { // Get metadata by...
// Copyright 2020 PingCAP, 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 i...
package s3 import ( "bytes" "fmt" "html/template" "io" "io/ioutil" "log" "mime" "net/http" "path" "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/s3" s3Storage "github.com/madappgang/identifo/external_services/storage/s3" "github.com/madappgang/identifo/model" staticStoreLo...
package tdog import ( "log" "math" "net/http" "path" "github.com/julienschmidt/httprouter" ) const ( // AbortIndex . AbortIndex = math.MaxInt8 / 2 ) type ( // HandlerFunc . HandlerFunc func(*HttpUtil) // H . // H map[string]interface{} // ErrorMsg . ErrorMsg struct { Message string `json:"msg"...
package publisher import ( "context" "database/sql" "net" "net/http" "time" grpc_prometheus "github.com/grpc-ecosystem/go-grpc-prometheus" "github.com/improbable-eng/grpc-web/go/grpcweb" "github.com/pkg/errors" "github.com/sirupsen/logrus" "google.golang.org/grpc" "github.com/cachecashproject/go-cachecash...
/* Copyright 2011 The Perkeep 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, sof...
/* Copyright 2019 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 ci import ( "bytes" "encoding/base64" "errors" "fmt" "io" "io/ioutil" "os" "path" "regexp" "strings" "github.com/wearedevx/keystone/cli/internal/archive" "github.com/wearedevx/keystone/cli/internal/envfile" "github.com/wearedevx/keystone/cli/internal/keystonefile" "github.com/wearedevx/keystone/...
/* Copyright 2021 apstndb. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distri...
package sync import ( "fmt" log "github.com/sirupsen/logrus" "github.com/weaveworks/gitops-toolkit/pkg/runtime" "github.com/weaveworks/gitops-toolkit/pkg/storage" "github.com/weaveworks/gitops-toolkit/pkg/storage/watch" "github.com/weaveworks/gitops-toolkit/pkg/storage/watch/update" "github.com/weaveworks/gito...
package cmd import ( "errors" "fmt" "io" "net" "net/http" "os" "path" "strconv" "github.com/boltdb/bolt" kitlog "github.com/go-kit/kit/log" "github.com/gorilla/handlers" "github.com/spf13/afero" "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/xescugc/rebost/boltdb" "github.com/xescugc/re...
package duck 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 ( maelleBirthday = nook.Birthday{ Day: 8, Month:...
package main import ( "log" "math/rand" "os" "runtime/pprof" "time" ) const ( col = 10000 row = 10000 ) func fillMatrix(m *[row][col]int) { s := rand.New(rand.NewSource(time.Now().UnixNano())) for i := 0; i < row; i++ { for j := 0; j < col; j++ { m[i][j] = s.Intn(100000) } } } func calculate(m *[ro...
package sst import ( "testing" "github.com/patrickgombert/lsmt/common" c "github.com/patrickgombert/lsmt/comparator" "github.com/patrickgombert/lsmt/config" ) func TestOpenErrorFileNotFound(t *testing.T) { _, err := OpenSst("/not/real") if err == nil { t.Errorf("Expected opening non-existent SST to error but...
/** * Copyright 2018-2019 Wargaming Group Limited * * 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...
// Copyright 2017 alertmanager-github-receiver 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 applic...
package persistence import ( "errors" "fmt" "github.com/Fukkatsuso/cryptocurrency-trading-bot/trader/domain/model" "github.com/Fukkatsuso/cryptocurrency-trading-bot/trader/domain/repository" ) type tradeParamsRepository struct { db DB } func NewTradeParamsRepository(db DB) repository.TradeParamsRepository { r...
package server import ( "encoding/json" "fmt" "net" "net/http" "os" "strconv" "strings" "time" statsGo "github.com/fukata/golang-stats-api-handler" "github.com/lestrrat/go-server-starter/listener" "github.com/mercari/widebullet" "github.com/mercari/widebullet/config" "github.com/mercari/widebullet/jsonrp...
// Copyright 2012 Apcera Inc. All rights reserved. package tablewriter import ( "fmt" "math" "regexp" "strconv" "strings" "unicode/utf8" ) var ( // Must match SGR escape sequence, which is "CSI Pm m", where the Control // Sequence Introducer (CSI) is "ESC ["; where Pm is "A multiple numeric // parameter com...
// Copyright 2021 FerretDB 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 i...
package main import ( "database/sql" "flag" "fmt" "os" "github.com/keybase/go-keybase-chat-bot/kbchat" "github.com/keybase/go-keybase-chat-bot/kbchat/types/chat1" "github.com/keybase/managed-bots/base" "github.com/keybase/managed-bots/webhookbot/webhookbot" "golang.org/x/sync/errgroup" ) type Options struct...
package device import ( "fmt" "github.com/zach-klippenstein/goadb" "io/ioutil" "log" "os" "os/exec" "regexp" "strconv" "strings" "time" ) func init() { initDir() initAllDevices() } var Devices = map[string]*Device{} const ( searchDir = "./runtime/search_xml" resultDir = "./runtime/result_xml" ) func ...
/* Package ioc is Inversion of Control (IoC). Support lifecycle, such as singleton and transient. */ package ioc import ( "fmt" "log" "os" "reflect" "time" ) var consoleLog = log.New(os.Stdout, "[ioc] ", log.LstdFlags) // DEBUG is a switcher for debug var DEBUG = false // Lifecycle is singleton or transient ty...