sessions

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2025 License: MIT Imports: 13 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, batchSize int) schema.Layout

NewBatchingSchemaLayout creates a new layout that batches the sessions into smaller tables.

func NewDirectCloser

func NewDirectCloser(writer SessionWriter, failureSleepDuration time.Duration) protosessions.Closer

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

Types

type SessionWriter

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

SessionWriter defines the interface for writing sessions

func NewSessionWriter

func NewSessionWriter(
	parentCtx context.Context,
	whr warehouse.Registry,
	columnsRegistry schema.ColumnsRegistry,
	layouts schema.LayoutRegistry,
) 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.

Jump to

Keyboard shortcuts

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