sessions

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2026 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package sessions provides session management functionality for the tracking system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewBatchingSchemaLayout

func NewBatchingSchemaLayout(layout schema.Layout) schema.Layout

NewBatchingSchemaLayout creates a new layout that makes sure that all the rows from a single table will be written to the warehouse in a single call.

Types

type DirectCloser added in v0.13.0

type DirectCloser struct {
	// contains filtered or unexported fields
}

func NewDirectCloser

func NewDirectCloser(writer SessionWriter, failureSleepDuration time.Duration) *DirectCloser

NewDirectCloser creates a new protosessions.Closer that writes the session directly to warehouse.Driver, without intermediate queue (suitable only for single-tenant setup)

func (*DirectCloser) Close added in v0.13.0

func (c *DirectCloser) Close(protosessions [][]*hits.Hit) error

Close implements protosessions.Closer

type SessionWriter

type SessionWriter interface {
	Write(sessions ...*schema.Session) error
}

SessionWriter defines the interface for writing sessions

func NewNoopWriter added in v0.13.0

func NewNoopWriter() SessionWriter

NewNoopWriter creates a new NoopWriter

func NewSessionWriter

func NewSessionWriter(
	parentCtx context.Context,
	whr warehouse.Registry,
	columnsRegistry schema.ColumnsRegistry,
	layouts schema.LayoutRegistry,
	splitterRegistry splitter.Registry,
	opts ...SessionWriterOption,
) SessionWriter

NewSessionWriter creates a new SessionWriter with the provided warehouse, column sources, and layout sources. It caches each entity (warehouse, columns, layout) for 5 minutes.

type SessionWriterOption added in v0.13.0

type SessionWriterOption func(*sessionWriterImpl)

SessionWriterOption configures the SessionWriter.

func WithCacheTTL added in v0.13.0

func WithCacheTTL(d time.Duration) SessionWriterOption

WithCacheTTL sets the TTL for cached registries.

func WithConcurrency added in v0.13.0

func WithConcurrency(n int) SessionWriterOption

WithConcurrency sets the concurrency limit for parallel writes.

func WithWriteTimeout added in v0.13.0

func WithWriteTimeout(d time.Duration) SessionWriterOption

WithWriteTimeout sets the timeout for individual write operations.

Jump to

Keyboard shortcuts

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