Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Event ¶
type Event interface {
Key() any
Value() any
Error() error
// Event can be emitted to a channel. Returns false if unable to do so
Emit(chan<- Event) bool
}
Event will emit key/value pairs or errors emited on a channel
type Provider ¶
type Provider interface {
Task
// Create a new task
New(ctx context.Context, config TaskPlugin) (Task, error)
}
Provider runs many tasks simultaneously
type Task ¶
type Task interface {
// Run is called to start the task and block until context is cancelled
Run(context.Context) error
// Sub returns a channel on which events can be received, or returns nil
// if the task does not emit events
Sub() <-chan Event
// Unsub is called to unsubscribe from an existing events channel
Unsub(<-chan Event)
}
Task runs a single task, whilst emitting events
type TaskPlugin ¶
type TaskPlugin interface {
Name() string // Return the name of the task
Label() string // Return the label of the task
// Return a new task. Label for the task can be retrieved from context
New(context.Context, Provider) (Task, error)
}
TaskPlugin provides methods to register a Task
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
server
command
|
|
|
pkg
|
|
|
config
Package config parses configuration files
|
Package config parses configuration files |
|
event
Package `event` provides events and subscriptions.
|
Package `event` provides events and subscriptions. |
|
fcgi
Package fcgi implements the FastCGI protocol.
|
Package fcgi implements the FastCGI protocol. |
|
hcl
hcl is a package to read HCL configuration files
|
hcl is a package to read HCL configuration files |
|
httpserver
httpserver package provides HTTP, HTTPS and FastCGI servers
|
httpserver package provides HTTP, HTTPS and FastCGI servers |
|
mdns
The mdns package listens and broadcasts for DNS packets
|
The mdns package listens and broadcasts for DNS packets |
|
mdns-discovery
mdns-discovery package parses DNS packets and emits discovery events
|
mdns-discovery package parses DNS packets and emits discovery events |
|
mdns-gateway
mdns-gateway package is an API for discovered network services
|
mdns-gateway package is an API for discovered network services |
|
nginx
nginx package tracks configurations allowed and enabled
|
nginx package tracks configurations allowed and enabled |
|
plugin
plugin package loads plugins and provides other plugin services
|
plugin package loads plugins and provides other plugin services |
|
provider
Package provider co-ordinates tasks and events for the lifecycle of the application.
|
Package provider co-ordinates tasks and events for the lifecycle of the application. |
|
router
router package provides a way to route HTTP paths to HTTP handlers
|
router package provides a way to route HTTP paths to HTTP handlers |
|
tokenauth
tokenauth package manages the authentication tokens
|
tokenauth package manages the authentication tokens |
|
tokenauth-gateway
tokenauth_gateway plugin is a gateway for token authentication.
|
tokenauth_gateway plugin is a gateway for token authentication. |
|
types
types package implements duration time
|
types package implements duration time |
|
httpserver
command
|
|
|
logger
command
|
|
|
mdns
command
|
|
|
router
command
|
|
|
tokenauth
command
|
Click to show internal directories.
Click to hide internal directories.