db

package
v6.8.3 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: AGPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanupDB

func CleanupDB(t *testing.T, client *Client)

CleanupDB clears all database tables.

func Disconnect

func Disconnect(client *Client)

Disconnect disconnects from the database.

func DropDB

func DropDB(t *testing.T, client *Client)

DropDB drops all database tables.

func Migrate

func Migrate(config *ClientConfig) error

Migrate runs the database migration for given connection string. This will use the embedded schema migration scripts.

Types

type Client

type Client struct {
	*sql.DB
	// contains filtered or unexported fields
}

Client is a ClickHouse database client.

func Connect

func Connect() *Client

Connect connects to the database.

func NewClient

func NewClient(config *ClientConfig) (*Client, error)

NewClient returns a new client for given database connection string. Pass nil for the config to use the defaults.

func (*Client) Count

func (client *Client) Count(ctx context.Context, query string, args ...any) (int, error)

Count implements the Store interface.

func (*Client) GetConversionsStats

func (client *Client) GetConversionsStats(ctx context.Context, query string, includeCustomMetric bool, args ...any) (*model.ConversionsStats, error)

GetConversionsStats implements the Store interface.

func (*Client) GetGrowthStats

func (client *Client) GetGrowthStats(ctx context.Context, query string, includeCR, includeCustomMetrics bool, args ...any) (*model.GrowthStats, error)

GetGrowthStats implements the Store interface.

func (*Client) GetPlatformStats

func (client *Client) GetPlatformStats(ctx context.Context, query string, args ...any) (*model.PlatformStats, error)

GetPlatformStats implements the Store interface.

func (*Client) GetTotalPageViewStats added in v6.4.0

func (client *Client) GetTotalPageViewStats(ctx context.Context, query string, args ...any) (int, error)

GetTotalPageViewStats implements the Store interface.

func (*Client) GetTotalSessionStats added in v6.4.0

func (client *Client) GetTotalSessionStats(ctx context.Context, query string, args ...any) (int, error)

GetTotalSessionStats implements the Store interface.

func (*Client) GetTotalUniqueVisitorStats added in v6.2.0

func (client *Client) GetTotalUniqueVisitorStats(ctx context.Context, query string, args ...any) (int, error)

GetTotalUniqueVisitorStats implements the Store interface.

func (*Client) GetTotalVisitorStats

func (client *Client) GetTotalVisitorStats(ctx context.Context, query string, includeCR, includeCustomMetric bool, args ...any) (*model.TotalVisitorStats, error)

GetTotalVisitorStats implements the Store interface.

func (*Client) GetTotalVisitorsPageViewsStats

func (client *Client) GetTotalVisitorsPageViewsStats(ctx context.Context, query string, args ...any) (*model.TotalVisitorsPageViewsStats, error)

GetTotalVisitorsPageViewsStats implements the Store interface.

func (*Client) SaveEvents

func (client *Client) SaveEvents(ctx context.Context, events []model.Event) error

SaveEvents implements the Store interface.

func (*Client) SavePageViews

func (client *Client) SavePageViews(ctx context.Context, pageViews []model.PageView) error

SavePageViews implements the Store interface.

func (*Client) SaveRequests added in v6.7.0

func (client *Client) SaveRequests(ctx context.Context, requests []model.Request) error

SaveRequests implements the Store interface.

func (*Client) SaveSessions

func (client *Client) SaveSessions(ctx context.Context, sessions []model.Session) error

SaveSessions implements the Store interface.

func (*Client) SelectActiveVisitorStats

func (client *Client) SelectActiveVisitorStats(ctx context.Context, includeTitle bool, query string, args ...any) ([]model.ActiveVisitorStats, error)

SelectActiveVisitorStats implements the Store interface.

func (*Client) SelectAvgTimeSpentStats

func (client *Client) SelectAvgTimeSpentStats(ctx context.Context, query string, args ...any) ([]model.AvgTimeSpentStats, error)

SelectAvgTimeSpentStats implements the Store interface.

func (*Client) SelectBrowserStats

func (client *Client) SelectBrowserStats(ctx context.Context, query string, args ...any) ([]model.BrowserStats, error)

SelectBrowserStats implements the Store interface.

func (*Client) SelectBrowserVersionStats

