Documentation ¶
Index ¶
- Constants
- Variables
- func AddComponent(ic inverse.Container, comp Component)
- func AddConfiguration(ic inverse.Container, component string, configuration map[string]string)
- func AddHealth(ic inverse.Container)
- func AddHttp(ic inverse.Container)
- func AddHttpConfig(ic inverse.Container, conf map[string]string)
- func AddHttpHandler(ic inverse.Container, ij inverse.Injector[http.Handler])
- func AddQualifiedRetry(ic inverse.Container, qualifier string)
- func AddRetry(ic inverse.Container)
- func AddService(ic inverse.Container, svc Service)
- func AlwaysTry(err error) bool
- func New(ic inverse.Container, ctx context.Context) (runtime.Runtime, error)
- type Channel
- type Component
- type Configuration
- type Health
- type Lifecycle
- type Loop
- type Retry
- type Runnable
- type Service
Constants ¶
View Source
const ( QualifierLifecycle = "lifecycle" QualifierRetry = "retry" QualifierHttpHandler = "http_handler" QualifierHealth = "health" )
View Source
const ( QualifierConfiguration = "configuration" QualifierService = "service" QualifierComponent = "component" )
View Source
const ( ConfHttpPort = "ConfHttpPort" ConfHttpReadTimeoutMillisecond = "ConfReadTimeoutMillisecond" ConfHttpWriteTimeoutMillisecond = "ConfWriteTimeoutMillisecond" ConfHttpTlsKeyPath = "ConfHttpTlsKeyPath" ConfHttpTlsCertPath = "ConfHttpTlsCertPath" )
View Source
const ( ConfRetryAttempts = "ConfRetryAttempts" ConfRetryDelayMillisecond = "ConfRetryDelayMillisecond" ConfRetryMaxDelayMillisecond = "ConfRetryMaxDelayMillisecond" ConfRetryMaxJitterMillisecond = "ConfRetryMaxJitterMillisecond" ConfRetryAbsorbError = "ConfRetryAbsorbError" )
View Source
const (
QualifierConfigPrefix = "config"
)
Variables ¶
View Source
var ( ErrHttpMissingServer = errors.New("http runtime no server provided") ErrHttpMissingHandler = errors.New("http runtime no handler provided") ErrHttpFailedToInitialiseTls = errors.New("http runtime failed to start tls") )
Errors
View Source
var ( ErrLoopRuntimeNoLoop = errors.New("functional runtime no loop function provided") ErrLoopRuntimeInitialise = errors.New("functional runtime initialise function failed") )
Errors
View Source
var ( ErrRunnerRuntimeNoRunnable = errors.New("runner runtime no runnable provided") ErrRunnerRuntimeRunnableStart = errors.New("runner runtime runnable failed to start") )
Errors
View Source
var (
ErrChannelRuntimeNoChannel = errors.New("functional runtime no Channel function provided")
)
Errors
View Source
var ErrConfigMissingTarget = errors.New("configuration target missing")
View Source
var (
ErrLifecycleStartError = errors.New("lifecycle start failed")
)
View Source
var ErrRetryStopped = errors.New("retry stopped")
Functions ¶
func AddComponent ¶ added in v0.2.11
func AddConfiguration ¶ added in v0.2.11
func AddHttpConfig ¶ added in v0.2.15
func AddHttpHandler ¶ added in v0.2.15
func AddQualifiedRetry ¶ added in v0.2.15
func AddService ¶ added in v0.2.11
Types ¶
type Component ¶
type Component interface { Name() string Register(context.Context, inverse.Container) error Resolve(context.Context, inverse.Container) error Clean() error }
lifecycle: register -> resolve -> clean
type Configuration ¶
type Configuration interface { Component Has(key string) bool Get() map[string]string GetString(key string, defaultValue string) string GetBool(key string, defaultValue bool) bool GetInt32(key string, defaultValue int32) int32 GetInt64(key string, defaultValue int64) int64 GetUint32(key string, defaultValue uint32) uint32 GetUint64(key string, defaultValue uint64) uint64 }
func EmptyConfig ¶
func EmptyConfig(component string) Configuration
type Health ¶
type Health interface { Component GetString() map[string]string SetString(component string, key string, value string) GetBool() map[string]bool SetBool(component string, key string, value bool) GetInt() map[string]int64 SetInt(component string, key string, value int64) IncInt(component string, key string, value int64) DecInt(component string, key string, value int64) }
type Retry ¶
func GetQualifiedRetry ¶ added in v0.2.15
Click to show internal directories.
Click to hide internal directories.