Documentation ¶
Index ¶
- Variables
- func ContextValueBool(ctx context.Context, name string) bool
- func ContextValueInt32(ctx context.Context, name string) int32
- func ContextValueInt64(ctx context.Context, name string) int64
- func ContextValueString(ctx context.Context, name string) string
- func ContextWithValueMap(ctx context.Context, valueMap map[string]any) context.Context
- func Error(err error)
- func QualifierConfig(q string) string
- func Start(runtimes []Runtime, sleepTime time.Duration) error
- func Stop()
- func Wait()
- type Configuration
- func HttpWithHandler(handler http.Handler) Configuration[*HttpRunnable]
- func HttpWithPort(port int) Configuration[*HttpRunnable]
- func HttpWithReadHeaderTimeout(timeout time.Duration) Configuration[*HttpRunnable]
- func HttpWithReadTimeout(timeout time.Duration) Configuration[*HttpRunnable]
- func HttpWithWriteTimeout(timeout time.Duration) Configuration[*HttpRunnable]
- type Constructor
- type ContextKey
- type HttpRunnable
- type Loop
- type LoopRunnable
- type Primary
- type Resolver
- type Runnable
- type Runner
- type Runtime
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrHttpMissingServer = errors.New("http runtime no server provided") ErrHttpMissingHandler = errors.New("http runtime no handler provided") )
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 (
ErrPrimaryInitialiseError = errors.New("primary runtime initialise function failed")
)
Errors
View Source
var NewHttp = ConstructorFor[*HttpRunnable, Runtime]( func() *HttpRunnable { return &HttpRunnable{ server: &http.Server{ Addr: ":8080", ReadTimeout: 5 * time.Second, WriteTimeout: 5 * time.Second, }, } }, func(hr *HttpRunnable) Runtime { return NewRunner(hr) }, )
constructor
Functions ¶
func ContextValueBool ¶ added in v0.0.23
func ContextValueInt32 ¶ added in v0.0.23
func ContextValueInt64 ¶ added in v0.0.23
func ContextValueString ¶ added in v0.0.23
func ContextWithValueMap ¶ added in v0.0.23
func QualifierConfig ¶ added in v0.0.29
Types ¶
type Configuration ¶
type Configuration[R any] func(R) R
func HttpWithHandler ¶
func HttpWithHandler(handler http.Handler) Configuration[*HttpRunnable]
configuration
func HttpWithPort ¶
func HttpWithPort(port int) Configuration[*HttpRunnable]
func HttpWithReadHeaderTimeout ¶
func HttpWithReadHeaderTimeout(timeout time.Duration) Configuration[*HttpRunnable]
func HttpWithReadTimeout ¶
func HttpWithReadTimeout(timeout time.Duration) Configuration[*HttpRunnable]
func HttpWithWriteTimeout ¶
func HttpWithWriteTimeout(timeout time.Duration) Configuration[*HttpRunnable]
type Constructor ¶ added in v0.0.19
type Constructor[R any, I any] func(...Configuration[R]) I
func ConstructorFor ¶ added in v0.0.28
func ConstructorFor[R any, I any](defaultValue func() R, casting func(R) I) Constructor[R, I]
type ContextKey ¶ added in v0.0.7
type ContextKey struct {
Name string
}
func Context ¶ added in v0.0.7
func Context(name string) ContextKey
type HttpRunnable ¶ added in v0.0.6
type HttpRunnable struct {
// contains filtered or unexported fields
}
implementation
func (*HttpRunnable) Run ¶ added in v0.0.6
func (c *HttpRunnable) Run() error
func (*HttpRunnable) Start ¶ added in v0.0.6
func (c *HttpRunnable) Start() error
func (*HttpRunnable) Stop ¶ added in v0.0.6
func (c *HttpRunnable) Stop()
type LoopRunnable ¶ added in v0.0.6
type LoopRunnable struct {
// contains filtered or unexported fields
}
implementation
func (*LoopRunnable) Run ¶ added in v0.0.6
func (r *LoopRunnable) Run() error
func (*LoopRunnable) Start ¶ added in v0.0.6
func (r *LoopRunnable) Start() error
func (*LoopRunnable) Stop ¶ added in v0.0.6
func (r *LoopRunnable) Stop()
type Resolver ¶ added in v0.0.29
type Resolver[T any] interface { AddConfig(inverse.Injector[Configuration[T]]) AddConfigVal(Configuration[T]) Register() }
func NewResolver ¶ added in v0.0.29
Click to show internal directories.
Click to hide internal directories.