text
stringlengths
3.08k
10.4k
package main import ( "encoding/json" "fmt" "github.com/PuerkitoBio/goquery" "github.com/olebedev/config" "io" "io/ioutil" "net/http" "net/http/cookiejar" "os" "path/filepath" "strings" ) // Show define a show type Show struct { ID string Name string URL string } // Episode define an episode (like s...
// Code generated by entc, DO NOT EDIT. package ent import ( "fmt" "strings" "time" "entgo.io/ent/dialect/sql" "github.com/pytlesk4/kong/ent/service" "github.com/pytlesk4/kong/ent/user" ) // Service is the model entity for the Service schema. type Service struct { config `json:"-"` // ID of the ent. ID int...
package main import ( "encoding/json" "fmt" "os" "path/filepath" "sort" "strings" "unicode" "github.com/alecthomas/kong" "github.com/flosch/pongo2" "github.com/aquasecurity/openapi-generator/traverser" ) var cli struct { // nolint: govet Parse struct { Pretty bool `flag help:"pretty print"` Doc...
/* Package state defines Snapshot, a data structure for holding a blockchain's state. */ package state import ( "encoding/binary" "fmt" "github.com/chain/txvm/errors" "github.com/chain/txvm/protocol/bc" "github.com/chain/txvm/protocol/patricia" ) // Snapshot contains a blockchain's state. // // TODO: consider m...
package cmd import ( _ "embed" "flag" "fmt" "github.com/fatih/color" "github.com/mitchellh/cli" "github.com/posener/complete" "github.com/roots/trellis-cli/trellis" "io/ioutil" "os" "path/filepath" "strings" ) type AliasCommand struct { UI cli.Ui flags *flag.FlagSet Trellis ...
// Copyright 2016-2021 Authors of Cilium // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ag...
// Copyright 2014 AdRoll, 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 wri...
/* Copyright 2014 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...
/* 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 2019 The Kanister Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ag...
// Copyright 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...
//go:build ignore // +build ignore package main import ( "fmt" "go/format" "io/ioutil" "log" "os" "os/exec" "runtime" "strings" ) func main() { ver := runtime.Version()[:6] var tags string var name string var fname string switch ver { case "go1.18": tags = "//+build go1.18" name = "go118_export" ...
// // (C) Copyright 2019-2021 Intel Corporation. // // SPDX-License-Identifier: BSD-2-Clause-Patent // package engine import ( "bufio" "context" "fmt" "io" "os" "path" "path/filepath" "sort" "strings" "testing" "time" "github.com/pkg/errors" "github.com/daos-stack/daos/src/control/common" "github.com/...
package main import ( "context" "flag" "fmt" "log" "net" "regexp" "strconv" "strings" "time" "github.com/miekg/dns" ) var ( debug bool = false r = &net.Resolver{} nat64 string nameserver string /* Regexs for checking input */ ipv6Regex = `^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-...
// Code generated by ydbgen; DO NOT EDIT. package main import ( "strconv" "github.com/yandex-cloud/ydb-go-sdk/v2" "github.com/yandex-cloud/ydb-go-sdk/v2/table" ) var ( _ = strconv.Itoa _ = ydb.StringValue _ = table.NewQueryParameters ) func (s *Series) Scan(res *table.Result) (err error) { res.SeekItem("ser...
package introspection import ( "fmt" "strings" "github.com/iancoleman/strcase" ) var schemaQuery = ` query IntrospectionQuery { __schema { queryType { name } mutationType { name } subscriptionType { name } types { ...FullType } directives { name ...
/* 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, ...
// Copyright 2020 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...
// Code generated by gotdgen, DO NOT EDIT. package tg import ( "context" "errors" "fmt" "sort" "strings" "go.uber.org/multierr" "github.com/gotd/td/bin" "github.com/gotd/td/tdp" "github.com/gotd/td/tgerr" ) // No-op definition for keeping imports. var ( _ = bin.Buffer{} _ = context.Background() _ = fmt...
package credentials import ( "encoding/json" "errors" "fmt" "io" "io/ioutil" "iot-home/models" "iot-home/utilities" "net/http" "net/url" "os" "path" "sync" logger "github.com/sirupsen/logrus" ) var lock = &sync.Mutex{} var netatmoOAuth *models.NetatmoOAuth var hueAppKey *string var DeviceName string =...
/* * This file is part of the KubeVirt project * * 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 la...
package jsoniter import ( "fmt" "io" "reflect" "strings" "unsafe" ) func encoderOfStruct(cfg *frozenConfig, typ reflect.Type) (ValEncoder, error) { type bindingTo struct { binding *Binding toName string ignored bool } orderedBindings := []*bindingTo{} structDescriptor, err := describeStruct(cfg, typ) ...
/* 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, ...
// github.com/bingohuang/go-codes /** 题目: 36. 有效的数独 难度: 2 地址: https://leetcode-cn.com/problems/valid-sudoku/ */ package test import ( "fmt" "reflect" "testing" ) // input and ouput type IO36 struct { in [][]byte out bool } func Test36(t *testing.T) { // add test cases tc := map[string]IO36{ /*"0": {[][]byt...
/* * Copyright (c) Microsoft Corporation. * Licensed under the MIT license. */ package pipeline import ( "context" "strings" "github.com/pkg/errors" "k8s.io/klog/v2" "github.com/Azure/azure-service-operator/v2/tools/generator/internal/astmodel" ) func FlattenProperties() Stage { return MakeLegacyStage("fl...
// // Go-FTL // // Copyright (C) <NAME>, 2014-2016 // // Do not remove the following lines - used in auto-update. // Version: 0.5.9 // BuildNo: 1811 // FileId: 1245 // package GoTemplate import ( "fmt" "net/http" "net/http/httptest" "regexp" "testing" "github.com/pschlump/Go-FTL/server/cfg" "github.com/pschlu...
//go:build !js // +build !js package websocket import ( "context" "encoding/binary" "errors" "fmt" "log" "time" "github.com/zjhmale/websocket/internal/errd" ) // Close performs the WebSocket close handshake with the given status code and reason. // // It will write a WebSocket close frame with a timeout of 5...
package main import ( "flag" "fmt" "log" "os" "os/signal" "strings" "syscall" "time" "github.com/aldenso/zfssareport/model" "github.com/aldenso/zfssareport/utils" "github.com/aldenso/zfssareport/zfssareportfs" "github.com/spf13/afero" ) var ( //IP for zfssa REST api. IP string //USER for zfssa authen...
package allocation import ( "fmt" "net" "sync" "time" "github.com/pion/logging" ) // ManagerConfig a bag of config params for Manager. type ManagerConfig struct { LeveledLogger logging.LeveledLogger AllocatePacketConn func(network string, requestedPort int) (net.PacketConn, net.Addr, error) AllocateConn...
//lint:file-ignore U1001 Ignore all unused code, staticcheck doesn't understand testify/suite package txnbuild import ( "github.com/aiblocks/go/amount" "github.com/aiblocks/go/support/errors" "github.com/aiblocks/go/xdr" ) // CreateClaimableBalance represents the AiBlocks create claimable balance operation. See //...
// Copyright 2020 The Kubernetes Authors. // SPDX-License-Identifier: Apache-2.0 package common import ( "fmt" "io" "io/ioutil" "os" "path/filepath" "k8s.io/cli-runtime/pkg/genericclioptions" "k8s.io/klog/v2" "sigs.k8s.io/kustomize/kyaml/kio" "sigs.k8s.io/kustomize/kyaml/kio/kioutil" "sigs.k8s.io/kustomize...
/* 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 imm //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 //distribut...
package identity // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "net/http" "time" "golang.org/x/net/context" "github.com/go-openapi/errors" "github.com/go-openapi/runtime" cr "github.com/go-openapi/runtime/client" ...
// Code generated by smithy-go-codegen DO NOT EDIT. package wafregional import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" "github.com/aws/aws-sdk-go-v2/service/wafregional/types" "github.com/awslabs/smithy-go/middleware" smithyhttp "githu...
package aws import ( "fmt" "log" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/waf" "github.com/aws/aws-sdk-go/service/wafregional" "github.com/hashicorp/terraform/helper/schema" "github.com/hashicorp/terraform/helper/validation" ) func resourceAwsWafRegionalRateBasedRule() *schema.Resour...
package server import ( "bytes" "fmt" "io" "io/ioutil" "net/http" "path" "strings" "github.com/go-kit/kit/log" "github.com/go-kit/kit/log/level" rulesspec "github.com/observatorium/api/rules" "github.com/prometheus/client_golang/prometheus" "github.com/prometheus/client_golang/prometheus/promauto" "githu...
// Package mirror provides local mirroring and replica management /* * Copyright (c) 2018-2020, NVIDIA CORPORATION. All rights reserved. */ package mirror import ( "fmt" "os" "runtime" "github.com/NVIDIA/aistore/3rdparty/glog" "github.com/NVIDIA/aistore/cluster" "github.com/NVIDIA/aistore/cmn" "github.com/NV...
package queue import ( "math/rand" "sort" "github.com/cortexproject/cortex/pkg/util" ) // This struct holds user queues for pending requests. It also keeps track of connected queriers, // and mapping between users and queriers. type queues struct { userQueues map[string]*userQueue // List of all users with que...
// *** 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 cloudwatch import ( "context" "reflect" "github.com/pulumi/pulumi/sdk/v3/go/pulumi" ) // Use this data source to get information about...
// Copyright Ngo 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 writi...
/* Copyright 2020 Docker Compose CLI 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 a...
// +build linux /* 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 agree...
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package workmail import ( "context" "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/internal/awsutil" ) type ListAliasesInput struct { _ struct{} `type:"structure"` // The identifier for the entity for which to list the alia...
// Package repl implements the read-eval-print-loop for the command line flux query console. package repl import ( "context" "fmt" "io/ioutil" "os" "os/signal" "path/filepath" "sort" "strings" "sync" "syscall" "github.com/influxdata/flux/ast" prompt "github.com/c-bata/go-prompt" "github.com/influxdata/f...
package blocks import ( "fmt" "github.com/spacemeshos/sha256-simd" "github.com/spacemeshos/go-spacemesh/common/types" "github.com/spacemeshos/go-spacemesh/log" ) // VRFValidationFunction is the VRF validation function. type VRFValidationFunction func(message, signature, publicKey []byte) (bool, error) type blo...
package main import ( "fmt" "io/ioutil" "log" "net/http" "os" "os/exec" "testing" "time" "github.com/litmuschaos/chaos-exporter/pkg/chaosmetrics" version "github.com/litmuschaos/chaos-exporter/pkg/version" . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" v1alpha1 "github.com/litmuschaos/chaos-oper...
package hooks import ( "context" "net/http" "testing" "time" "github.com/golang/mock/gomock" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "github.com/ovh/cds/engine/api/test" "github.com/ovh/cds/sdk" "github.com/ovh/cds/sdk/cdsclient/mock_cdsclient" "github.com/ovh/cds/sdk/lo...
// 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 xeddata import ( "bufio" "errors" "fmt" "io" "regexp" "strings" ) // Reader reads enc/dec-instruction objects from XED datafile. type Reader str...
package circuitbreaker import ( "context" "encoding/json" "fmt" "io/ioutil" "log" "net" "net/http" "time" "github.com/aclk/goblog/common/messaging" "github.com/aclk/goblog/common/tracing" "github.com/aclk/goblog/common/util" "github.com/afex/hystrix-go/hystrix" "github.com/eapache/go-resiliency/retrier" ...
package cmd import ( "fmt" "github.com/muesli/termenv" "github.com/spf13/cobra" ) // fsocietyCmd represents the fsociety command var fsocietyCmd = &cobra.Command{ Hidden: true, Use: "fsociety", Short: "AllSafe Trace Utility", Long: "AllSafe Trace Utility\n\nHello, Elliot.", Run: func(cmd *cobra.Command...
// Copyright 2021 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 typeparams import ( "errors" "fmt" "go/types" "os" "strings" ) //go:generate go run copytermlist.go const debug = false var ErrEmptyTypeSet = e...
/* Copyright 2016 The Rook 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 agreed to ...
package maps import ( "reflect" "github.com/francoispqt/lists" ) // InterfaceSlice is a custom type for a slice of interface{} type MapStringInterface map[string]interface{} // Contains method determines whether a slice includes a certain element, returning true or false as appropriate. func (c MapStringInterface...
// Copyright 2021 The Kanister Authors. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ag...
// Copyright 2019 clair 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 i...
package tokenvalidationmiddleware import ( "context" "crypto/rsa" "encoding/base64" "encoding/json" "errors" "fmt" "io/ioutil" "math/big" "net/http" "strings" "github.com/dgrijalva/jwt-go" ) // TokenValidationMiddleware represents the configuration for the validation middleware type TokenValidationMiddlew...
package dnsbruteforce import ( "bufio" "encoding/gob" "errors" "fmt" "net" "os" "path/filepath" "sync" "time" "github.com/BurntSushi/toml" "github.com/netm4ul/netm4ul/core/communication" "github.com/netm4ul/netm4ul/core/database/models" "github.com/netm4ul/netm4ul/core/events" "github.com/netm4ul/netm4u...
// Licensed to Elasticsearch B.V. under one or more contributor // license agreements. See the NOTICE file distributed with // this work for additional information regarding copyright // ownership. Elasticsearch B.V. licenses this file to you under // the Apache License, Version 2.0 (the "License"); you may // not use ...
package dmn import ( "encoding/json" "fmt" "io" "io/ioutil" "net/http" "os" "time" "github.com/gorilla/mux" ) // HandleRun runs a Command. If the command was run, we return status 200 regardless of // whether it was run successfully or not, or whether there was an issue in writing the duration. // This shoul...
package cmd import ( "io" "strings" "github.com/jenkins-x/jx/pkg/gits" "github.com/jenkins-x/jx/pkg/kube" "github.com/jenkins-x/jx/pkg/log" "github.com/jenkins-x/jx/pkg/util" "github.com/pkg/errors" "github.com/jenkins-x/jx/pkg/jx/cmd/templates" "github.com/spf13/cobra" "gopkg.in/AlecAivazis/survey.v1/term...
package rest import ( "context" "crypto/tls" "fmt" "github.com/go-chi/chi/v5" "github.com/pkg/errors" "log" "net/http" "os" "sync" "sync/atomic" "time" ) type SSLConfig struct { Port int // https server port Redirect bool // defines if http requests will be redirected to the https URL stri...
package main import ( "flag" "fmt" "net" "net/http" "os" "os/signal" "path" "strings" "syscall" cni "github.com/appc/cni/pkg/skel" "github.com/docker/libnetwork/ipamapi" weaveapi "github.com/weaveworks/weave/api" "github.com/weaveworks/weave/common" "github.com/weaveworks/weave/common/docker" weavenet ...
package render import ( metallbv1beta1 "github.com/metallb/metallb-operator/api/v1beta1" "gopkg.in/yaml.v2" corev1 "k8s.io/api/core/v1" ) type RenderingFailed struct { s string } func (e RenderingFailed) Error() string { return e.s } type OperatorConfig struct { NameSpace string ConfigMapName string Dat...
/* * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. * This product includes software developed at Datadog (https://www.datadoghq.com/). * Copyright 2019-Present Datadog, Inc. */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO N...
package main import ( "database/sql" "encoding/json" "fmt" "github.com/graphql-go/graphql" "github.com/graphql-go/graphql/language/ast" "log" ) // NullString to be used in place of sql.NullString type NullString struct { sql.NullString } // MarshalJSON from the json.Marshaler interface func (...
package volume import ( "fmt" "html/template" "os" cstortypes "github.com/openebs/api/pkg/apis/types" "github.com/openebs/openebsctl/client" "github.com/openebs/openebsctl/kubectl-openebs/cli/util" "github.com/pkg/errors" "github.com/spf13/cobra" "k8s.io/klog" ) var ( volumeInfoCommandHelpText = ` This c...
package grpc_logrus_test import ( "io" "io/ioutil" "runtime" "strings" "testing" "github.com/calin-ciobanu/go-grpc-middleware" "github.com/calin-ciobanu/go-grpc-middleware/logging/logrus" "github.com/calin-ciobanu/go-grpc-middleware/tags" pb_testproto "github.com/calin-ciobanu/go-grpc-middleware/testing/test...
// Copyright (c) Facebook, Inc. and its affiliates. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicabl...
package main import ( "crypto/hmac" "crypto/sha1" "encoding/base32" "encoding/json" "fmt" "io/ioutil" "log" "os" "os/user" "strings" "time" "github.com/spf13/cobra" ) func toBytes(value int64) []byte { var result []byte mask := int64(0xFF) shifts := [8]uint16{56, 48, 40, 32, 24, 16, 8, 0} for _, shif...
// Code generated by go-swagger; DO NOT EDIT. package dynatrace // This file was generated by the swagger tool. // Editing this file might prove futile when you re-run the swagger generate command import ( "bytes" "encoding/json" "io" "io/ioutil" "github.com/go-openapi/errors" "github.com/go-openapi/runtime" ...
package pipeline_test import ( "encoding/json" "fmt" "io/ioutil" "net/http" "testing" "github.com/BurntSushi/toml" "github.com/jinzhu/gorm" "github.com/shopspring/decimal" "github.com/stretchr/testify/require" "gopkg.in/guregu/null.v4" "github.com/vordev/VOR/core/internal/cltest" "github.com/vordev/VOR/c...
// Copyright 2021, OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ag...
// Package jsonproto is implemented JSON socket communication protocol. // Message data format: {length bytes}{xfer_pipe length byte}{xfer_pipe bytes}{JSON bytes} // // Copyright 2018 HenryLee. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file excep...
package command import ( "context" "fmt" "os" "os/exec" "os/signal" "sync" "syscall" "testing" "time" "github.com/stretchr/testify/require" assert "gopkg.in/go-playground/assert.v1" ) func helperCommandContext(ctx context.Context, s ...string) (cmd *exec.Cmd) { args := []string{"-test.run=TestHelperProce...
package urest import ( "context" "encoding/json" "fmt" "io/ioutil" "log" "net/http" "strings" ) type Clusters struct { Clusters []*Cluster } type HubClusters struct { Resources []HubCluster } type HubCluster struct { // Full name - projects/wlhe-cr/locations/global/memberships/asm-cr //Name string En...
// Copyright 2020 OpenTelemetry Authors // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or ag...
package ssh import ( "sync" "time" ) var ( HuaweiNoPage = "screen-length 0 temporary" H3cNoPage = "screen-length disable" CiscoNoPage = "terminal length 0" ) var sessionManager = NewSessionManager() /** * session(SSHSession)的管理类,会统一缓存打开的session,自动处理未使用超过10分钟的session * @attr sessionCache:缓存所有打开的map(10分钟内使...
// Copyright 2016 The Hugo 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 ...
// Copyright ©2015 The Gonum 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 dynamic import ( "bytes" "fmt" "io" "sort" "text/tabwriter" "gonum/graph/path/internal/testgraphs" "gonum/graph/simple" ) // dumper implem...
// Copyright (c) 2003-2005 <NAME>. All rights reserved. // Copyright (c) 2006-2015 Sippy Software, Inc. All rights reserved. // Copyright (c) 2015 <NAME>. All rights reserved. // // All rights reserved. // // Redistribution and use in source and binary forms, with or without modification, // are permitted provided that...
package main import ( "bufio" "fmt" "io/ioutil" "os" "strings" "github.com/sirkon/message" "gopkg.in/src-d/go-git.v4" "gopkg.in/src-d/go-git.v4/config" ) func main() { curDir, err := os.Getwd() if err != nil { message.Fatalf("failed to get current directory: %s", err) } repo, err := git.PlainOpen(curD...
// Copyright © 2017 <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 wri...
// Copyright 2016 The Prometheus Authors // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to...
package main import ( "fmt" "net/rpc" "sort" "strings" "time" "github.com/sententico/cost/aws" "github.com/sententico/cost/cmon" ) const ( minCommit = 0.0 maxCommit = 10000.0 initStep = 100.0 minStep = 0.001 ) func compawsOpt(base *cmon.SeriesRet, ho, ivl int) func(int, float64) fl...
/* Copyright 2015 - <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 distribute...
package eth import ( "fmt" "math/big" "reflect" "regexp" "strings" "time" "github.com/ethereum/go-ethereum/accounts/abi" ethcommon "github.com/ethereum/go-ethereum/common" "github.com/golang/glog" "github.com/livepeer/go-livepeer/common" ) const maxDecimals = 18 var ( BlocksUntilFirstClaimDeadline = big....
package main import ( "bufio" "encoding/json" "fmt" "io" "io/ioutil" "log" "mime" "mime/multipart" "net/http" "os" "strings" "github.com/sendgrid/rest" ) type configuration struct { Endpoint string `json:"endpoint"` Port string `json:"port"` } func loadConfig(path string) configuration { file, er...
package certificate import ( "fmt" "html/template" "io/ioutil" "os" "os/exec" "qcloud-tools/src/db" "qcloud-tools/src/tools" "regexp" "strings" "time" ) type IssueSync struct { Id uint64 SecretId, SecretKey string CdnType string `default:"cdn"` Cdn...
/* * Copyright 2020 The Compass 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 jira import ( "context" "encoding/base64" "encoding/json" "fmt" "net/http" "net/http/httptest" "net/url" "testing" jiraLib "github.com/andygrunwald/go-jira" "github.com/gogo/protobuf/types" "github.com/golang/mock/gomock" mitreMocks "github.com/stackrox/rox/central/mitre/datastore/mocks" namespac...
// Code generated by protoc-gen-go. DO NOT EDIT. // source: envoy/config/filter/http/lua/v2/lua.proto package v2 import ( fmt "fmt" proto "github.com/golang/protobuf/proto" _ "github.com/lyft/protoc-gen-validate/validate" math "math" ) // Reference imports to suppress errors if they are not otherwise used. var _...
/* Copyright 2021 The Skaffold 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 2017 The Bazel 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 agreed ...
package visibility // This module is responsible for uploading the metrics collected on OAPI requests // to New Relic and the initial request validation. import ( "bytes" "context" "encoding/json" "fmt" . "github.com/aurorasolar/go-service-nr-base/utils" newrelic "github.com/newrelic/go-agent" "go.uber.org/zap...
package filesystem import ( "context" "errors" "fmt" "io" "io/ioutil" "os" "path/filepath" "sort" humanize "github.com/dustin/go-humanize" ) type DiskUsageReporter struct { } type DiskUsageRequest struct { Root string MaxRecursion int Verbose bool } type DiskUsageResponse struct { Root *Di...
package main import ( "context" "encoding/json" "errors" firebase "firebase.google.com/go" "firebase.google.com/go/messaging" "flag" "fmt" "google.golang.org/api/option" "io/ioutil" "log" "os" "time" ) type PushMessage struct { BasicNotification *messaging.Notification `json:"notification,omitempty"` Da...
package app import ( "encoding/json" "encoding/xml" "fmt" "github.com/writeas/go-nodeinfo" "net/http" "strings" "github.com/go-ap/errors" ) type link struct { Rel string `json:"rel,omitempty"` Type string `json:"type,omitempty"` Href string `json:"href,omitempty"` Template string `json:"templ...
package octopus 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 ( zuckerBirthday = nook.Birthday{ Day: 8, Mon...
package spannertool import ( "cloud.google.com/go/spanner" "context" "fmt" "github.com/cockroachdb/errors" "github.com/go-playground/validator/v10" spannerSession "github.com/justdomepaul/toolbox/database/spanner" "github.com/justdomepaul/toolbox/errorhandler" "github.com/justdomepaul/toolbox/stringtool" "goo...