local

package
v1.2.20 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2024 License: Apache-2.0 Imports: 4 Imported by: 11

Documentation

Overview

Package local ...

Package local ...

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ZapError

func ZapError(err error) zapcore.Field

ZapError formats provider error messages in a useful way for logging, and performs the standard zap.Error on non provider errors

Types

type ContextCredentialsFactory

type ContextCredentialsFactory interface {
	// ForIaaSAPIKey returns a config using an explicit API key for an IaaS user account
	ForIaaSAPIKey(iamAccountID, iaasUserID, iaasAPIKey string, logger *zap.Logger) (provider.ContextCredentials, error)

	// ForIAMAPIKey returns a config derived from an IAM API key (if applicable)
	ForIAMAPIKey(iamAccountID, iamAPIKey string, logger *zap.Logger) (provider.ContextCredentials, error)

	// ForIAMAccessToken returns a config derived from an IAM API key (if applicable)
	ForIAMAccessToken(apiKey string, logger *zap.Logger) (provider.ContextCredentials, error)
}

ContextCredentialsFactory is a factory which can generate ContextCredentials instances

type Provider

type Provider interface {
	// OpenSession begins and initialises a new provider session.
	// The implementation can choose to verify the credentials and return an error if they are invalid.
	// Alternatively, the implementation can choose to defer credential verification until individual
	// methods of the context are called.
	OpenSession(context.Context, provider.ContextCredentials, *zap.Logger) (provider.Session, error)

	// Returns a configured ContextCredentialsFactory for this provider
	ContextCredentialsFactory(datacenter *string) (ContextCredentialsFactory, error)
}

Provider describes the contract that is implemented by an internal provider implementation

Directories

Path Synopsis
Code generated by counterfeiter.
Code generated by counterfeiter.

Jump to

Keyboard shortcuts

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