Versions in this module Expand all Collapse all v0 v0.2.0 Jul 17, 2026 Changes in this version + var ErrUnclassified = errors.New("stage: unclassified") + type Cascade struct + func New(stages ...Stage) (*Cascade, error) + func NewWithOptions(options Options) (*Cascade, error) + func (c *Cascade) Classify(ctx context.Context, r Record) (Classification, error) + func (c *Cascade) ClassifyBatch(ctx context.Context, records []Record) []Result + func (c *Cascade) ClassifyBatchConcurrent(ctx context.Context, records []Record, workers int) []Result + type Classification struct + Category string + Confidence float64 + Reasons []Reason + Stage string + func (c Classification) IsValid() bool + type Gate struct + func NewGate(min float64) (Gate, error) + type Kind string + const KindEvent + const KindJSON + const KindLog + const KindRecord + const KindText + const KindUnknown + type Options struct + Logger *slog.Logger + MinConfidence float64 + Stages []Stage + type Reason struct + Code string + Detail string + type Record struct + Data []byte + Fields map[string]any + ID string + Kind Kind + Meta map[string]string + type Result struct + Classification Classification + Err error + type Stage interface + Classify func(ctx context.Context, r Record) (Classification, error) + Name func() string + func WithGate(inner Stage, gate Gate) Stage + func WithName(inner Stage, name string) Stage + type StageError struct + Err error + Stage string + func (e *StageError) Error() string + func (e *StageError) Unwrap() error