Documentation ¶
Index ¶
- Variables
- type Configuration
- func ConnectorWithCleanup[C any](cleanup func(C)) Configuration[*Connector[C]]
- func ConnectorWithInitialise[C any](initialise func() (C, error)) Configuration[*Connector[C]]
- func FunctionalWithCleanup[C any](cleanup func(C)) Configuration[*Functional[C]]
- func FunctionalWithContext[C any](ctx context.Context) Configuration[*Functional[C]]
- func FunctionalWithInitialise[C any](initialise func() (C, error)) Configuration[*Functional[C]]
- func FunctionalWithLoop[C any](loop func(data C, ctx context.Context, cancel context.CancelFunc) error) Configuration[*Functional[C]]
- func HttpWithHandler(handler http.Handler) Configuration[*Http]
- func HttpWithPort(port int) Configuration[*Http]
- func HttpWithReadHeaderTimeout(timeout time.Duration) Configuration[*Http]
- func HttpWithReadTimeout(timeout time.Duration) Configuration[*Http]
- func HttpWithWriteTimeout(timeout time.Duration) Configuration[*Http]
- func PrimaryWithRuntime(runtime Runtime) Configuration[*Primary]
- type Connector
- type Controller
- type Functional
- type Http
- type Primary
- type Runtime
- type RuntimeController
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrFunctionalRuntimeNoLoop = errors.New("functional runtime no loop function provided") ErrFunctionalRuntimeInitialise = errors.New("functional runtime initialise function failed") )
Errors
View Source
var ( ErrPrimaryInitialiseError = errors.New("primary runtime initialise function failed") ErrPrimaryTesting = errors.New("primary runtime testing error") )
Errors
View Source
var (
ErrConnectorRuntimeInitialise = errors.New("connector runtime initialise function failed")
)
Errors
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration[R any] func(R) R
func ConnectorWithCleanup ¶ added in v0.0.5
func ConnectorWithCleanup[C any](cleanup func(C)) Configuration[*Connector[C]]
func ConnectorWithInitialise ¶ added in v0.0.5
func ConnectorWithInitialise[C any](initialise func() (C, error)) Configuration[*Connector[C]]
configuration
func FunctionalWithCleanup ¶
func FunctionalWithCleanup[C any](cleanup func(C)) Configuration[*Functional[C]]
func FunctionalWithContext ¶
func FunctionalWithContext[C any](ctx context.Context) Configuration[*Functional[C]]
func FunctionalWithInitialise ¶
func FunctionalWithInitialise[C any](initialise func() (C, error)) Configuration[*Functional[C]]
configuration
func FunctionalWithLoop ¶
func FunctionalWithLoop[C any](loop func(data C, ctx context.Context, cancel context.CancelFunc) error) Configuration[*Functional[C]]
func HttpWithHandler ¶
func HttpWithHandler(handler http.Handler) Configuration[*Http]
configuration
func HttpWithPort ¶
func HttpWithPort(port int) Configuration[*Http]
func HttpWithReadHeaderTimeout ¶
func HttpWithReadHeaderTimeout(timeout time.Duration) Configuration[*Http]
func HttpWithReadTimeout ¶
func HttpWithReadTimeout(timeout time.Duration) Configuration[*Http]
func HttpWithWriteTimeout ¶
func HttpWithWriteTimeout(timeout time.Duration) Configuration[*Http]
func PrimaryWithRuntime ¶
func PrimaryWithRuntime(runtime Runtime) Configuration[*Primary]
configuration
type Connector ¶ added in v0.0.5
type Connector[C any] struct { // contains filtered or unexported fields }
implementation
func ConnectorDefault ¶ added in v0.0.5
default
func (*Connector[C]) SetController ¶ added in v0.0.5
func (r *Connector[C]) SetController(controller Controller)
type Controller ¶
type Controller interface { Started() // denotes that a runtime element has started Stopped() // denotes that a runtime element has stopped Error(error) // denotes that a runtime element has errored Wait() }
func NewPrimaryController ¶
func NewPrimaryController() (Controller, chan error)
type Functional ¶
type Functional[C any] struct { // contains filtered or unexported fields }
implementation
func (*Functional[C]) Run ¶
func (r *Functional[C]) Run()
func (*Functional[C]) SetController ¶
func (r *Functional[C]) SetController(controller Controller)
func (*Functional[C]) Start ¶
func (r *Functional[C]) Start() error
func (*Functional[C]) Stop ¶
func (r *Functional[C]) Stop()
type Http ¶
type Http struct {
// contains filtered or unexported fields
}
implementation
func (*Http) SetController ¶
func (c *Http) SetController(controller Controller)
type Primary ¶
type Primary struct {
// contains filtered or unexported fields
}
implementation
func (*Primary) SetController ¶
func (r *Primary) SetController(controller Controller)
type Runtime ¶
type Runtime interface { Start() error Stop() SetController(Controller) }
func NewConnector ¶ added in v0.0.5
func NewConnector[C any](configurations ...Configuration[*Connector[C]]) Runtime
constructor
func NewFunctional ¶
func NewFunctional[C any](configurations ...Configuration[*Functional[C]]) Runtime
constructor
type RuntimeController ¶
type RuntimeController struct {
// contains filtered or unexported fields
}
func (*RuntimeController) Error ¶
func (c *RuntimeController) Error(err error)
func (*RuntimeController) Started ¶
func (c *RuntimeController) Started()
func (*RuntimeController) Stopped ¶
func (c *RuntimeController) Stopped()
func (*RuntimeController) Wait ¶
func (c *RuntimeController) Wait()
Click to show internal directories.
Click to hide internal directories.