Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfighubConnector ¶
type ConfighubConnector struct {
// contains filtered or unexported fields
}
func NewConnector ¶
func NewConnector(opts ConnectorOptions) (*ConfighubConnector, error)
NewConnector creates a new ConfighubConnector. WorkerID and WorkerSecret are required. The rest of the configuration is loaded from ConfigHub after the worker connects.
func (*ConfighubConnector) Start ¶
func (c *ConfighubConnector) Start() error
Start starts the worker. It opens a persistent connection to ConfigHub and starts performing work based on its configuration.
The worker long-polls the main API port; there is no separate worker port to discover.
type ConnectorOptions ¶
type ConnectorOptions struct {
WorkerID string
WorkerSecret string
ConfigHubURL string
FunctionExecutor executor.FunctionExecutor
}
type EventConsumer ¶ added in v0.1.95
type EventConsumer = lib.EventConsumer
EventConsumer re-exports lib.EventConsumer, the standalone event-log reader. It is separate from the worker connection: an event consumer authenticates as a worker identity but holds no lease and dequeues no operations.
func NewEventConsumer ¶ added in v0.1.95
func NewEventConsumer(serverURL, workerID, workerSecret string, subscription api.EventSubscription, handler EventHandler) *EventConsumer
NewEventConsumer creates a standalone event-log consumer for the given worker identity and one subscription (its Name is the cursor name). handler is invoked for each delivered fact. Call Run to start consuming; it blocks until its context is canceled. Run several consumers for several cursors.
type EventHandler ¶ added in v0.1.95
type EventHandler = lib.EventHandler
EventHandler re-exports lib.EventHandler so bot authors importing this package don't also have to import core/worker/lib to register an event callback.