localstorage

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterStorage

func RegisterStorage(name string, builder StorageBuilder)

func RunTest

func RunTest(t *testing.T, constructor func(t *testing.T) Storage)

Types

type AppCtx

type AppCtx struct {
	EnsureLoggedIn func(ctx context.Context) error
	Features       featurev1connect.FeatureServiceClient
}

type Cursor

type Cursor interface {
	IDs() (machineID, sessionID int64)
	Next(context.Context) bool
	Event(*typesv1.LogEvent) error
	Err() error
	Close() error
}

type Queryable

type Queryable interface {
	WatchLogQuery(context.Context, *typesv1.LogQuery) (<-chan Cursor, error)

	Query(ctx context.Context, q *typesv1.LogQuery, c *typesv1.Cursor, limit int) (*typesv1.Data, *typesv1.Cursor, error)
	ResolveQueryType(ctx context.Context, query *typesv1.LogQuery) (*typesv1.DataStreamType, error)
	ListSymbols(ctx context.Context, c *typesv1.Cursor, limit int) ([]*typesv1.Symbol, *typesv1.Cursor, error)
}

type Storage

type Storage interface {
	Queryable
	SinkFor(ctx context.Context, machineID, sessionID int64) (_ sink.Sink, heartbeatIn time.Duration, _ error)
	Heartbeat(ctx context.Context, machineID, sessionID int64) (time.Duration, error)
	Close() error
}

func Open

func Open(ctx context.Context, name string, ll *slog.Logger, cfg map[string]interface{}, app *AppCtx) (Storage, error)

type StorageBuilder

type StorageBuilder func(
	ctx context.Context,
	ll *slog.Logger,
	cfg map[string]interface{},
	app *AppCtx,
) (Storage, error)

type Symbol

type Symbol struct {
	Name string
	Type *typesv1.VarType
}

Jump to

Keyboard shortcuts

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