func (client *Client) SelectBrowserVersionStats(ctx context.Context, query string, args ...any) ([]model.BrowserVersionStats, error)

SelectBrowserVersionStats implements the Store interface.

func (*Client) SelectCityStats

func (client *Client) SelectCityStats(ctx context.Context, query string, args ...any) ([]model.CityStats, error)

SelectCityStats implements the Store interface.

func (*Client) SelectCountryStats

func (client *Client) SelectCountryStats(ctx context.Context, query string, args ...any) ([]model.CountryStats, error)

SelectCountryStats implements the Store interface.

func (*Client) SelectEntryStats

func (client *Client) SelectEntryStats(ctx context.Context, includeTitle bool, query string, args ...any) ([]model.EntryStats, error)

SelectEntryStats implements the Store interface.

func (*Client) SelectEventListStats

func (client *Client) SelectEventListStats(ctx context.Context, query string, args ...any) ([]model.EventListStats, error)

SelectEventListStats implements the Store interface.

func (*Client) SelectEventStats

func (client *Client) SelectEventStats(ctx context.Context, breakdown bool, query string, args ...any) ([]model.EventStats, error)

SelectEventStats implements the Store interface.

func (*Client) SelectEvents added in v6.8.0

func (client *Client) SelectEvents(ctx context.Context, query string, args ...any) ([]model.Event, error)

SelectEvents implements the Store interface.

func (*Client) SelectExitStats

func (client *Client) SelectExitStats(ctx context.Context, includeTitle bool, query string, args ...any) ([]model.ExitStats, error)

SelectExitStats implements the Store interface.

func (*Client) SelectLanguageStats

func (client *Client) SelectLanguageStats(ctx context.Context, query string, args ...any) ([]model.LanguageStats, error)

SelectLanguageStats implements the Store interface.

func (*Client) SelectOSStats

func (client *Client) SelectOSStats(ctx context.Context, query string, args ...any) ([]model.OSStats, error)

SelectOSStats implements the Store interface.

func (*Client) SelectOSVersionStats

func (client *Client) SelectOSVersionStats(ctx context.Context, query string, args ...any) ([]model.OSVersionStats, error)

SelectOSVersionStats implements the Store interface.

func (*Client) SelectOptions

func (client *Client) SelectOptions(ctx context.Context, query string, args ...any) ([]string, error)

SelectOptions implements the Store interface.

func (*Client) SelectPageStats

func (client *Client) SelectPageStats(ctx context.Context, includeTitle, includeTimeSpent bool, query string, args ...any) ([]model.PageStats, error)

SelectPageStats implements the Store interface.

func (*Client) SelectPageViews added in v6.8.0

func (client *Client) SelectPageViews(ctx context.Context, query string, args ...any) ([]model.PageView, error)

SelectPageViews implements the Store interface.

func (*Client) SelectReferrerStats

func (client *Client) SelectReferrerStats(ctx context.Context, query string, args ...any) ([]model.ReferrerStats, error)

SelectReferrerStats implements the Store interface.

func (*Client) SelectScreenClassStats

func (client *Client) SelectScreenClassStats(ctx context.Context, query string, args ...any) ([]model.ScreenClassStats, error)

SelectScreenClassStats implements the Store interface.

func (*Client) SelectSessions added in v6.8.0

func (client *Client) SelectSessions(ctx context.Context, query string, args ...any) ([]model.Session, error)

SelectSessions implements the Store interface.

func (*Client) SelectTagStats added in v6.7.0

func (client *Client) SelectTagStats(ctx context.Context, breakdown bool, query string, args ...any) ([]model.TagStats, error)

SelectTagStats implements the Store interface.

func (*Client) SelectTimeSpentStats

func (client *Client) SelectTimeSpentStats(ctx context.Context, period pkg.Period, query string, args ...any) ([]model.TimeSpentStats, error)

SelectTimeSpentStats implements the Store interface.

func (*Client) SelectTotalSessions

func (client *Client) SelectTotalSessions(ctx context.Context, query string, args ...any) (int, error)

SelectTotalSessions implements the Store interface.

func (*Client) SelectTotalVisitorSessionStats

func (client *Client) SelectTotalVisitorSessionStats(ctx context.Context, query string, args ...any) ([]model.TotalVisitorSessionStats, error)

