localstorage

package
v0.8.9 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ServiceName = "antoine's service"
	TestRes     = typesv1.NewResource("res_schema_url", []*typesv1.KV{
		typesv1.KeyVal(string(semconv.ServiceNameKey), typesv1.ValStr(ServiceName)),
	})
	TestScope = typesv1.NewScope("scope_schema_url", "test-scope", "v0.0.0-test", []*typesv1.KV{
		typesv1.KeyVal("component", typesv1.ValStr("database")),
	})
)

Functions

func RegisterStorage

func RegisterStorage(name string, builder StorageBuilder)

func RunTest

func RunTest(t *testing.T, constructor func(t *testing.T, timeNow func() time.Time, newUlid func() *typesv1.ULID) Storage)

Types

type Alertable added in v0.8.8

type Alertable interface {
	AlertGetOrCreate(ctx context.Context, stackName, groupName, alertName string, create func() *typesv1.AlertState) (*typesv1.AlertState, error)
	AlertUpdateState(ctx context.Context, stackName, groupName, alertName string, state *typesv1.AlertState) error
	AlertDeleteStateNotInList(ctx context.Context, stackName, groupName string, keeplist []string) error
}

type AppCtx

type AppCtx struct {
	EnsureLoggedIn func(ctx context.Context) error
	Features       featurev1connect.FeatureServiceClient
	Config         *config.Config
	State          *state.State
}

type Cursor

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

type OTLPLogger added in v0.8.4

type OTLPLogger interface {
	ExportLogs(ctx context.Context, req *otlplogssvcpb.ExportLogsServiceRequest) (*otlplogssvcpb.ExportLogsServiceResponse, error)
}

type OTLPMeter added in v0.8.4

type OTLPTracer added in v0.8.4

type OTLPTracer interface {
	ExportTraces(ctx context.Context, req *otlptracesvcpb.ExportTraceServiceRequest) (*otlptracesvcpb.ExportTraceServiceResponse, error)
}

type Queryable

type Queryable interface {
	Parse(ctx context.Context, q string) (*typesv1.Query, error)
	Format(ctx context.Context, q *typesv1.Query) (string, error)

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

	Stream(ctx context.Context, q *typesv1.Query, cb func(context.Context, *typesv1.Data) (bool, error), opts *StreamOption) error

	GetTraceByID(ctx context.Context, traceID *typesv1.TraceID) (*typesv1.Trace, error)
	GetTraceBySpanID(ctx context.Context, spanID *typesv1.SpanID) (*typesv1.Trace, error)
	GetSpanByID(ctx context.Context, spanID *typesv1.SpanID) (*typesv1.Span, error)
}

type Storage

type Storage interface {
	Queryable
	SinkFor(ctx context.Context, res *typesv1.Resource, scope *typesv1.Scope) (_ sink.Sink, _ error)
	Stats(ctx context.Context) (*typesv1.DatabaseStats, error)
	Close() error

	OTLPLogger
	OTLPTracer
	OTLPMeter

	Alertable
}

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 StreamOption added in v0.8.5

type StreamOption struct {
	BatchSize             int
	BatchTrigger          <-chan time.Time
	NotifyStreamListening func(ctx context.Context)
}

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