config

package
v0.0.7 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2023 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIProvider

type APIProvider interface {
	// contains filtered or unexported methods
}

APIProvider is an interface for retrieving an api.Provider

type Config

type Config struct {
	Credentials credentials.Provider
	API         api.Provider
}

Config provides the configuration for the service clients.

func LoadDefaultConfig

func LoadDefaultConfig(ctx context.Context, optFns ...func(*LoadOptions) error) (Config, error)

LoadDefaultConfig loads the default configuration for the service clients.

type CredentialsProvider

type CredentialsProvider interface {
	// contains filtered or unexported methods
}

CredentialsProvider is an interface for retrieving an credentials.Provider

type EnvConfig

type EnvConfig struct {
	Credentials credentials.Credentials
}

func NewEnvConfig

func NewEnvConfig() (EnvConfig, error)

type IConfig

type IConfig interface{}

IConfig is an interface that all external configuration values must satisfy.

type LoadOptions

type LoadOptions struct {
	Credentials credentials.Provider
	API         api.Provider
}

LoadOptions are discrete set of options that are valid for loading the configuration

type LoadOptionsFunc

type LoadOptionsFunc func(*LoadOptions) error

LoadOptionsFunc is a type alias for LoadOptions functional option

func WithAPI

func WithAPI(v api.Provider) LoadOptionsFunc

WithAPI is a functional option for setting the [LoadOptions.API]

func WithCredentials

func WithCredentials(v credentials.Provider) LoadOptionsFunc

WithCredentials is a functional option for setting the [LoadOptions.Credentials]

Jump to

Keyboard shortcuts

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