sessions

package
v1.33.3 Latest Latest
Warning

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

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

Documentation

Overview

Package sessions provides functions that return AWS sessions to use in the AWS SDK.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AreCredsFromEnvVars

func AreCredsFromEnvVars(sess *session.Session) (bool, error)

AreCredsFromEnvVars returns true if the session's credentials provider is environment variables, false otherwise. An error is returned if the credentials are invalid or the request times out.

func Creds

func Creds(sess *session.Session) (credentials.Value, error)

Creds returns the credential values from a session.

func UserAgentExtras added in v1.16.0

func UserAgentExtras(extras ...string) func(*Provider)

UserAgentExtras augments a session provider with additional User-Agent extras.

Types

type Provider

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

Provider provides methods to create sessions. Once a session is created, it's cached locally so that the same session is not re-created.

func ImmutableProvider added in v1.16.0

func ImmutableProvider(options ...func(*Provider)) *Provider

ImmutableProvider returns an immutable session Provider with the options applied.

func (*Provider) Default

func (p *Provider) Default() (*session.Session, error)

Default returns a session configured against the "default" AWS profile. Default assumes that a region must be present with a session, otherwise it returns an error.

func (*Provider) DefaultWithRegion

func (p *Provider) DefaultWithRegion(region string) (*session.Session, error)

DefaultWithRegion returns a session configured against the "default" AWS profile and the input region.

func (*Provider) FromProfile

func (p *Provider) FromProfile(name string) (*session.Session, error)

FromProfile returns a session configured against the input profile name.

func (*Provider) FromRole

func (p *Provider) FromRole(roleARN string, region string) (*session.Session, error)

FromRole returns a session configured against the input role and region.

func (*Provider) FromStaticCreds

func (p *Provider) FromStaticCreds(accessKeyID, secretAccessKey, sessionToken string) (*session.Session, error)

FromStaticCreds returns a session from static credentials.

func (*Provider) UserAgentExtras added in v1.25.0

func (p *Provider) UserAgentExtras(extras ...string)

UserAgentExtras adds additional User-Agent extras to cached sessions and any new sessions.

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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