Documentation
¶
Overview ¶
Package localruntime composes command-owned acceptance, processing and queries. No listener, service discovery or detached process is required.
Index ¶
- Variables
- func CaptureFixture(ctx context.Context, collectorPath, dataPath, source string) error
- func PrepareFixture(ctx context.Context, collectorPath, serverPath string) error
- type CollectionResult
- type Observer
- type Options
- type Runtime
- func (r *Runtime) Close() error
- func (r *Runtime) Observe(ctx context.Context) *Observer
- func (r *Runtime) ProcessingStatus(ctx context.Context) (analytics.ProcessingStatus, error)
- func (r *Runtime) StartCollection(ctx context.Context, options pipeline.SyncOptions, ...) <-chan CollectionResult
- func (r *Runtime) WaitVisible(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
var ErrOwned = errors.New("database already owned; close the process using this database")
var ErrProcessingFailed = errors.New("processing_failed: saved usage needs attention; retry or run tokeninsights data reprocess")
var ErrProcessingTimeout = fmt.Errorf("processing_timeout: usage is still processing; retry or view saved data: %w", context.DeadlineExceeded)
Functions ¶
func CaptureFixture ¶
CaptureFixture populates only the controlled development databases.
Types ¶
type CollectionResult ¶
CollectionResult reports capture/submission completion, not query visibility.
type Observer ¶
type Observer struct {
// contains filtered or unexported fields
}
Observer fans progress into an optional publisher. Failures cannot invalidate capture or delivery. Counts describe acknowledged work only.
func (*Observer) Collection ¶
func (o *Observer) Collection(event pipeline.SyncProgressEvent)
func (*Observer) Delivery ¶
func (o *Observer) Delivery(progress collector.DeliveryProgress)
type Options ¶
type Options struct {
CaptureDetails bool
}
Options selects command-owned local behavior at composition time. Only the TUI enables capture details; public progress retains its wire shape.
type Runtime ¶
type Runtime struct {
InstanceID string
Hostname string
Policy serverfeatures.Policy
Progress *collectorprogress.Registry
Store *datastore.Store
App *appstore.Store
Query *queryclient.Client
Destination *collector.Destination
// contains filtered or unexported fields
}
func OpenWithApp ¶
func OpenWithAppOptions ¶
func (*Runtime) ProcessingStatus ¶
ProcessingStatus describes durable readiness without waiting for publication.
func (*Runtime) StartCollection ¶
func (r *Runtime) StartCollection(ctx context.Context, options pipeline.SyncOptions, run func(context.Context, collector.Options) (collector.Result, error)) <-chan CollectionResult
StartCollection starts command-owned capture without blocking saved-data reads. The progress attempt is registered before return; Close cancels and joins it.