credentials

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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