managed

package
v0.47.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2026 License: Apache-2.0 Imports: 30 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package managed routes an immutable source stream through independent customer lanes configured by operator-owned files.

Index

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

type CredentialRef struct {
	File    string `json:"file"`
	Version uint64 `json:"version"`
}

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

type Router struct {
	plugin.Base
	// contains filtered or unexported fields
}

Router is an opt-in pipeline output. It owns nested output plugin instances.

func New

func New(options Options) (*Router, error)

New validates operator limits without reading configuration or starting workers.

func (*Router) Handler

func (r *Router) Handler(token string, source func() string) (http.Handler, error)

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

func (r *Router) ReloadAll(ctx context.Context, generation uint64) (ReloadResult, error)

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

func (r *Router) StartContext(ctx context.Context) error

StartContext validates and applies the initial bundle before accepting events.

func (*Router) Status

func (r *Router) Status() Status

Status returns a consistent configuration view with concurrent queue counters.

func (*Router) Stop

func (r *Router) Stop() error

Stop drains router-owned work for a bounded period, then cancels pending work. An error reports cleanup that still owns resources; restart waits for that cleanup.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL