Struct: credentials.StaticProvider

import "../ibm-cos-sdk-go/aws/credentials"

Overview

A StaticProvider is a set of credentials which are set programmatically, and will never expire.

Implemented Interfaces

s3crypto.Cipher, credentials.Provider, s3manager.ReadSeekerWriteTo, s3manager.WriterReadFrom

Fields included from credentials.Value

credentials.Value.AccessKeyID, credentials.Value.ProviderName, credentials.Value.ProviderType, credentials.Value.SecretAccessKey, credentials.Value.ServiceInstanceID, credentials.Value.SessionToken

Method Summary collapse

Methods included from credentials.Value

credentials.Value.HasKeys()

Method Details

func (s *StaticProvider) IsExpired() bool

IsExpired returns if the credentials are expired.

For StaticProvider, the credentials never expired.



54
55
56
// File 'aws/credentials/static_provider.go', line 54

func (s *StaticProvider) IsExpired() bool { return false }

func (s *StaticProvider) Retrieve() (Value, error)

Retrieve returns the credentials or error if the credentials are invalid.



40
41
42
43
44
45
46
47
48
49
// File 'aws/credentials/static_provider.go', line 40

func (s *StaticProvider) Retrieve() (Value, error) { if s.AccessKeyID == "" || s.SecretAccessKey == "" { return Value{ProviderName: StaticProviderName}, ErrStaticCredentialsEmpty } if len(s.Value.ProviderName) == 0 { s.Value.ProviderName = StaticProviderName } return s.Value, nil }