Documentation ¶
Overview ¶
Package api defines RPC messages used to communicate with the runner module.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Amendment ¶
type Amendment struct { Bucket string `json:"bucket"` Time time.Time `json:"time"` Message string `json:"msg"` Replace []Replacement `json:"replace,omitempty"` }
type BucketMetadata ¶
type Config ¶
type Config struct { LogLevel *slog.Level `json:"log_level,omitempty"` AddSource *bool `json:"log_add_source,omitempty"` Options struct { DynamicLocation *bool `json:"dynamic_location,omitempty"` Web *Web `json:"web,omitempty"` // Database is the URL location of the worklog // database. When the scheme is sqlite, the location // is a directory relative to XDG_STATE_HOME as // URL opaque data. Database string `json:"database,omitempty"` Hostname string `json:"hostname,omitempty"` Heartbeat *rpc.Duration `json:"heartbeat,omitempty"` Rules map[string]Rule `json:"rules,omitempty"` } `json:"options,omitempty"` }
Config defines configuration options.
type DetailMapper ¶
DetailMapper is the report details interface.
type MapDetails ¶
MapDetails is a generic detailer. Type information may not be present so it is the CEL code's responsibility to ensure that values are converted to appropriate types.
func (MapDetails) DetailMap ¶
func (d MapDetails) DetailMap() map[string]any
type Replacement ¶
type Report ¶
type Report struct { Time time.Time `json:"time"` Period rpc.Duration `json:"period"` Details DetailMapper `json:"details"` }
func (*Report) UnmarshalJSON ¶
UnmarshalJSON unmarshals data into the receiver, detecting the type of the details. If the details field in data can be unmarshalled into a WatcherDetails, this type will be used, otherwise it will be unmarshalled into a MapDetailer.
type WatcherDetails ¶
WatcherDetails is a set of variables provided to rules from a watcher event message. Each field is provided to the CEL environment as a field of the global, curr, and the previous evaluation's values are available as fields of the global, last. See watcher.Details for the names used for fields in the CEL environment.
func (*WatcherDetails) DetailMap ¶
func (d *WatcherDetails) DetailMap() map[string]any
type Web ¶
type Web struct { // Addr is the dashboard and dump server address. Addr string `json:"addr"` // HTML is the path to custom HTML for dashboard rendering. HTML string `json:"html,omitempty"` // Rules is the set of transformation rules for rendering // events on a dashboard. The map keys are source bucket // and destination bucket. Rules map[string]map[string]WebRule `json:"rules,omitempty"` // AllowModification enables the amend and load endpoints // on the server, allowing direct modification of the // bucket contents. For this configuration to be effective // Addr must be a loopback device. AllowModification bool `json:"can_modify"` }