Documentation ¶
Overview ¶
Package runtime contains functionality for runtime information of a plugin.
Index ¶
Constants ¶
View Source
const ( // DefaultClusterID ... DefaultClusterID = "autobot" // DefaultClusterURL ... DefaultClusterURL = "nats://localhost:4222" // DefaultClusterInbox ... DefaultClusterInbox = "autobot.inbox" // DefaultClusterOutbox ... DefaultClusterOutbox = "autobot.outbox" // DefaultLogFormat ... DefaultLogFormat = "text" // DefaultLogLevel ... DefaultLogLevel = "warn" )
Variables ¶
View Source
var ( // ErrNoRuntimeFunc signals that no functions have been configured to be run ErrNoRuntimeFunc = errors.New("runtime: no runtime functions have been configured") )
Functions ¶
func OnInitialize ¶
func OnInitialize(y ...func())
OnInitialize sets the passed functions to be run when runtime is called for initialization.
Types ¶
type Environment ¶
type Environment struct { ClusterID string `mapstructure:"cluster_id"` ClusterURL string `mapstructure:"cluster_url"` Debug bool Inbox string LogFormat string `mapstructure:"log_format"` LogLevel string `mapstructure:"log_level"` Name string Outbox string Verbose bool }
Environment describes a runtime environment for a plugin. This contains information about the used NATS cluster, the cluster id and the topic for plugin discovery.
type Runtime ¶
type Runtime struct { Run func(*Environment) RunE func(*Environment) error }
Runtime is a plugin runtime that executes runtime functions
Click to show internal directories.
Click to hide internal directories.