Help us shape the future of Go! Take the 2026 Go Developer Survey

dependencies

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: MIT Imports: 6 Imported by: 2

Documentation

Index

Constants

View Source
const InterpreterDepsKey = "interpreter"

Variables

This section is empty.

Functions

This section is empty.

Types

type Dependencies

type Dependencies struct {
	Deps Deps
}

Dependencies implemnents the Interface. Any deps which are nil will produce an explicit error.

func NewDefaults

func NewDefaults() Dependencies

NewDefaults produces a set of dependencies. Not all dependencies have valid defaults and will not be set.

func (Dependencies) HTTPClient

func (d Dependencies) HTTPClient() (*http.Client, error)

func (Dependencies) SecretService

func (d Dependencies) SecretService() (SecretService, error)

func (Dependencies) URLValidator

func (d Dependencies) URLValidator() (url.Validator, error)

type Deps

type Deps struct {
	HTTPClient    *http.Client
	SecretService SecretService
	URLValidator  url.Validator
}

type EnvironmentSecretService

type EnvironmentSecretService struct {
}

func (EnvironmentSecretService) LoadSecret

func (ess EnvironmentSecretService) LoadSecret(ctx context.Context, k string) (string, error)

type Interface

type Interface interface {
	HTTPClient() (*http.Client, error)
	SecretService() (SecretService, error)
	URLValidator() (url.Validator, error)
}

func NewEmpty

func NewEmpty() Interface

NewEmpty produces an empty set of dependencies. Accessing any dependency will result in an error.

type SecretService

type SecretService interface {
	// LoadSecret retrieves the secret value v found at key k given the calling context ctx.
	LoadSecret(ctx context.Context, k string) (string, error)
}

SecretService generalizes the process of looking up secrets based on a key.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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