Documentation
¶
Index ¶
Constants ¶
const ( TargetTypeStdout = "stdout" TargetTypeNop = "nop" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry manages registered stream targets.
func (*Registry) All ¶
func (r *Registry) All() []corestream.Target
All returns all registered targets.
func (*Registry) Enabled ¶
func (r *Registry) Enabled() []corestream.Target
Enabled returns all enabled targets.
func (*Registry) Get ¶
func (r *Registry) Get(name string) (corestream.Target, bool)
Get retrieves a target by name.
func (*Registry) Register ¶
func (r *Registry) Register(target corestream.Target)
Register adds a target to the registry.
type SyncOption ¶ added in v0.3.2
type SyncOption func(*syncOptions)
SyncOption configures sync behavior.
func WithBatchSize ¶ added in v0.3.2
func WithBatchSize(size int) SyncOption
WithBatchSize sets the number of events and audits to fetch per iteration. A value of 0 uses the Syncer's default batch size.
func WithIterations ¶ added in v0.3.2
func WithIterations(n int) SyncOption
WithIterations sets the maximum number of batch iterations. A value of 0 means unlimited (drain all pending items).
func WithProgressCallback ¶ added in v0.3.2
func WithProgressCallback(fn func(SyncProgress)) SyncOption
WithProgressCallback sets a callback for progress updates.
type SyncProgress ¶ added in v0.3.2
SyncProgress reports progress during sync.
type SyncResult ¶
type SyncResult struct {
TargetResults []TargetSyncResult
}
SyncResult holds the overall result of a sync operation.
type Syncer ¶
type Syncer struct {
// contains filtered or unexported fields
}
Syncer orchestrates syncing events and self-audits to stream targets.
func (*Syncer) Sync ¶
func (s *Syncer) Sync(ctx context.Context, opts ...SyncOption) (*SyncResult, error)
Sync sends unsent events and self-audits to all enabled targets.