properties

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package properties provides the core data models and types for property configuration.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Settings

type Settings struct {
	PropertyID   string
	PropertyName string
	// In some cases (like matomo) the measurement ID is the same as the property ID.
	// In other cases (like GA4) the measurement ID is a separate ID.
	PropertyMeasurementID string

	SplitByUserID              bool
	SplitByCampaign            bool
	SplitByTimeSinceFirstEvent time.Duration
	SplitByMaxEvents           int

	SessionDuration           time.Duration
	SessionJoinBySessionStamp bool
	SessionJoinByUserID       bool
}

Settings holds the tracking configuration for a property.

type SettingsRegistry

type SettingsRegistry interface {
	GetByMeasurementID(trackingID string) (*Settings, error)
	GetByPropertyID(propertyID string) (*Settings, error)
}

SettingsRegistry is a registry of property configurations.

func NewStaticSettingsRegistry

func NewStaticSettingsRegistry(props []Settings, opts ...StaticSettingsRegistryOptions) SettingsRegistry

NewStaticSettingsRegistry creates a new static property source from a list of property configurations.

func NewTestSettingRegistry added in v0.13.0

func NewTestSettingRegistry(opts ...TestSettingsOption) SettingsRegistry

NewTestSettingRegistry is a test property source that returns a static property configuration.

type StaticSettingsRegistry

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

StaticSettingsRegistry is a static property settings registry that stores property settings in a map.

func (StaticSettingsRegistry) GetByMeasurementID

func (s StaticSettingsRegistry) GetByMeasurementID(trackingID string) (*Settings, error)

GetByMeasurementID gets a property configuration by tracking ID.

func (StaticSettingsRegistry) GetByPropertyID

func (s StaticSettingsRegistry) GetByPropertyID(propertyID string) (*Settings, error)

GetByPropertyID gets a property configuration by property ID.

type StaticSettingsRegistryOptions

type StaticSettingsRegistryOptions func(s *StaticSettingsRegistry)

StaticSettingsRegistryOptions are options for the static property source.

func WithDefaultConfig

func WithDefaultConfig(settings *Settings) StaticSettingsRegistryOptions

WithDefaultConfig sets the default configuration for the static property source.

type TestSettingsOption added in v0.13.0

type TestSettingsOption func(*Settings)

TestSettingsOption configures test settings.

func WithSessionDuration added in v0.13.0

func WithSessionDuration(d time.Duration) TestSettingsOption

WithSessionDuration sets the session duration for test settings.

Jump to

Keyboard shortcuts

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