properties

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2025 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
}

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 TestPropertySource

func TestPropertySource() SettingsRegistry

TestPropertySource 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(config Settings) StaticSettingsRegistryOptions

WithDefaultConfig sets the default configuration for the static property source.

Jump to

Keyboard shortcuts

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