Help us shape the future of Go! Take the 2026 Go Developer Survey

localruntime

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2026 License: MIT Imports: 27 Imported by: 0

Documentation

Overview

Package localruntime composes command-owned acceptance, processing and queries. No listener, service discovery or detached process is required.

Index

Constants

This section is empty.

Variables

View Source
var ErrOwned = errors.New("database already owned; close the process using this database")
View Source
var ErrProcessingFailed = errors.New("processing_failed: saved usage needs attention; retry or run tokeninsights data reprocess")
View Source
var ErrProcessingTimeout = fmt.Errorf("processing_timeout: usage is still processing; retry or view saved data: %w", context.DeadlineExceeded)

Functions

func CaptureFixture

func CaptureFixture(ctx context.Context, collectorPath, dataPath, source string) error

CaptureFixture populates only the controlled development databases.

func PrepareFixture

func PrepareFixture(ctx context.Context, collectorPath, serverPath string) error

PrepareFixture resets only the two compatible development databases. Keep database/lock inodes, WAL sidecars and unrelated files, including old databases.

Types

type CollectionResult

type CollectionResult struct {
	Result collector.Result
	Err    error
}

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)

func (*Observer) Finish

func (o *Observer) Finish(result collector.Result, err error)

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 Open

func Open(ctx context.Context, collectorPath, dataPath string) (*Runtime, error)

func OpenWithApp

func OpenWithApp(ctx context.Context, collectorPath, dataPath, appPath string) (*Runtime, error)

func OpenWithAppOptions

func OpenWithAppOptions(ctx context.Context, collectorPath, dataPath, appPath string, options Options) (*Runtime, error)

func (*Runtime) Close

func (r *Runtime) Close() error

func (*Runtime) Observe

func (r *Runtime) Observe(ctx context.Context) *Observer

func (*Runtime) ProcessingStatus

func (r *Runtime) ProcessingStatus(ctx context.Context) (analytics.ProcessingStatus, error)

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.

func (*Runtime) WaitVisible

func (r *Runtime) WaitVisible(ctx context.Context) error

WaitVisible reads durable publication readiness, including interrupted generation recovery.

Jump to

Keyboard shortcuts

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