SelectTotalVisitorSessionStats implements the Store interface.

func (*Client) SelectUTMCampaignStats

func (client *Client) SelectUTMCampaignStats(ctx context.Context, query string, args ...any) ([]model.UTMCampaignStats, error)

SelectUTMCampaignStats implements the Store interface.

func (*Client) SelectUTMContentStats

func (client *Client) SelectUTMContentStats(ctx context.Context, query string, args ...any) ([]model.UTMContentStats, error)

SelectUTMContentStats implements the Store interface.

func (*Client) SelectUTMMediumStats

func (client *Client) SelectUTMMediumStats(ctx context.Context, query string, args ...any) ([]model.UTMMediumStats, error)

SelectUTMMediumStats implements the Store interface.

func (*Client) SelectUTMSourceStats

func (client *Client) SelectUTMSourceStats(ctx context.Context, query string, args ...any) ([]model.UTMSourceStats, error)

SelectUTMSourceStats implements the Store interface.

func (*Client) SelectUTMTermStats

func (client *Client) SelectUTMTermStats(ctx context.Context, query string, args ...any) ([]model.UTMTermStats, error)

SelectUTMTermStats implements the Store interface.

func (*Client) SelectVisitorHourStats

func (client *Client) SelectVisitorHourStats(ctx context.Context, query string, includeCR, includeCustomMetrics bool, args ...any) ([]model.VisitorHourStats, error)

SelectVisitorHourStats implements the Store interface.

func (*Client) SelectVisitorMinuteStats added in v6.8.0

func (client *Client) SelectVisitorMinuteStats(ctx context.Context, query string, includeCR, includeCustomMetrics bool, args ...any) ([]model.VisitorMinuteStats, error)

SelectVisitorMinuteStats implements the Store interface.

func (*Client) SelectVisitorStats

func (client *Client) SelectVisitorStats(ctx context.Context, period pkg.Period, query string, includeCR, includeCustomMetric bool, args ...any) ([]model.VisitorStats, error)

SelectVisitorStats implements the Store interface.

func (*Client) Session

func (client *Client) Session(ctx context.Context, clientID, fingerprint uint64, maxAge time.Time) (*model.Session, error)

Session implements the Store interface.

type ClientConfig

type ClientConfig struct {
	// Hostname is the database hostname.
	Hostname string

	// Port is the database port.
	Port int

	// Database is the database schema.
	Database string

	// Username is the database user.
	Username string

	// Password is the database password.
	Password string

	// Secure enables TLS encryption.
	Secure bool

	// SSLSkipVerify skips the SSL verification if set to true.
	SSLSkipVerify bool

	// MaxOpenConnections sets the number of maximum open connections.
	// If set to <= 0, the default value of 20 will be used.
	MaxOpenConnections int

	// MaxConnectionLifetimeSeconds sets the maximum amount of time a connection will be reused.
	// If set to <= 0, the default value of 1800 will be used.
	MaxConnectionLifetimeSeconds int

	// MaxIdleConnections sets the number of maximum idle connections.
	// If set to <= 0, the default value of 5 will be used.
	MaxIdleConnections int

	// MaxConnectionIdleTimeSeconds sets the maximum amount of time a connection can be idle.
	// If set to <= 0, the default value of 300 will be used.
	MaxConnectionIdleTimeSeconds int

	// Logger is the log.Logger used for logging.
	// The default log will be used printing to os.Stdout with "pirsch" in its prefix in case it is not set.
	Logger *slog.Logger

	// Debug will enable verbose logging.
	Debug bool
}

ClientConfig is the optional configuration for the Client.

type ClientMock

type ClientMock struct {
	ReturnSession *model.Session
	// contains filtered or unexported fields
}

ClientMock is a mock Store implementation.

func NewClientMock

func NewClientMock() *ClientMock

NewClientMock returns a new mock client.

func (*ClientMock) Count

func (client *ClientMock) Count(context.Context, string, ...any) (int, error)

Count implements the Store interface.

func (*ClientMock) GetConversionsStats

func (client *ClientMock) GetConversionsStats(context.Context, string, bool, ...any) (*model.ConversionsStats, error)

GetConversionsStats implements the Store interface.

func (*ClientMock) GetEvents

func (client *ClientMock) GetEvents() []model.Event

