Documentation
¶
Overview ¶
Package managed routes an immutable source stream through independent customer lanes configured by operator-owned files.
Index ¶
- type Capability
- type Counters
- type CredentialRef
- type Customer
- type CustomerRef
- type CustomerStatus
- type Destination
- type DestinationStatus
- type Manifest
- type Options
- type ReloadResult
- type Router
- func (r *Router) Handler(token string, source func() string) (http.Handler, error)
- func (r *Router) ReloadAll(ctx context.Context, generation uint64) (ReloadResult, error)
- func (r *Router) ReloadCustomer(ctx context.Context, id string, revision uint64) (ReloadResult, error)
- func (r *Router) Role() plugin.PluginType
- func (r *Router) StartContext(ctx context.Context) error
- func (r *Router) Status() Status
- func (r *Router) Stop() error
- type Rule
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Capability ¶
type Capability struct {
Plugin string `json:"plugin"`
Enabled bool `json:"enabled"`
Reason string `json:"reason"`
}
Capability explains whether a registered output can be routed safely.
func Capabilities ¶
func Capabilities() []Capability
Capabilities returns an explicit disposition for every registered output.
type Counters ¶
type Counters struct {
InputDropped uint64 `json:"input_dropped"`
Matched uint64 `json:"matched"`
DestinationDropped uint64 `json:"destination_dropped"`
SubmittedToPlugin uint64 `json:"submitted_to_plugin"`
PluginErrors uint64 `json:"plugin_errors"`
UnknownOutcomes uint64 `json:"unknown_outcomes"`
Canceled uint64 `json:"canceled"`
DiagnosticDropped uint64 `json:"diagnostic_dropped"`
}
Counters distinguish admission, rule matches, plugin submission and loss.
type CredentialRef ¶
CredentialRef binds an immutable credential version to its customer.
type Customer ¶
type Customer struct {
ID string `json:"id"`
Revision uint64 `json:"revision"`
Destinations []Destination `json:"destinations"`
Filters []Rule `json:"filters"`
}
Customer contains filters and destinations owned by a single customer.
type CustomerRef ¶
type CustomerRef struct {
ID string `json:"id"`
Revision uint64 `json:"revision"`
File string `json:"file"`
}
CustomerRef identifies one versioned customer file inside ConfigDir.
type CustomerStatus ¶
type CustomerStatus struct {
Cutover uint64 `json:"cutover_occurrence_id"`
Revision uint64 `json:"revision"`
InputQueued int `json:"input_queued"`
Counters Counters `json:"counters"`
Destinations map[string]DestinationStatus `json:"destinations"`
}
CustomerStatus exposes only opaque configuration identities and counters.
type Destination ¶
type Destination struct {
ID string `json:"id"`
Plugin string `json:"plugin"`
Options map[string]string `json:"options,omitempty"`
Credentials map[string]CredentialRef `json:"credentials,omitempty"`
LimitGroup string `json:"limit_group,omitempty"`
IntervalMS int `json:"interval_ms,omitempty"`
}
Destination selects a registered plugin and versioned secret bindings.
type DestinationStatus ¶
type DestinationStatus struct {
State string `json:"state"`
Queued int `json:"queued"`
LimitGroup string `json:"limit_group,omitempty"`
Counters Counters `json:"counters"`
}
DestinationStatus distinguishes pending work from degraded plugin state.
type Manifest ¶
type Manifest struct {
Generation uint64 `json:"generation"`
Customers []CustomerRef `json:"customers"`
}
Manifest is published last, after complete customer and credential files.
type Options ¶
type Options struct {
MaxQueueRetainedSize int64
ConfigDir string
CredentialsDir string
LogDir string
AllowedHosts []string
AllowLocalTargets bool
Logger *slog.Logger
MaxCustomers int
MaxRules int
MaxDestinations int
InputQueue int
DestinationQueue int
MaxInstances int
MaxFileSize int64
MaxEventSize int64
MaxRetainedSize int64
ReloadTimeout time.Duration
SendTimeout time.Duration
ShutdownTimeout time.Duration
}
Options sets operator policy independently of customer configuration.
type ReloadResult ¶
type ReloadResult struct {
Generation uint64 `json:"generation"`
Revisions map[string]uint64 `json:"revisions"`
Cutover uint64 `json:"cutover_occurrence_id"`
}
ReloadResult describes a configuration switch, not delivery or queue drainage.
type Router ¶
Router is an opt-in pipeline output. It owns nested output plugin instances.
func (*Router) Handler ¶
Handler exposes only authenticated configuration, health, and aggregate metrics. The owner must serve it on a private listener. Tokens are never logged.
func (*Router) ReloadAll ¶
ReloadAll applies an entire manifest generation at one dispatch boundary. Generation zero is reserved for initial startup.
func (*Router) ReloadCustomer ¶
func (r *Router) ReloadCustomer(ctx context.Context, id string, revision uint64) (ReloadResult, error)
ReloadCustomer changes only an existing customer and requires an unchanged roster.
func (*Router) Role ¶
func (r *Router) Role() plugin.PluginType
Role identifies the router as a pipeline output.
func (*Router) StartContext ¶
StartContext validates and applies the initial bundle before accepting events.
type Rule ¶
type Rule struct {
ID string `json:"id"`
EventType string `json:"event_type"`
Criteria cardano.Criteria `json:"criteria,omitempty"`
Destination string `json:"destination"`
}
Rule chooses all destinations or one destination ID for a canonical event type.
type Status ¶
type Status struct {
Ready bool `json:"ready"`
ObservedGeneration uint64 `json:"observed_generation"`
AppliedGeneration uint64 `json:"applied_generation"`
LastDispatched uint64 `json:"last_dispatched"`
ValidationError string `json:"validation_error,omitempty"`
Customers map[string]CustomerStatus `json:"customers"`
Counters Counters `json:"counters"`
RetainedSize int64 `json:"retained_size"`
PluginInstances int64 `json:"plugin_instances"`
Capabilities []Capability `json:"capabilities"`
}
Status reports the current applied configuration, never credential or payload data.