interfaces

package
v0.0.72 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2021 License: Apache-2.0 Imports: 6 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BootstrapHandler

type BootstrapHandler func(
	ctx context.Context,
	wg *sync.WaitGroup,
	startupTimer startup.Timer,
	dic *di.Container) (success bool)

BootstrapHandler defines the contract each bootstrap handler must fulfill. Implementation returns true if the handler completed successfully, false if it did not.

type CertificateProvider added in v0.0.23

type CertificateProvider interface {
	// GetCertificateKeyPair retrieves certificate pair.
	GetCertificateKeyPair(path string) (config.CertKeyPair, error)
}

CertificateProvider interface provides an abstraction for obtaining certificate pair.

type Configuration

type Configuration interface {
	// UpdateFromRaw converts configuration received from the registry to a service-specific configuration struct which is
	// then used to overwrite the service's existing configuration struct.
	UpdateFromRaw(rawConfig interface{}) bool

	// EmptyWritablePtr returns a pointer to a service-specific empty WritableInfo struct.  It is used by the bootstrap to
	// provide the appropriate structure to registry.Client's WatchForChanges().
	EmptyWritablePtr() interface{}

	// UpdateWritableFromRaw converts configuration received from the registry to a service-specific WritableInfo struct
	// which is then used to overwrite the service's existing configuration's WritableInfo struct.
	UpdateWritableFromRaw(rawWritable interface{}) bool

	// GetBootstrap returns the configuration elements required by the bootstrap.
	GetBootstrap() config.BootstrapConfiguration

	// GetLogLevel returns the current ConfigurationStruct's log level.
	GetLogLevel() string

	// GetRegistryInfo gets the config.RegistryInfo field from the ConfigurationStruct.
	GetRegistryInfo() config.RegistryInfo

	// GetInsecureSecrets gets the config.InsecureSecrets field from the ConfigurationStruct.
	GetInsecureSecrets() config.InsecureSecrets
}

Configuration interface provides an abstraction around a configuration struct.

type CredentialsProvider

type CredentialsProvider interface {
	// GetDatabaseCredentials retrieves database credentials.
	GetDatabaseCredentials(database config.Database) (config.Credentials, error)
}

CredentialsProvider interface provides an abstraction for obtaining credentials.

type SecretProvider added in v0.0.62

type SecretProvider interface {
	// StoreSecrets stores new secrets into the service's SecretStore at the specified path.
	StoreSecrets(path string, secrets map[string]string) error

	// GetSecrets retrieves secrets from the service's SecretStore at the specified path.
	GetSecrets(path string, keys ...string) (map[string]string, error)

	// SecretsUpdated sets the secrets last updated time to current time.
	SecretsUpdated()

	// SecretsLastUpdated returns the last time secrets were updated
	SecretsLastUpdated() time.Time
}

SecretProvider defines the contract for secret provider implementations that allow secrets to be retrieved/stored from/to a services Secret Store.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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