GetEvents returns a copy of the events slice.

func (*ClientMock) GetGrowthStats

func (client *ClientMock) GetGrowthStats(context.Context, string, bool, bool, ...any) (*model.GrowthStats, error)

GetGrowthStats implements the Store interface.

func (*ClientMock) GetPageViews

func (client *ClientMock) GetPageViews() []model.PageView

GetPageViews returns a copy of the page views slice.

func (*ClientMock) GetPlatformStats

func (client *ClientMock) GetPlatformStats(context.Context, string, ...any) (*model.PlatformStats, error)

GetPlatformStats implements the Store interface.

func (*ClientMock) GetRequests added in v6.7.0

func (client *ClientMock) GetRequests() []model.Request

GetRequests returns a copy of the requests slice.

func (*ClientMock) GetSessions

func (client *ClientMock) GetSessions() []model.Session

GetSessions returns a copy of the sessions slice.

func (*ClientMock) GetTotalPageViewStats added in v6.4.0

func (client *ClientMock) GetTotalPageViewStats(context.Context, string, ...any) (int, error)

GetTotalPageViewStats implements the Store interface.

func (*ClientMock) GetTotalSessionStats added in v6.4.0

func (client *ClientMock) GetTotalSessionStats(context.Context, string, ...any) (int, error)

GetTotalSessionStats implements the Store interface.

func (*ClientMock) GetTotalUniqueVisitorStats added in v6.2.0

func (client *ClientMock) GetTotalUniqueVisitorStats(context.Context, string, ...any) (int, error)

GetTotalUniqueVisitorStats implements the Store interface.

func (*ClientMock) GetTotalVisitorStats

func (client *ClientMock) GetTotalVisitorStats(context.Context, string, bool, bool, ...any) (*model.TotalVisitorStats, error)

GetTotalVisitorStats implements the Store interface.

func (*ClientMock) GetTotalVisitorsPageViewsStats

func (client *ClientMock) GetTotalVisitorsPageViewsStats(context.Context, string, ...any) (*model.TotalVisitorsPageViewsStats, error)

GetTotalVisitorsPageViewsStats implements the Store interface.

func (*ClientMock) SaveEvents

func (client *ClientMock) SaveEvents(_ context.Context, events []model.Event) error

SaveEvents implements the Store interface.

func (*ClientMock) SavePageViews

func (client *ClientMock) SavePageViews(_ context.Context, pageViews []model.PageView) error

SavePageViews implements the Store interface.

func (*ClientMock) SaveRequests added in v6.7.0

func (client *ClientMock) SaveRequests(_ context.Context, bots []model.Request) error

SaveRequests implements the Store interface.

func (*ClientMock) SaveSessions

func (client *ClientMock) SaveSessions(_ context.Context, sessions []model.Session) error

SaveSessions implements the Store interface.

func (*ClientMock) SelectActiveVisitorStats

func (client *ClientMock) SelectActiveVisitorStats(context.Context, bool, string, ...any) ([]model.ActiveVisitorStats, error)

SelectActiveVisitorStats implements the Store interface.

func (*ClientMock) SelectAvgTimeSpentStats

func (client *ClientMock) SelectAvgTimeSpentStats(context.Context, string, ...any) ([]model.AvgTimeSpentStats, error)

SelectAvgTimeSpentStats implements the Store interface.

func (*ClientMock) SelectBrowserStats

func (client *ClientMock) SelectBrowserStats(context.Context, string, ...any) ([]model.BrowserStats, error)

SelectBrowserStats implements the Store interface.

func (*ClientMock) SelectBrowserVersionStats

func (client *ClientMock) SelectBrowserVersionStats(context.Context, string, ...any) ([]model.BrowserVersionStats, error)

SelectBrowserVersionStats implements the Store interface.

func (*ClientMock) SelectCityStats

func (client *ClientMock) SelectCityStats(context.Context, string, ...any) ([]model.CityStats, error)

SelectCityStats implements the Store interface.

func (*ClientMock) SelectCountryStats

func (client *ClientMock) SelectCountryStats(context.Context, string, ...any) ([]model.CountryStats, error)

SelectCountryStats implements the Store interface.

func (*ClientMock) SelectEntryStats

