repo_name
stringlengths
1
52
repo_creator
stringclasses
6 values
programming_language
stringclasses
4 values
code
stringlengths
0
9.68M
num_lines
int64
1
234k
session-manager-plugin
aws
Go
// Copyright 2018 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...
241
session-manager-plugin
aws
Go
// Copyright 2018 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...
164
session-manager-plugin
aws
Go
// Copyright 2018 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...
82
session-manager-plugin
aws
Go
// Copyright 2018 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...
135
session-manager-plugin
aws
Go
// Copyright 2020 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...
200
session-manager-plugin
aws
Go
// Copyright 2019 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...
126
session-manager-plugin
aws
Go
// Copyright 2020 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...
312
session-manager-plugin
aws
Go
// Copyright 2020 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...
130
session-manager-plugin
aws
Go
// Copyright 2018 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...
134
session-manager-plugin
aws
Go
// Copyright 2019 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...
141
session-manager-plugin
aws
Go
// Copyright 2019 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...
90
session-manager-plugin
aws
Go
// Copyright 2019 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...
64
session-manager-plugin
aws
Go
// Copyright 2019 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...
56
session-manager-plugin
aws
Go
// Copyright 2019 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...
36
session-manager-plugin
aws
Go
// Copyright 2019 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...
34
session-manager-plugin
aws
Go
// Copyright 2018 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...
24
session-manager-plugin
aws
Go
// Copyright 2018 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...
46
session-manager-plugin
aws
Go
// Copyright 2018 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...
89
session-manager-plugin
aws
Go
// Copyright 2018 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...
141
session-manager-plugin
aws
Go
// Copyright 2018 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...
173
session-manager-plugin
aws
Go
// Copyright 2018 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...
87
session-manager-plugin
aws
Go
// Copyright 2018 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...
99
session-manager-plugin
aws
Go
// Copyright 2018 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...
28
session-manager-plugin
aws
Go
// Copyright 2018 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...
27
session-manager-plugin
aws
Go
// Copyright 2018 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...
126
session-manager-plugin
aws
Go
// Copyright 2018 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...
79
session-manager-plugin
aws
Go
// Copyright 2018 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...
290
session-manager-plugin
aws
Go
// Copyright 2018 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...
202
session-manager-plugin
aws
Go
// Copyright 2018 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...
49
session-manager-plugin
aws
Go
// Copyright 2018 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...
78
session-manager-plugin
aws
Go
// Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 // This is an autogenerated file. // Changes made to this file will be overwritten during the build process. // Package version contains CLI version constant and utilities. package version // Version is...
13
session-manager-plugin
aws
Go
// Copyright 2019 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...
65
session-manager-plugin
aws
Go
// Copyright 2019 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...
80
session-manager-plugin
aws
Go
// Copyright 2019 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...
66
session-manager-plugin
aws
Go
// Copyright 2019 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...
159
session-manager-plugin
aws
Go
// Copyright 2018 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...
78
session-manager-plugin
aws
Go
// Copyright 2018 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...
91
session-manager-plugin
aws
Go
// Copyright 2018 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...
86
session-manager-plugin
aws
Go
// Package sdk is the official AWS SDK for the Go programming language. // // The AWS SDK for Go provides APIs and utilities that developers can use to // build Go applications that use AWS services, such as Amazon Elastic Compute // Cloud (Amazon EC2) and Amazon Simple Storage Service (Amazon S3). // // The SDK remove...
412
session-manager-plugin
aws
Go
package aws import ( "net/http" "time" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/endpoints" ) // UseServiceDefaultRetries instructs the config to use the service's own // default number of retries. This will be the default action if // Config.MaxRetries is nil also. const UseServ...
606
session-manager-plugin
aws
Go
package aws import ( "net/http" "reflect" "testing" "github.com/aws/aws-sdk-go/aws/credentials" ) var testCredentials = credentials.NewStaticCredentials("AKID", "SECRET", "SESSION") var copyTestConfig = Config{ Credentials: testCredentials, Endpoint: String("CopyTestEndpoint"), Reg...
92
session-manager-plugin
aws
Go
// +build !go1.9 package aws import "time" // Context is an copy of the Go v1.7 stdlib's context.Context interface. // It is represented as a SDK interface to enable you to use the "WithContext" // API methods with Go v1.6 and a Context type such as golang.org/x/net/context. // // See https://golang.org/pkg/context ...
38
session-manager-plugin
aws
Go
// +build go1.9 package aws import "context" // Context is an alias of the Go stdlib's context.Context interface. // It can be used within the SDK's API operation "WithContext" methods. // // See https://golang.org/pkg/context on how to use contexts. type Context = context.Context
12
session-manager-plugin
aws
Go
// +build !go1.7 package aws import ( "github.com/aws/aws-sdk-go/internal/context" ) // BackgroundContext returns a context that will never be canceled, has no // values, and no deadline. This context is used by the SDK to provide // backwards compatibility with non-context API operations and functionality. // // G...
23
session-manager-plugin
aws
Go
// +build go1.7 package aws import "context" // BackgroundContext returns a context that will never be canceled, has no // values, and no deadline. This context is used by the SDK to provide // backwards compatibility with non-context API operations and functionality. // // Go 1.6 and before: // This context functio...
21
session-manager-plugin
aws
Go
package aws import ( "time" ) // SleepWithContext will wait for the timer duration to expire, or the context // is canceled. Which ever happens first. If the context is canceled the Context's // error will be returned. // // Expects Context to always return a non-nil error if the Done channel is closed. func SleepWi...
25
session-manager-plugin
aws
Go
package aws_test import ( "fmt" "testing" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/awstesting" ) func TestSleepWithContext(t *testing.T) { ctx := &awstesting.FakeContext{DoneCh: make(chan struct{})} err := aws.SleepWithContext(ctx, 1*time.Millisecond) if err != nil { t.Errorf("exp...
38
session-manager-plugin
aws
Go
package aws import "time" // String returns a pointer to the string value passed in. func String(v string) *string { return &v } // StringValue returns the value of the string pointer passed in or // "" if the pointer is nil. func StringValue(v *string) string { if v != nil { return *v } return "" } // String...
919
session-manager-plugin
aws
Go
package aws import ( "reflect" "testing" "time" ) var testCasesStringSlice = [][]string{ {"a", "b", "c", "d", "e"}, {"a", "b", "", "", "e"}, } func TestStringSlice(t *testing.T) { for idx, in := range testCasesStringSlice { if in == nil { continue } out := StringSlice(in) if e, a := len(out), len(in...
1,533
session-manager-plugin
aws
Go
// Package aws provides the core SDK's utilities and shared types. Use this package's // utilities to simplify setting and reading API operations parameters. // // Value and Pointer Conversion Utilities // // This package includes a helper conversion utility for each scalar type the SDK's // API use. These utilities ma...
57
session-manager-plugin
aws
Go
package aws import "github.com/aws/aws-sdk-go/aws/awserr" var ( // ErrMissingRegion is an error that is returned if region configuration is // not found. ErrMissingRegion = awserr.New("MissingRegion", "could not find region configuration", nil) // ErrMissingEndpoint is an error that is returned if an endpoint ca...
14
session-manager-plugin
aws
Go
package aws // JSONValue is a representation of a grab bag type that will be marshaled // into a json string. This type can be used just like any other map. // // Example: // // values := aws.JSONValue{ // "Foo": "Bar", // } // values["Baz"] = "Qux" type JSONValue map[string]interface{}
13
session-manager-plugin
aws
Go
package aws import ( "log" "os" ) // A LogLevelType defines the level logging should be performed at. Used to instruct // the SDK which statements should be logged. type LogLevelType uint // LogLevel returns the pointer to a LogLevel. Should be used to workaround // not being able to take the address of a non-comp...
119
session-manager-plugin
aws
Go
package aws import ( "io" "strings" "sync" "github.com/aws/aws-sdk-go/internal/sdkio" ) // ReadSeekCloser wraps a io.Reader returning a ReaderSeekerCloser. Allows the // SDK to accept an io.Reader that is not also an io.Seeker for unsigned // streaming payload API operations. // // A ReadSeekCloser wrapping an n...
265
session-manager-plugin
aws
Go
package aws import ( "bytes" "math/rand" "testing" ) func TestWriteAtBuffer(t *testing.T) { b := &WriteAtBuffer{} n, err := b.WriteAt([]byte{1}, 0) if err != nil { t.Errorf("expected no error, but received %v", err) } if e, a := 1, n; e != a { t.Errorf("expected %d, but received %d", e, a) } n, err = ...
93
session-manager-plugin
aws
Go
// +build go1.8 package aws import "net/url" // URLHostname will extract the Hostname without port from the URL value. // // Wrapper of net/url#URL.Hostname for backwards Go version compatibility. func URLHostname(url *url.URL) string { return url.Hostname() }
13
session-manager-plugin
aws
Go
// +build !go1.8 package aws import ( "net/url" "strings" ) // URLHostname will extract the Hostname without port from the URL value. // // Copy of Go 1.8's net/url#URL.Hostname functionality. func URLHostname(url *url.URL) string { return stripPort(url.Host) } // stripPort is copy of Go 1.8 url#URL.Hostname fu...
30
session-manager-plugin
aws
Go
// Package aws provides core functionality for making requests to AWS services. package aws // SDKName is the name of this AWS SDK const SDKName = "aws-sdk-go" // SDKVersion is the version of this SDK const SDKVersion = "1.40.17"
9
session-manager-plugin
aws
Go
// Package arn provides a parser for interacting with Amazon Resource Names. package arn import ( "errors" "strings" ) const ( arnDelimiter = ":" arnSections = 6 arnPrefix = "arn:" // zero-indexed sectionPartition = 1 sectionService = 2 sectionRegion = 3 sectionAccountID = 4 sectionResource = 5 ...
94
session-manager-plugin
aws
Go
// +build go1.7 package arn import ( "errors" "testing" ) func TestParseARN(t *testing.T) { cases := []struct { input string arn ARN err error }{ { input: "invalid", err: errors.New(invalidPrefix), }, { input: "arn:nope", err: errors.New(invalidSections), }, { input: "arn:a...
132
session-manager-plugin
aws
Go
// Package awserr represents API error interface accessors for the SDK. package awserr // An Error wraps lower level errors with code, message and an original error. // The underlying concrete error type may also satisfy other interfaces which // can be to used to obtain more specific information about the error. // /...
165
session-manager-plugin
aws
Go
package awserr import ( "encoding/hex" "fmt" ) // SprintError returns a string of the formatted error code. // // Both extra and origErr are optional. If they are included their lines // will be added, but if they are not included their lines will be ignored. func SprintError(code, message, extra string, origErr e...
222
session-manager-plugin
aws
Go
package awsutil import ( "io" "reflect" "time" ) // Copy deeply copies a src structure to dst. Useful for copying request and // response structures. // // Can copy between structs of different type, but will only copy fields which // are assignable, and exist in both structs. Fields which are not assignable, // o...
109
session-manager-plugin
aws
Go
package awsutil_test import ( "bytes" "fmt" "io" "io/ioutil" "reflect" "testing" "time" "github.com/aws/aws-sdk-go/aws/awsutil" ) func ExampleCopy() { type Foo struct { A int B []*string } // Create the initial value str1 := "hello" str2 := "bye bye" f1 := &Foo{A: 1, B: []*string{&str1, &str2}} ...
354
session-manager-plugin
aws
Go
package awsutil import ( "reflect" ) // DeepEqual returns if the two values are deeply equal like reflect.DeepEqual. // In addition to this, this method will also dereference the input values if // possible so the DeepEqual performed will not fail if one parameter is a // pointer and the other is not. // // DeepEqua...
28
session-manager-plugin
aws
Go
package awsutil_test import ( "testing" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" ) func TestDeepEqual(t *testing.T) { cases := []struct { a, b interface{} equal bool }{ {"a", "a", true}, {"a", "b", false}, {"a", aws.String(""), false}, {"a", nil, false}, {"a", aws.S...
31
session-manager-plugin
aws
Go
package awsutil import ( "reflect" "regexp" "strconv" "strings" "github.com/jmespath/go-jmespath" ) var indexRe = regexp.MustCompile(`(.+)\[(-?\d+)?\]$`) // rValuesAtPath returns a slice of values found in value v. The values // in v are explored recursively so all nested values are collected. func rValuesAtPa...
222
session-manager-plugin
aws
Go
package awsutil_test import ( "strings" "testing" "github.com/aws/aws-sdk-go/aws/awsutil" ) type Struct struct { A []Struct z []Struct B *Struct D *Struct C string E map[string]string } var data = Struct{ A: []Struct{{C: "value1"}, {C: "value2"}, {C: "value3"}}, z: []Struct{{C: "value1"}, {C: "value2"}, ...
183
session-manager-plugin
aws
Go
package awsutil import ( "bytes" "fmt" "io" "reflect" "strings" ) // Prettify returns the string representation of a value. func Prettify(i interface{}) string { var buf bytes.Buffer prettify(reflect.ValueOf(i), 0, &buf) return buf.String() } // prettify will recursively walk value v to build a textual // re...
114
session-manager-plugin
aws
Go
package awsutil import ( "bytes" "fmt" "reflect" "strings" ) // StringValue returns the string representation of a value. func StringValue(i interface{}) string { var buf bytes.Buffer stringValue(reflect.ValueOf(i), 0, &buf) return buf.String() } func stringValue(v reflect.Value, indent int, buf *bytes.Buffer...
89
session-manager-plugin
aws
Go
// +build go1.7 package awsutil import ( "testing" "github.com/aws/aws-sdk-go/aws" ) type testStruct struct { Field1 string Field2 *string Field3 []byte `sensitive:"true"` Value []*string } func TestStringValue(t *testing.T) { cases := map[string]struct { Value interface{} Expect string }{ "general...
52
session-manager-plugin
aws
Go
package client import ( "fmt" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" ) // A Config provides configuration to a service client instance. type Config struct { Config *aws.Config Handlers request.Handlers PartitionID s...
94
session-manager-plugin
aws
Go
package client import ( "testing" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" ) func pushBackTestHandler(name string, list *request.HandlerList) *bool { called := false (*list).PushBackNamed(request.NamedHandler{ Name: name, Fn: fu...
81
session-manager-plugin
aws
Go
package client import ( "math" "strconv" "time" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/internal/sdkrand" ) // DefaultRetryer implements basic retry logic using exponential backoff for // most services. If you want to implement custom retry logic, you can implement the // request.Retr...
178
session-manager-plugin
aws
Go
package client import ( "net/http" "testing" "time" "github.com/aws/aws-sdk-go/aws/request" ) func TestRetryThrottleStatusCodes(t *testing.T) { cases := []struct { expectThrottle bool expectRetry bool r request.Request }{ { false, false, request.Request{ HTTPResponse: &http...
200
session-manager-plugin
aws
Go
package client import ( "bytes" "fmt" "io" "io/ioutil" "net/http/httputil" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/request" ) const logReqMsg = `DEBUG: Request %s/%s Details: ---[ REQUEST POST-SIGN ]----------------------------- %s -----------------------------------------------------` ...
203
session-manager-plugin
aws
Go
package client import ( "bytes" "fmt" "io" "io/ioutil" "net/http" "reflect" "testing" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/corehandlers" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/request" ) type moc...
228
session-manager-plugin
aws
Go
package client import ( "time" "github.com/aws/aws-sdk-go/aws/request" ) // NoOpRetryer provides a retryer that performs no retries. // It should be used when we do not want retries to be performed. type NoOpRetryer struct{} // MaxRetries returns the number of maximum returns the service will use to make // an in...
29
session-manager-plugin
aws
Go
package client import ( "net/http" "testing" "time" "github.com/aws/aws-sdk-go/aws/request" ) func TestNoOpRetryer(t *testing.T) { cases := []struct { r request.Request expectMaxRetries int expectRetryDelay time.Duration expectRetry bool }{ { r: request.Request{ HTTPRespons...
47
session-manager-plugin
aws
Go
package metadata // ClientInfo wraps immutable data from the client.Client structure. type ClientInfo struct { ServiceName string ServiceID string APIVersion string PartitionID string Endpoint string SigningName string SigningRegion string JSONVersion string TargetPrefix string }
15
session-manager-plugin
aws
Go
package corehandlers import ( "bytes" "fmt" "io/ioutil" "net/http" "net/url" "regexp" "strconv" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/request" ) // Interface for matching types which also ha...
233
session-manager-plugin
aws
Go
// +build go1.10 package corehandlers_test import ( "bytes" "io" "net/http" "net/http/httptest" "testing" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/credentials" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/awstesting/unit" "github.com/aws/aws-sdk-go/service/s3" ) ...
59
session-manager-plugin
aws
Go
package corehandlers_test import ( "bytes" "fmt" "io/ioutil" "net/http" "net/http/httptest" "net/url" "strings" "testing" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/a...
453
session-manager-plugin
aws
Go
package corehandlers import "github.com/aws/aws-sdk-go/aws/request" // ValidateParametersHandler is a request handler to validate the input parameters. // Validating parameters only has meaning if done prior to the request being sent. var ValidateParametersHandler = request.NamedHandler{Name: "core.ValidateParameters...
18
session-manager-plugin
aws
Go
package corehandlers_test import ( "fmt" "reflect" "testing" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/corehandlers" "github.com/aws/aws-sdk-go/aws/request" "git...
287
session-manager-plugin
aws
Go
package corehandlers import ( "os" "runtime" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/request" ) // SDKVersionUserAgentHandler is a request handler for adding the SDK Version // to the user agent. var SDKVersionUserAgentHandler = request.NamedHandler{ Name: "core.SDKVersionUserAgentHandler...
38
session-manager-plugin
aws
Go
package corehandlers import ( "net/http" "os" "testing" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/internal/sdktesting" ) func TestAddHostExecEnvUserAgentHander(t *testing.T) { cases := []struct { ExecEnv string Expect string }{ {ExecEnv: "Lambda", Expect: execEnvUAKey + "/Lambd...
42
session-manager-plugin
aws
Go
package credentials import ( "github.com/aws/aws-sdk-go/aws/awserr" ) var ( // ErrNoValidProvidersFoundInChain Is returned when there are no valid // providers in the ChainProvider. // // This has been deprecated. For verbose error messaging set // aws.Config.CredentialsChainVerboseErrors to true. ErrNoValidPr...
101
session-manager-plugin
aws
Go
package credentials import ( "reflect" "testing" "github.com/aws/aws-sdk-go/aws/awserr" ) type secondStubProvider struct { creds Value expired bool err error } func (s *secondStubProvider) Retrieve() (Value, error) { s.expired = false s.creds.ProviderName = "secondStubProvider" return s.creds, s.err ...
190
session-manager-plugin
aws
Go
// +build !go1.7 package credentials import ( "github.com/aws/aws-sdk-go/internal/context" ) // backgroundContext returns a context that will never be canceled, has no // values, and no deadline. This context is used by the SDK to provide // backwards compatibility with non-context API operations and functionality....
23
session-manager-plugin
aws
Go
// +build go1.7 package credentials import "context" // backgroundContext returns a context that will never be canceled, has no // values, and no deadline. This context is used by the SDK to provide // backwards compatibility with non-context API operations and functionality. // // Go 1.6 and before: // This context...
21
session-manager-plugin
aws
Go
// +build !go1.9 package credentials import "time" // Context is an copy of the Go v1.7 stdlib's context.Context interface. // It is represented as a SDK interface to enable you to use the "WithContext" // API methods with Go v1.6 and a Context type such as golang.org/x/net/context. // // This type, aws.Context, and...
40
session-manager-plugin
aws
Go
// +build go1.9 package credentials import "context" // Context is an alias of the Go stdlib's context.Context interface. // It can be used within the SDK's API operation "WithContext" methods. // // This type, aws.Context, and context.Context are equivalent. // // See https://golang.org/pkg/context on how to use co...
14
session-manager-plugin
aws
Go
// Package credentials provides credential retrieval and management // // The Credentials is the primary method of getting access to and managing // credentials Values. Using dependency injection retrieval of the credential // values is handled by a object which satisfies the Provider interface. // // By default the Cr...
384
session-manager-plugin
aws
Go
// +build go1.9 package credentials import ( "fmt" "strconv" "sync" "testing" "time" ) func BenchmarkCredentials_Get(b *testing.B) { stub := &stubProvider{} cases := []int{1, 10, 100, 500, 1000, 10000} for _, c := range cases { b.Run(strconv.Itoa(c), func(b *testing.B) { creds := NewCredentials(stub) ...
91
session-manager-plugin
aws
Go
// +build go1.7 package credentials import ( "context" "testing" ) func TestCredentialsGetWithContext(t *testing.T) { stub := &stubProviderConcurrent{ stubProvider: stubProvider{ creds: Value{ AccessKeyID: "AKIDEXAMPLE", SecretAccessKey: "KEYEXAMPLE", }, }, done: make(chan struct{}), } ...
78
session-manager-plugin
aws
Go
package credentials import ( "math/rand" "sync" "testing" "time" "github.com/aws/aws-sdk-go/aws/awserr" ) type stubProvider struct { creds Value retrievedCount int expired bool err error } func (s *stubProvider) Retrieve() (Value, error) { s.retrievedCount++ s.expired = false ...
281
session-manager-plugin
aws
Go
package credentials import ( "os" "github.com/aws/aws-sdk-go/aws/awserr" ) // EnvProviderName provides a name of Env provider const EnvProviderName = "EnvProvider" var ( // ErrAccessKeyIDNotFound is returned when the AWS Access Key ID can't be // found in the process's environment. ErrAccessKeyIDNotFound = aws...
75
session-manager-plugin
aws
Go
package credentials import ( "os" "testing" "github.com/aws/aws-sdk-go/internal/sdktesting" ) func TestEnvProviderRetrieve(t *testing.T) { restoreEnvFn := sdktesting.StashEnv() defer restoreEnvFn() os.Setenv("AWS_ACCESS_KEY_ID", "access") os.Setenv("AWS_SECRET_ACCESS_KEY", "secret") os.Setenv("AWS_SESSION_TO...
107
session-manager-plugin
aws
Go
package credentials import ( "fmt" "os" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/internal/ini" "github.com/aws/aws-sdk-go/internal/shareddefaults" ) // SharedCredsProviderName provides a name of SharedCreds provider const SharedCredsProviderName = "SharedCredentialsProvider" var ( // ...
152