credential

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Println added in v0.4.0

func Println(credentials string)

Println prints a message to stdout if it is a terminal, otherwise it prints the credentials.

Types

type Credential

type Credential struct {
	AccessKeyID     *string
	Expiration      *time.Time
	AwsProfile      string
	SecretAccessKey *string
	SessionToken    *string
}

func New

func New(awsProfile string) *Credential

func (*Credential) IsExpired

func (c *Credential) IsExpired() bool

func (*Credential) Load

func (c *Credential) Load() error

func (*Credential) Output

func (c *Credential) Output() (string, error)

Output returns the credentials in JSON format. The JSON format is output in the JSON format specified in the aws cli. https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sourcing-external.html

func (*Credential) Save

func (c *Credential) Save() error

func (*Credential) SetAccessKeyID

func (c *Credential) SetAccessKeyID(accessKeyID *string)

func (*Credential) SetExpiration

func (c *Credential) SetExpiration(expiration *time.Time)

func (*Credential) SetSecretAccessKey

func (c *Credential) SetSecretAccessKey(secretAccessKey *string)

func (*Credential) SetSessionToken

func (c *Credential) SetSessionToken(sessionToken *string)

type Credentialer

type Credentialer interface {
	SetAccessKeyID(*string)
	SetExpiration(*time.Time)
	SetSecretAccessKey(*string)
	SetSessionToken(*string)
	Load() error
	IsExpired() bool
	Save() error
	Output() (string, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