func (client *ClientMock) SelectEntryStats(context.Context, bool, string, ...any) ([]model.EntryStats, error)

SelectEntryStats implements the Store interface.

func (*ClientMock) SelectEventListStats

func (client *ClientMock) SelectEventListStats(context.Context, string, ...any) ([]model.EventListStats, error)

SelectEventListStats implements the Store interface.

func (*ClientMock) SelectEventStats

func (client *ClientMock) SelectEventStats(context.Context, bool, string, ...any) ([]model.EventStats, error)

SelectEventStats implements the Store interface.

func (*ClientMock) SelectEvents added in v6.8.0

func (client *ClientMock) SelectEvents(context.Context, string, ...any) ([]model.Event, error)

SelectEvents implements the Store interface.

func (*ClientMock) SelectExitStats

func (client *ClientMock) SelectExitStats(context.Context, bool, string, ...any) ([]model.ExitStats, error)

SelectExitStats implements the Store interface.

func (*ClientMock) SelectLanguageStats

func (client *ClientMock) SelectLanguageStats(context.Context, string, ...any) ([]model.LanguageStats, error)

SelectLanguageStats implements the Store interface.

func (*ClientMock) SelectOSStats

func (client *ClientMock) SelectOSStats(context.Context, string, ...any) ([]model.OSStats, error)

SelectOSStats implements the Store interface.

func (*ClientMock) SelectOSVersionStats

func (client *ClientMock) SelectOSVersionStats(context.Context, string, ...any) ([]model.OSVersionStats, error)

SelectOSVersionStats implements the Store interface.

func (*ClientMock) SelectOptions

func (client *ClientMock) SelectOptions(context.Context, string, ...any) ([]string, error)

SelectOptions implements the Store interface.

func (*ClientMock) SelectPageStats

func (client *ClientMock) SelectPageStats(context.Context, bool, bool, string, ...any) ([]model.PageStats, error)

SelectPageStats implements the Store interface.

func (*ClientMock) SelectPageViews added in v6.8.0

func (client *ClientMock) SelectPageViews(context.Context, string, ...any) ([]model.PageView, error)

SelectPageViews implements the Store interface.

func (*ClientMock) SelectReferrerStats

func (client *ClientMock) SelectReferrerStats(context.Context, string, ...any) ([]model.ReferrerStats, error)

SelectReferrerStats implements the Store interface.

func (*ClientMock) SelectScreenClassStats

func (client *ClientMock) SelectScreenClassStats(context.Context, string, ...any) ([]model.ScreenClassStats, error)

SelectScreenClassStats implements the Store interface.

func (*ClientMock) SelectSessions added in v6.8.0

func (client *ClientMock) SelectSessions(ctx context.Context, query string, args ...any) ([]model.Session, error)

SelectSessions implements the Store interface.

func (*ClientMock) SelectTagStats added in v6.7.0

func (client *ClientMock) SelectTagStats(context.Context, bool, string, ...any) ([]model.TagStats, error)

SelectTagStats implements the Store interface.

func (*ClientMock) SelectTimeSpentStats

func (client *ClientMock) SelectTimeSpentStats(context.Context, pkg.Period, string, ...any) ([]model.TimeSpentStats, error)

SelectTimeSpentStats implements the Store interface.

func (*ClientMock) SelectTotalSessions

func (client *ClientMock) SelectTotalSessions(context.Context, string, ...any) (int, error)

SelectTotalSessions implements the Store interface.

func (*ClientMock) SelectTotalVisitorSessionStats

func (client *ClientMock) SelectTotalVisitorSessionStats(context.Context, string, ...any) ([]model.TotalVisitorSessionStats, error)

SelectTotalVisitorSessionStats implements the Store interface.

func (*ClientMock) SelectUTMCampaignStats

func (client *ClientMock) SelectUTMCampaignStats(context.Context, string, ...any) ([]model.UTMCampaignStats, error)

SelectUTMCampaignStats implements the Store interface.

func (*ClientMock) SelectUTMContentStats

func (client *ClientMock) SelectUTMContentStats(context.Context, string, ...any) ([]model.UTMContentStats, error)

SelectUTMContentStats implements the Store interface.

func (*ClientMock) SelectUTMMediumStats

func (client *ClientMock) SelectUTMMediumStats(context.Context, string, ...any) ([]model.UTMMediumStats, error)

SelectUTMMediumStats implements the Store interface.

func (*ClientMock) SelectUTMSourceStats

func (client *ClientMock) SelectUTMSourceStats(context.Context, string, ...any) ([]model.UTMSourceStats, error)

SelectUTMSourceStats implements the Store interface.

func (*ClientMock) SelectUTMTermStats

func (client *ClientMock) SelectUTMTermStats(context.Context, string, ...any) ([]model.UTMTermStats, error)

SelectUTMTermStats implements the Store interface.

func (*ClientMock) SelectVisitorHourStats

func (client *ClientMock) SelectVisitorHourStats(context.Context, string, bool, bool, ...any) ([]model.VisitorHourStats, error)

SelectVisitorHourStats implements the Store interface.

func (*ClientMock) SelectVisitorMinuteStats added in v6.8.0

func (client *ClientMock) SelectVisitorMinuteStats(context.Context, string, bool, bool, ...any) ([]model.VisitorMinuteStats, error)

SelectVisitorMinuteStats implements the Store interface.

func (*ClientMock) SelectVisitorStats

func (client *ClientMock) SelectVisitorStats(context.Context, pkg.Period, string, bool, bool, ...any) ([]model.VisitorStats, error)

SelectVisitorStats implements the Store interface.

func (*ClientMock) Session

func (client *ClientMock) Session(context.Context, uint64, uint64, time.Time) (*model.Session, error)

Session implements the Store interface.

type Store

type Store interface {
	// SavePageViews saves given hits.
	SavePageViews(context.Context, []model.PageView) error

	// SaveSessions saves given sessions.
	SaveSessions(context.Context, []model.Session) error

	// SaveEvents saves given events.
	SaveEvents(context.Context, []model.Event) error

	// SaveRequests saves given requests.
	SaveRequests(context.Context, []model.Request) error

	// Session returns the last hit for given client, fingerprint, and maximum age.
	Session(context.Context, uint64, uint64, time.Time) (*model.Session, error)

	// Count returns the number of results for given query.
	Count(context.Context, string, ...any) (int, error)

	// SelectActiveVisitorStats selects model.ActiveVisitorStats.
	SelectActiveVisitorStats(context.Context, bool, string, ...any) ([]model.ActiveVisitorStats, error)

	// GetTotalVisitorStats returns the model.TotalVisitorStats.
	GetTotalVisitorStats(context.Context, string, bool, bool, ...any) (*model.TotalVisitorStats, error)

	// GetTotalUniqueVisitorStats returns the total number of unique visitors.
	GetTotalUniqueVisitorStats(context.Context, string, ...any) (int, error)

	// GetTotalPageViewStats returns the total number of page views.
	GetTotalPageViewStats(context.Context, string, ...any) (int, error)

	// GetTotalSessionStats returns the total number of sessions.
	GetTotalSessionStats(context.Context, string, ...any) (int, error)

	// GetTotalVisitorsPageViewsStats returns the model.TotalVisitorsPageViewsStats.
	GetTotalVisitorsPageViewsStats(context.Context, string, ...any) (*model.TotalVisitorsPageViewsStats, error)

	// SelectVisitorStats selects model.VisitorStats.
	SelectVisitorStats(context.Context, pkg.Period, string, bool, bool, ...any) ([]model.VisitorStats, error)

	// SelectTimeSpentStats selects model.TimeSpentStats.
	SelectTimeSpentStats(context.Context, pkg.Period, string, ...any) ([]model.TimeSpentStats, error)

	// GetGrowthStats returns the model.GrowthStats.
	GetGrowthStats(context.Context, string, bool, bool, ...any) (*model.GrowthStats, error)

	// SelectVisitorHourStats selects model.VisitorHourStats.
	SelectVisitorHourStats(context.Context, string, bool, bool, ...any) ([]model.VisitorHourStats, error)

	// SelectVisitorMinuteStats selects model.VisitorMinuteStats.
	SelectVisitorMinuteStats(context.Context, string, bool, bool, ...any) ([]model.VisitorMinuteStats, error)

	// SelectPageStats selects model.PageStats.
	SelectPageStats(context.Context, bool, bool, string, ...any) ([]model.PageStats, error)

	// SelectAvgTimeSpentStats selects model.AvgTimeSpentStats.
	SelectAvgTimeSpentStats(context.Context, string, ...any) ([]model.AvgTimeSpentStats, error)

	// SelectEntryStats selects model.EntryStats.
	SelectEntryStats(context.Context, bool, string, ...any) ([]model.EntryStats, error)

	// SelectExitStats selects model.ExitStats.
	SelectExitStats(context.Context, bool, string, ...any) ([]model.ExitStats, error)

	// SelectTotalSessions returns the total number of unique sessions.
	SelectTotalSessions(context.Context, string, ...any) (int, error)

	// SelectTotalVisitorSessionStats selects model.TotalVisitorSessionStats.
	SelectTotalVisitorSessionStats(context.Context, string, ...any) ([]model.TotalVisitorSessionStats, error)

	// GetConversionsStats returns the model.ConversionsStats.
	GetConversionsStats(context.Context, string, bool, ...any) (*model.ConversionsStats, error)

	// SelectEventStats selects model.EventStats.
	SelectEventStats(context.Context, bool, string, ...any) ([]model.EventStats, error)

	// SelectEventListStats selects model.EventListStats.
	SelectEventListStats(context.Context, string, ...any) ([]model.EventListStats, error)

	// SelectReferrerStats selects model.ReferrerStats.
	SelectReferrerStats(context.Context, string, ...any) ([]model.ReferrerStats, error)

	// GetPlatformStats returns the model.PlatformStats.
	GetPlatformStats(context.Context, string, ...any) (*model.PlatformStats, error)

	// SelectLanguageStats selects model.LanguageStats.
	SelectLanguageStats(context.Context, string, ...any) ([]model.LanguageStats, error)

	// SelectCountryStats selects model.CountryStats.
	SelectCountryStats(context.Context, string, ...any) ([]model.CountryStats, error)

	// SelectCityStats selects model.CityStats.
	SelectCityStats(context.Context, string, ...any) ([]model.CityStats, error)

	// SelectBrowserStats selects model.BrowserStats.
	SelectBrowserStats(context.Context, string, ...any) ([]model.BrowserStats, error)

	// SelectOSStats selects model.OSStats.
	SelectOSStats(context.Context, string, ...any) ([]model.OSStats, error)

	// SelectScreenClassStats selects model.ScreenClassStats.
	SelectScreenClassStats(context.Context, string, ...any) ([]model.ScreenClassStats, error)

	// SelectUTMSourceStats selects model.UTMSourceStats.
	SelectUTMSourceStats(context.Context, string, ...any) ([]model.UTMSourceStats, error)

	// SelectUTMMediumStats selects model.UTMMediumStats.
	SelectUTMMediumStats(context.Context, string, ...any) ([]model.UTMMediumStats, error)

	// SelectUTMCampaignStats selects model.UTMCampaignStats.
	SelectUTMCampaignStats(context.Context, string, ...any) ([]model.UTMCampaignStats, error)

	// SelectUTMContentStats selects model.UTMContentStats.
	SelectUTMContentStats(context.Context, string, ...any) ([]model.UTMContentStats, error)

	// SelectUTMTermStats selects model.UTMTermStats.
	SelectUTMTermStats(context.Context, string, ...any) ([]model.UTMTermStats, error)

	// SelectOSVersionStats selects model.OSVersionStats.
	SelectOSVersionStats(context.Context, string, ...any) ([]model.OSVersionStats, error)

	// SelectBrowserVersionStats selects model.BrowserVersionStats.
	SelectBrowserVersionStats(context.Context, string, ...any) ([]model.BrowserVersionStats, error)

	// SelectTagStats selects model.TagStats.
	SelectTagStats(context.Context, bool, string, ...any) ([]model.TagStats, error)

	// SelectOptions selects a list of filter options.
	SelectOptions(context.Context, string, ...any) ([]string, error)

	// SelectSessions selects sessions.
	SelectSessions(context.Context, string, ...any) ([]model.Session, error)

	// SelectPageViews selects page views.
	SelectPageViews(context.Context, string, ...any) ([]model.PageView, error)

	// SelectEvents selects events.
	SelectEvents(context.Context, string, ...any) ([]model.Event, error)
}

Store is the database storage interface.

Jump to

Keyboard shortcuts

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