client

package
v1.17.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ServiceID = "endpoint-credentials"

ServiceID is the client identifer

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is an client for retrieving AWS credentials from an endpoint

func New

func New(options Options, optFns ...func(*Options)) *Client

New constructs a new Client from the given options

func (*Client) GetCredentials

func (c *Client) GetCredentials(ctx context.Context, params *GetCredentialsInput, optFns ...func(*Options)) (*GetCredentialsOutput, error)

GetCredentials retrieves credentials from credential endpoint

type EndpointError

type EndpointError struct {
	Code    string            `json:"code"`
	Message string            `json:"message"`
	Fault   smithy.ErrorFault `json:"-"`
	// contains filtered or unexported fields
}

EndpointError is an error returned from the endpoint service

func (*EndpointError) Error

func (e *EndpointError) Error() string

Error is the error mesage string

func (*EndpointError) ErrorCode

func (e *EndpointError) ErrorCode() string

ErrorCode is the error code returned by the endpoint

func (*EndpointError) ErrorFault

func (e *EndpointError) ErrorFault() smithy.ErrorFault

ErrorFault indicates error fault classification

func (*EndpointError) ErrorMessage

func (e *EndpointError) ErrorMessage() string

ErrorMessage is the error message returned by the endpoint

func (*EndpointError) HTTPStatusCode added in v1.16.4

func (e *EndpointError) HTTPStatusCode() int

HTTPStatusCode implements retry.HTTPStatusCode.

type GetCredentialsInput

type GetCredentialsInput struct {
	AuthorizationToken string
}

GetCredentialsInput is the input to send with the endpoint service to receive credentials.

type GetCredentialsOutput

type GetCredentialsOutput struct {
	Expiration      *time.Time
	AccessKeyID     string
	SecretAccessKey string
	Token           string
}

GetCredentialsOutput is the response from the credential endpoint

type HTTPClient

type HTTPClient interface {
	Do(*http.Request) (*http.Response, error)
}

HTTPClient is a client for sending HTTP requests

type Options

type Options struct {
	// The endpoint to retrieve credentials from
	Endpoint string

	// The HTTP client to invoke API calls with. Defaults to client's default HTTP
	// implementation if nil.
	HTTPClient HTTPClient

	// Retryer guides how HTTP requests should be retried in case of recoverable
	// failures. When nil the API client will use a default retryer.
	Retryer aws.Retryer

	// Set of options to modify how the credentials operation is invoked.
	APIOptions []func(*smithymiddleware.Stack) error
}

Options is the endpoint client configurable options

func (Options) Copy

func (o Options) Copy() Options

Copy creates a copy of the API options.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL