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
// +build codegen package api import ( "fmt" "regexp" "strings" "unicode" ) func (a *API) enableGeneratedTypedErrors() { switch a.Metadata.Protocol { case "json": case "rest-json": default: return } a.WithGeneratedTypedErrors = true } // updateTopLevelShapeReferences moves resultWrapper, locationName, ...
613
session-manager-plugin
aws
Go
// +build go1.8,codegen package api import ( "reflect" "strconv" "strings" "testing" ) func TestUniqueInputAndOutputs(t *testing.T) { const serviceName = "FooService" shamelist[serviceName] = map[string]persistAPIType{ "OpOutputNoRename": { output: true, }, "OpInputNoRename": { input: true, }, ...
979
session-manager-plugin
aws
Go
// +build codegen package api import ( "bytes" "fmt" "text/template" ) // S3ManagerUploadInputGoCode returns the Go code for the S3 Upload Manager's // input structure. func S3ManagerUploadInputGoCode(a *API) string { if v := a.PackageName(); v != "s3" { panic(fmt.Sprintf("unexpected API model %s", v)) } s,...
87
session-manager-plugin
aws
Go
// +build codegen package api // ServiceName returns the SDK's naming of the service. Has // backwards compatibility built in for services that were // incorrectly named with the service's endpoint prefix. func ServiceName(a *API) string { if oldName, ok := oldServiceNames[a.PackageName()]; ok { return oldName } ...
160
session-manager-plugin
aws
Go
// +build codegen package api import ( "bytes" "fmt" "path" "regexp" "sort" "strings" "text/template" "github.com/aws/aws-sdk-go/private/protocol" ) // ErrorInfo represents the error block of a shape's structure type ErrorInfo struct { Type string Code string HTTPStatusCode int } // ...
1,058
session-manager-plugin
aws
Go
// +build 1.6,codegen package api_test import ( "testing" "github.com/aws/aws-sdk-go/private/model/api" ) func TestShapeTagJoin(t *testing.T) { s := api.ShapeTags{ {Key: "location", Val: "query"}, {Key: "locationName", Val: "abc"}, {Key: "type", Val: "string"}, } expected := `location:"query" locationNa...
29
session-manager-plugin
aws
Go
package api var shapeNameAliases = map[string]map[string]string{ "APIGateway": map[string]string{ "RequestValidator": "UpdateRequestValidatorOutput", "VpcLink": "UpdateVpcLinkOutput", "GatewayResponse": "UpdateGatewayResponseOutput", }, "Lambda": map[string]string{ "Concurrency": "PutFunctionConcu...
20
session-manager-plugin
aws
Go
// +build codegen package api import ( "bytes" "fmt" "text/template" ) // A ShapeValidationType is the type of validation that a shape needs type ShapeValidationType int const ( // ShapeValidationRequired states the shape must be set ShapeValidationRequired = iota // ShapeValidationMinVal states the shape mu...
170
session-manager-plugin
aws
Go
// +build codegen package api import ( "encoding/base64" "encoding/json" "fmt" "reflect" "sort" "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/private/protocol" ) // ShapeValueBuilder provides the logic to build the nested values for a shape. // Base64BlobValues is true if the blob fie...
277
session-manager-plugin
aws
Go
// +build codegen package api import ( "bytes" "encoding/json" "fmt" "os" "text/template" ) // SmokeTestSuite defines the test suite for smoke tests. type SmokeTestSuite struct { Version int `json:"version"` DefaultRegion string `json:"defaultRegion"` TestCases []SmokeTestCase ...
130
session-manager-plugin
aws
Go
// +build codegen package api import ( "bytes" "encoding/json" "fmt" "os" "sort" "strings" "text/template" ) // WaiterAcceptor is the acceptors defined in the model the SDK will use // to wait on resource states with. type WaiterAcceptor struct { State string Matcher string Argument string Expected in...
193
session-manager-plugin
aws
Go
// Package service contains automatically generated AWS clients. package service //go:generate go run -tags codegen ../../../cli/gen-api/main.go -path=../service -svc-import-path "github.com/aws/aws-sdk-go/private/model/api/codegentest/service" ../models/*/*/api-2.json //go:generate gofmt -s -w ../service
6
session-manager-plugin
aws
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package awsendpointdiscoverytest import ( "fmt" "net/url" "strings" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/crr" "github.com/aws/aws-sdk-go/aws/request" ) const opDescri...
663
session-manager-plugin
aws
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package awsendpointdiscoverytest provides the client and types for making API // requests to AwsEndpointDiscoveryTest. // // See awsendpointdiscoverytest package documentation for more information. // https://docs.aws.amazon.com/sdk-for-go/api/ser...
25
session-manager-plugin
aws
Go
// +build go1.7 package awsendpointdiscoverytest import ( "strconv" "strings" "sync" "sync/atomic" "testing" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/awstesting/unit" ) func TestEndpointDiscoveryWith...
337
session-manager-plugin
aws
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package awsendpointdiscoverytest import ( "github.com/aws/aws-sdk-go/private/protocol" ) var exceptionFromCode = map[string]func(protocol.ResponseMetadata) error{}
10
session-manager-plugin
aws
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package awsendpointdiscoverytest import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/crr" "github.com/aws/aws-sdk-go/aws/request" "githu...
107
session-manager-plugin
aws
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package awsendpointdiscoverytestiface provides an interface to enable mocking the AwsEndpointDiscoveryTest service client // for testing your code. // // It is important to note that this interface will have breaking changes // when the service mo...
81
session-manager-plugin
aws
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package restjsonservice import ( "bytes" "fmt" "io" "sync" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sd...
1,675
session-manager-plugin
aws
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package restjsonservice provides the client and types for making API // requests to REST JSON Service. // // See https://docs.aws.amazon.com/goto/WebAPI/RESTJSONService-0000-00-00 for more information on this service. // // See restjsonservice pac...
27
session-manager-plugin
aws
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package restjsonservice import ( "github.com/aws/aws-sdk-go/private/protocol" ) const ( // ErrCodeExceptionEvent for service response error code // "ExceptionEvent". ErrCodeExceptionEvent = "ExceptionEvent" // ErrCodeExceptionEvent2 for serv...
24
session-manager-plugin
aws
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // +build go1.15 package restjsonservice import ( "bytes" "context" "io/ioutil" "net/http" "reflect" "strings" "sync" "testing" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aw...
673
session-manager-plugin
aws
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package restjsonservice import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/signer/v4" "github.c...
105
session-manager-plugin
aws
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package restjsonserviceiface provides an interface to enable mocking the REST JSON Service service client // for testing your code. // // It is important to note that this interface will have breaking changes // when the service model is updated a...
77
session-manager-plugin
aws
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package restxmlservice import ( "bytes" "fmt" "io" "sync" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk...
1,675
session-manager-plugin
aws
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package restxmlservice provides the client and types for making API // requests to REST XML Service. // // See https://docs.aws.amazon.com/goto/WebAPI/RESTXMLService-0000-00-00 for more information on this service. // // See restxmlservice package...
27
session-manager-plugin
aws
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package restxmlservice const ( // ErrCodeExceptionEvent for service response error code // "ExceptionEvent". ErrCodeExceptionEvent = "ExceptionEvent" // ErrCodeExceptionEvent2 for service response error code // "ExceptionEvent2". ErrCodeExce...
15
session-manager-plugin
aws
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // +build go1.15 package restxmlservice import ( "bytes" "context" "io/ioutil" "net/http" "reflect" "strings" "sync" "testing" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws...
673
session-manager-plugin
aws
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package restxmlservice import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/signer/v4" "github.co...
102
session-manager-plugin
aws
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package restxmlserviceiface provides an interface to enable mocking the REST XML Service service client // for testing your code. // // It is important to note that this interface will have breaking changes // when the service model is updated and...
77
session-manager-plugin
aws
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package rpcservice import ( "bytes" "fmt" "io" "sync" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/awsutil" "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/...
1,819
session-manager-plugin
aws
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package rpcservice provides the client and types for making API // requests to RPC Service. // // See https://docs.aws.amazon.com/goto/WebAPI/RPCService-0000-00-00 for more information on this service. // // See rpcservice package documentation fo...
27
session-manager-plugin
aws
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package rpcservice import ( "github.com/aws/aws-sdk-go/private/protocol" ) const ( // ErrCodeExceptionEvent for service response error code // "ExceptionEvent". ErrCodeExceptionEvent = "ExceptionEvent" // ErrCodeExceptionEvent2 for service r...
24
session-manager-plugin
aws
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // +build go1.15 package rpcservice import ( "bytes" "context" "io/ioutil" "net/http" "reflect" "strings" "sync" "testing" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/cor...
729
session-manager-plugin
aws
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. package rpcservice import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/signer/v4" "github.com/aw...
107
session-manager-plugin
aws
Go
// Code generated by private/model/cli/gen-api/main.go. DO NOT EDIT. // Package rpcserviceiface provides an interface to enable mocking the RPC Service service client // for testing your code. // // It is important to note that this interface will have breaking changes // when the service model is updated and adds new...
77
session-manager-plugin
aws
Go
// +build codegen package main import ( "fmt" "os" "path/filepath" "sort" "github.com/aws/aws-sdk-go/private/model/api" ) func main() { dir, _ := os.Open(filepath.Join("models", "apis")) names, _ := dir.Readdirnames(0) for _, name := range names { m, _ := filepath.Glob(filepath.Join("models", "apis", name...
30
session-manager-plugin
aws
Go
// +build codegen package main import ( "fmt" "os" "path/filepath" "github.com/aws/aws-sdk-go/private/model/api" ) func main() { glob := filepath.FromSlash(os.Args[1]) modelPaths, err := api.ExpandModelGlobPath(glob) if err != nil { fmt.Fprintf(os.Stderr, "failed to expand glob, %v\n", err) os.Exit(1) }...
29
session-manager-plugin
aws
Go
// +build codegen // Command aws-gen-gocli parses a JSON description of an AWS API and generates a // Go file containing a client for the API. // // aws-gen-gocli apis/s3/2006-03-03/api-2.json package main import ( "flag" "fmt" "io/ioutil" "os" "path/filepath" "runtime/debug" "strings" "sync" "github.co...
319
session-manager-plugin
aws
Go
// +build codegen // Command gen-endpoints parses a JSON description of the AWS endpoint // discovery logic and generates a Go file which returns an endpoint. // // aws-gen-goendpoints apis/_endpoints.json aws/endpoints_map.go package main import ( "flag" "fmt" "os" "github.com/aws/aws-sdk-go/aws/endpoints" ...
59
session-manager-plugin
aws
Go
// +build codegen package main import ( "bytes" "encoding/json" "fmt" "net/url" "os" "os/exec" "reflect" "regexp" "sort" "strconv" "strings" "text/template" "github.com/aws/aws-sdk-go/private/model/api" "github.com/aws/aws-sdk-go/private/util" ) // TestSuiteTypeInput input test // TestSuiteTypeInput o...
566
session-manager-plugin
aws
Go
package protocol import ( "github.com/aws/aws-sdk-go/aws/request" "net" "strconv" "strings" ) // ValidateEndpointHostHandler is a request handler that will validate the // request endpoint's hosts is a valid RFC 3986 host. var ValidateEndpointHostHandler = request.NamedHandler{ Name: "awssdk.protocol.ValidateEnd...
105
session-manager-plugin
aws
Go
package protocol import ( "strings" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/request" ) // HostPrefixHandlerName is the handler name for the host prefix request // handler. const HostPrefixHandlerName = "awssdk.endpoint.HostPrefixHandler" // NewHostPrefixHandler constructs a build handler f...
55
session-manager-plugin
aws
Go
// +build go1.7 package protocol import ( "net/http" "net/url" "testing" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/request" ) func TestHostPrefixBuilder(t *testing.T) { cases := map[string]struct { URLHost string ReqHost string Prefix string LabelsFn func() map[string]string ...
111
session-manager-plugin
aws
Go
// +build go1.7 package protocol import ( "strconv" "testing" ) func TestValidPortNumber(t *testing.T) { cases := []struct { Input string Valid bool }{ {Input: "123", Valid: true}, {Input: "123.0", Valid: false}, {Input: "-123", Valid: false}, {Input: "65536", Valid: false}, {Input: "0", Valid: tru...
90
session-manager-plugin
aws
Go
package protocol import ( "crypto/rand" "fmt" "reflect" ) // RandReader is the random reader the protocol package will use to read // random bytes from. This is exported for testing, and should not be used. var RandReader = rand.Reader const idempotencyTokenFillTag = `idempotencyToken` // CanSetIdempotencyToken ...
76
session-manager-plugin
aws
Go
package protocol_test import ( "reflect" "testing" "github.com/aws/aws-sdk-go/private/protocol" ) func TestCanSetIdempotencyToken(t *testing.T) { cases := []struct { CanSet bool Case interface{} }{ { true, struct { Field *string `idempotencyToken:"true"` }{}, }, { true, struct { ...
114
session-manager-plugin
aws
Go
package protocol import ( "encoding/base64" "encoding/json" "fmt" "strconv" "github.com/aws/aws-sdk-go/aws" ) // EscapeMode is the mode that should be use for escaping a value type EscapeMode uint // The modes for escaping a value before it is marshaled, and unmarshaled. const ( NoEscape EscapeMode = iota Ba...
77
session-manager-plugin
aws
Go
package protocol import ( "fmt" "reflect" "strings" "testing" "github.com/aws/aws-sdk-go/aws" ) var testJSONValueCases = []struct { Value aws.JSONValue Mode EscapeMode String string }{ { Value: aws.JSONValue{ "abc": 123., }, Mode: NoEscape, String: `{"abc":123}`, }, { Value: aws.JSONValu...
94
session-manager-plugin
aws
Go
package protocol import ( "io" "io/ioutil" "net/http" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" ) // PayloadUnmarshaler provides the interface for unmarshaling a payload's // reader into a SDK shape. type PayloadUnmarshaler interface...
82
session-manager-plugin
aws
Go
package protocol import ( "fmt" "strings" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/request" ) // RequireHTTPMinProtocol request handler is used to enforce that // the target endpoint supports the given major and minor HTTP protocol version. type RequireHTTPMinProtocol struct { Major...
50
session-manager-plugin
aws
Go
// +build go1.7 package protocol import ( "net/http" "strings" "testing" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/request" ) func TestRequireHTTPMinProtocol(t *testing.T) { cases := map[string]struct { Major, Minor int Response *http.Response Err string }{ "H...
73
session-manager-plugin
aws
Go
package protocol_test import ( "net/http" "net/url" "testing" "github.com/aws/aws-sdk-go/aws/client/metadata" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/awstesting" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/ec2query" "github.com/aws/aws-s...
210
session-manager-plugin
aws
Go
package protocol import ( "bytes" "fmt" "math" "strconv" "time" "github.com/aws/aws-sdk-go/internal/sdkmath" ) // Names of time formats supported by the SDK const ( RFC822TimeFormatName = "rfc822" ISO8601TimeFormatName = "iso8601" UnixTimeFormatName = "unixTimestamp" ) // Time formats supported by the ...
133
session-manager-plugin
aws
Go
// +build go1.7 package protocol import ( "testing" "time" ) func TestFormatTime(t *testing.T) { cases := map[string]struct { formatName string expectedOutput string input time.Time }{ "UnixTest1": { formatName: UnixTimeFormatName, expectedOutput: "946845296", input: ti...
137
session-manager-plugin
aws
Go
package protocol import ( "io" "io/ioutil" "github.com/aws/aws-sdk-go/aws/request" ) // UnmarshalDiscardBodyHandler is a named request handler to empty and close a response's body var UnmarshalDiscardBodyHandler = request.NamedHandler{Name: "awssdk.shared.UnmarshalDiscardBody", Fn: UnmarshalDiscardBody} // Unmar...
28
session-manager-plugin
aws
Go
package protocol import ( "net/http" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/request" ) // UnmarshalErrorHandler provides unmarshaling errors API response errors for // both typed and untyped errors. type UnmarshalErrorHandler struct { unmarshaler ErrorUnmarshaler } // ErrorUnmarsh...
66
session-manager-plugin
aws
Go
package protocol_test import ( "io/ioutil" "net/http" "strings" "testing" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/ec2query" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" "gi...
166
session-manager-plugin
aws
Go
// Package ec2query provides serialization of AWS EC2 requests and responses. package ec2query //go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/input/ec2.json build_test.go import ( "net/url" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-...
37
session-manager-plugin
aws
Go
// +build bench package ec2query_test import ( "testing" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/awstesting" "github.com/aws/aws-sdk-go/private/protocol/ec2query" "github.com/aws/aws-sdk-go/service/ec2" ) func BenchmarkEC2QueryBuild_Complex_ec2Authori...
86
session-manager-plugin
aws
Go
// Code generated by models/protocol_tests/generate.go. DO NOT EDIT. package ec2query_test import ( "bytes" "encoding/json" "encoding/xml" "fmt" "io" "io/ioutil" "net/http" "net/url" "reflect" "testing" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sd...
2,497
session-manager-plugin
aws
Go
package ec2query //go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/output/ec2.json unmarshal_test.go import ( "encoding/xml" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol/xml...
78
session-manager-plugin
aws
Go
// +build go1.8 package ec2query import ( "io/ioutil" "net/http" "strings" "testing" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/request" ) func TestUnmarshalError(t *testing.T) { cases := map[string]struct { Request *request.Request Code, Msg string ReqID string Statu...
83
session-manager-plugin
aws
Go
// Code generated by models/protocol_tests/generate.go. DO NOT EDIT. package ec2query_test import ( "bytes" "encoding/json" "encoding/xml" "fmt" "io" "io/ioutil" "net/http" "net/url" "reflect" "testing" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sd...
2,149
session-manager-plugin
aws
Go
package eventstream import ( "bytes" "encoding/base64" "encoding/json" "fmt" "strconv" ) type decodedMessage struct { rawMessage Headers decodedHeaders `json:"headers"` } type jsonMessage struct { Length json.Number `json:"total_length"` HeadersLen json.Number `json:"headers_length"` PreludeCRC js...
145
session-manager-plugin
aws
Go
package eventstream import ( "bytes" "encoding/binary" "encoding/hex" "encoding/json" "fmt" "hash" "hash/crc32" "io" "github.com/aws/aws-sdk-go/aws" ) // Decoder provides decoding of an Event Stream messages. type Decoder struct { r io.Reader logger aws.Logger } // NewDecoder initializes and returns...
217
session-manager-plugin
aws
Go
package eventstream import ( "bytes" "encoding/hex" "io/ioutil" "os" "reflect" "testing" ) func TestWriteEncodedFromDecoded(t *testing.T) { cases, err := readPositiveTests("testdata") if err != nil { t.Fatalf("failed to load positive tests, %v", err) } for _, c := range cases { f, err := ioutil.TempFil...
175
session-manager-plugin
aws
Go
package eventstream import ( "bytes" "encoding/binary" "encoding/hex" "encoding/json" "fmt" "hash" "hash/crc32" "io" "github.com/aws/aws-sdk-go/aws" ) // Encoder provides EventStream message encoding. type Encoder struct { w io.Writer logger aws.Logger headersBuf *bytes.Buffer } // NewEncoder init...
163
session-manager-plugin
aws
Go
package eventstream import ( "bytes" "encoding/hex" "reflect" "testing" ) func TestEncoder_Encode(t *testing.T) { cases, err := readPositiveTests("testdata") if err != nil { t.Fatalf("failed to load positive tests, %v", err) } for _, c := range cases { var w bytes.Buffer encoder := NewEncoder(&w) er...
51
session-manager-plugin
aws
Go
package eventstream import "fmt" // LengthError provides the error for items being larger than a maximum length. type LengthError struct { Part string Want int Have int Value interface{} } func (e LengthError) Error() string { return fmt.Sprintf("%s length invalid, %d/%d, %v", e.Part, e.Want, e.Have, e.Val...
24
session-manager-plugin
aws
Go
package eventstream import ( "encoding/binary" "fmt" "io" ) // Headers are a collection of EventStream header values. type Headers []Header // Header is a single EventStream Key Value header pair. type Header struct { Name string Value Value } // Set associates the name with a value. If the header name alread...
176
session-manager-plugin
aws
Go
package eventstream import ( "reflect" "testing" "time" ) func TestHeaders_Set(t *testing.T) { expect := Headers{ {Name: "ABC", Value: StringValue("123")}, {Name: "EFG", Value: TimestampValue(time.Time{})}, } var actual Headers actual.Set("ABC", Int32Value(123)) actual.Set("ABC", StringValue("123")) // r...
67
session-manager-plugin
aws
Go
package eventstream import ( "encoding/base64" "encoding/binary" "fmt" "io" "strconv" "time" ) const maxHeaderValueLen = 1<<15 - 1 // 2^15-1 or 32KB - 1 // valueType is the EventStream header value type. type valueType uint8 // Header value types const ( trueValueType valueType = iota falseValueType int8Va...
507
session-manager-plugin
aws
Go
package eventstream import ( "bytes" "encoding/binary" "io" "reflect" "testing" "time" ) func binWrite(v interface{}) []byte { var w bytes.Buffer binary.Write(&w, binary.BigEndian, v) return w.Bytes() } var testValueEncodingCases = []struct { Val Value Expect []byte Decode func(io.Reader) (Value, erro...
204
session-manager-plugin
aws
Go
package eventstream import ( "bytes" "encoding/binary" "hash/crc32" ) const preludeLen = 8 const preludeCRCLen = 4 const msgCRCLen = 4 const minMsgLen = preludeLen + preludeCRCLen + msgCRCLen const maxPayloadLen = 1024 * 1024 * 16 // 16MB const maxHeadersLen = 1024 * 128 // 128KB const maxMsgLen = minMsgLen ...
118
session-manager-plugin
aws
Go
package eventstream import ( "bufio" "bytes" "encoding/json" "fmt" "io/ioutil" "path/filepath" "testing" ) type testCase struct { Name string Encoded []byte Decoded decodedMessage } type testErrorCase struct { Name string Encoded []byte Err string } type rawTestCase struct { Name ...
153
session-manager-plugin
aws
Go
package eventstreamapi import ( "fmt" "sync" ) // InputWriterCloseErrorCode is used to denote an error occurred // while closing the event stream input writer. const InputWriterCloseErrorCode = "EventStreamInputWriterCloseError" type messageError struct { code string msg string } func (e messageError) Code() s...
82
session-manager-plugin
aws
Go
package eventstreamapi import ( "fmt" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/eventstream" ) // Unmarshaler provides the interface for unmarshaling a EventStream // message into a SDK type. type Unmarshaler interface { UnmarshalEvent(protocol.PayloadUnmarshaler, e...
174
session-manager-plugin
aws
Go
package eventstreamapi import ( "bytes" "fmt" "io" "testing" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/eventstream" "github.com/aws/aws-sdk-go/private/protocol/restjson" ) var eventMessageTypeHeader = eventstream.Header{ ...
260
session-manager-plugin
aws
Go
package eventstreamapi // EventStream headers with specific meaning to async API functionality. const ( ChunkSignatureHeader = `:chunk-signature` // chunk signature for message DateHeader = `:date` // Date header for signature // Message header and values MessageTypeHeader = `:message-type...
24
session-manager-plugin
aws
Go
package eventstreamapi import ( "bytes" "encoding/hex" "time" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/eventstream" ) type mockChunkSigner struct { signature string err error } func (m mockChunkSigner) GetSignature(_, _ []byte, _ time.Time) ([]byte, error...
65
session-manager-plugin
aws
Go
package eventstreamapi import ( "bytes" "strings" "time" "github.com/aws/aws-sdk-go/private/protocol/eventstream" ) var timeNow = time.Now // StreamSigner defines an interface for the implementation of signing of event stream payloads type StreamSigner interface { GetSignature(headers, payload []byte, date tim...
124
session-manager-plugin
aws
Go
// +build go1.7 package eventstreamapi import ( "bytes" "encoding/base64" "encoding/hex" "fmt" "strings" "testing" "time" "github.com/aws/aws-sdk-go/private/protocol/eventstream" "github.com/aws/aws-sdk-go/private/protocol/eventstream/eventstreamtest" ) func TestSignEncoder(t *testing.T) { currentTime := ...
129
session-manager-plugin
aws
Go
package eventstreamapi import ( "fmt" "io" "sync" "github.com/aws/aws-sdk-go/aws" ) // StreamWriter provides concurrent safe writing to an event stream. type StreamWriter struct { eventWriter *EventWriter stream chan eventWriteAsyncReport done chan struct{} closeOnce sync.Once err *OnceErro...
130
session-manager-plugin
aws
Go
package eventstreamapi import ( "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/eventstream" ) // Marshaler provides a marshaling interface for event types to event stream // messages. type Marshaler interface { MarshalEvent(protocol.PayloadMarshaler) (eventstream.Message, ...
64
session-manager-plugin
aws
Go
// +build go1.7 package eventstreamapi import ( "bytes" "encoding/base64" "encoding/hex" "testing" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/eventstream" "github.com/aws/aws-sdk-go/...
162
session-manager-plugin
aws
Go
// +build !go1.10 package eventstreamtest import ( "net/http" "net/http/httptest" ) // /x/net/http2 is only available for the latest two versions of Go. Any Go // version older than that cannot use the utility to configure the http2 // server. func setupServer(server *httptest.Server, useH2 bool) *http.Client { s...
18
session-manager-plugin
aws
Go
// +build go1.15 package eventstreamtest import ( "crypto/tls" "net/http" "net/http/httptest" "golang.org/x/net/http2" ) // /x/net/http2 is only available for the latest two versions of Go. Any Go // version older than that cannot use the utility to configure the http2 // server. func setupServer(server *httpte...
41
session-manager-plugin
aws
Go
// +build go1.9 package eventstreamtest import "testing" var getHelper = func(t testing.TB) func() { return t.Helper }
10
session-manager-plugin
aws
Go
// +build !go1.9 package eventstreamtest import "testing" var getHelper = func(t testing.TB) func() { return nopHelper } func nopHelper() {}
12
session-manager-plugin
aws
Go
// +build go1.15 package eventstreamtest import ( "bytes" "context" "fmt" "io" "net/http" "net/http/httptest" "reflect" "strings" "sync" "testing" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/awstesting/unit" "github.com/aws/aws-sdk-go/priva...
268
session-manager-plugin
aws
Go
// +build go1.7 package eventstreamtest import ( "bytes" "encoding/base64" "encoding/json" "fmt" "testing" "github.com/aws/aws-sdk-go/private/protocol/eventstream" ) // AssertMessageEqual compares to event stream messages, and determines if they // are equal. Will trigger an testing Error if components of the...
64
session-manager-plugin
aws
Go
// Package jsonutil provides JSON serialization of AWS requests and responses. package jsonutil import ( "bytes" "encoding/base64" "encoding/json" "fmt" "math" "reflect" "sort" "strconv" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/private/protocol" ) var timeType = reflect.ValueOf(ti...
297
session-manager-plugin
aws
Go
package jsonutil_test import ( "encoding/json" "strings" "testing" "time" "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil" ) func S(s string) *string { return &s } func D(s int64) *int64 { return &s } func F(s float64) *float64 { return &s } func T(s time.Time) *time.Time { return &s } type J ...
118
session-manager-plugin
aws
Go
package jsonutil import ( "bytes" "encoding/base64" "encoding/json" "fmt" "io" "math/big" "reflect" "strings" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/private/protocol" ) var millisecondsFloat = new(big.Float).SetInt64(1e3) // UnmarshalJSON...
305
session-manager-plugin
aws
Go
// +build go1.7 package jsonutil_test import ( "bytes" "reflect" "testing" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil" ) func TestUnmarshalJSON_JSONNumber(t *testing.T) { type input struct { TimeField *time.Time `locationName:"timeField"` IntField ...
122
session-manager-plugin
aws
Go
// +build bench package jsonrpc_test import ( "bytes" "encoding/json" "testing" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/awstesting" "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil" "github.com/aws/aws-sdk-go/private/protocol/jsonrpc" "gith...
72
session-manager-plugin
aws
Go
// Code generated by models/protocol_tests/generate.go. DO NOT EDIT. package jsonrpc_test import ( "bytes" "encoding/json" "encoding/xml" "fmt" "io" "io/ioutil" "net/http" "net/url" "reflect" "testing" "time" "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/client" "github.com/aws/aws-sdk...
2,934
session-manager-plugin
aws
Go
// Package jsonrpc provides JSON RPC utilities for serialization of AWS // requests and responses. package jsonrpc //go:generate go run -tags codegen ../../../private/model/cli/gen-protocol-tests ../../../models/protocol_tests/input/json.json build_test.go //go:generate go run -tags codegen ../../../private/model/cli/...
89
session-manager-plugin
aws
Go
package jsonrpc import ( "bytes" "io" "io/ioutil" "net/http" "strings" "github.com/aws/aws-sdk-go/aws/awserr" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/private/protocol" "github.com/aws/aws-sdk-go/private/protocol/json/jsonutil" ) // UnmarshalTypedError provides unmarshaling errors ...
108