Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Credentials ¶
type Credentials struct {
// contains filtered or unexported fields
}
A Credentials provides concurrency safe retrieval of OpenSDS multi-cloud credentials Value.
func NewCredentials ¶
func NewCredentials(provider Provider) *Credentials
NewCredentials returns a pointer to a new Credentials with the provider set.
func (*Credentials) Get ¶
func (c *Credentials) Get() (Value, error)
Get returns the credentials value, or error on failed retrieval
type ErrorProvider ¶
type ErrorProvider struct {
// The error to be returned from Retrieve
Err error
// The provider name to set on the Retrieved returned Value
ProviderName string
}
An ErrorProvider is a credentials provider that always returns an error
func (ErrorProvider) Retrieve ¶
func (p ErrorProvider) Retrieve() (Value, error)
Retrieve will always return the error that the ErrorProvider was created with.
type Provider ¶
type Provider interface {
// Retrieve returns credential value if it successfully retrieved the value,
// otherwise returns Error.
Retrieve() (Value, error)
}
A Provider is the interface to provide credentials Value.
type Value ¶
type Value struct {
// OpenSDS multi-cloud Access key ID
AccessKeyID string
// OpenSDS multi-cloud Secret Access Key
SecretAccessKey string
// TenantID
TenantID string
// Tenant DisplayName
DisplayName string
// UserID
UserID string
// Provider used to get credentials
ProviderName string
}
A Value is the OpenSDS multi-cloud credentials value.
Click to show internal directories.
Click to hide internal directories.