interfaces

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: Apache-2.0 Imports: 5 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BootstrapConfiguration

type BootstrapConfiguration struct {
	Clients     map[string]config.ClientInfo
	Service     config.ServiceInfo
	Registry    config.RegistryInfo
	Logging     config.LoggingInfo
	SecretStore config.SecretStoreInfo
	Startup     config.StartupInfo
}

BootstrapConfiguration defines the configuration elements required by the bootstrap.

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 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() BootstrapConfiguration

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

	// SetRegistryInfo updates the config.RegistryInfo field in the ConfigurationStruct.
	SetRegistryInfo(registryInfo config.RegistryInfo)
}

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.

Jump to

Keyboard shortcuts

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