Documentation ¶
Index ¶
- func CleanupDB(t *testing.T, client *Client)
- func Disconnect(client *Client)
- func DropDB(t *testing.T, client *Client)
- func Migrate(config *ClientConfig) error
- type Client
- func (client *Client) Count(ctx context.Context, query string, args ...any) (int, error)
- func (client *Client) GetConversionsStats(ctx context.Context, query string, includeCustomMetric bool, args ...any) (*model.ConversionsStats, error)
- func (client *Client) GetGrowthStats(ctx context.Context, query string, includeCR, includeCustomMetrics bool, ...) (*model.GrowthStats, error)
- func (client *Client) GetPlatformStats(ctx context.Context, query string, args ...any) (*model.PlatformStats, error)
- func (client *Client) GetTotalPageViewStats(ctx context.Context, query string, args ...any) (int, error)
- func (client *Client) GetTotalSessionStats(ctx context.Context, query string, args ...any) (int, error)
- func (client *Client) GetTotalUniqueVisitorStats(ctx context.Context, query string, args ...any) (int, error)
- func (client *Client) GetTotalVisitorStats(ctx context.Context, query string, includeCR, includeCustomMetric bool, ...) (*model.TotalVisitorStats, error)
- func (client *Client) GetTotalVisitorsPageViewsStats(ctx context.Context, query string, args ...any) (*model.TotalVisitorsPageViewsStats, error)
- func (client *Client) SaveEvents(events []model.Event) error
- func (client *Client) SavePageViews(pageViews []model.PageView) error
- func (client *Client) SaveRequests(requests []model.Request) error
- func (client *Client) SaveSessions(sessions []model.Session) error
- func (client *Client) SelectActiveVisitorStats(ctx context.Context, includeTitle bool, query string, args ...any) ([]model.ActiveVisitorStats, error)
- func (client *Client) SelectAvgTimeSpentStats(ctx context.Context, query string, args ...any) ([]model.AvgTimeSpentStats, error)
- func (client *Client) SelectBrowserStats(ctx context.Context, query string, args ...any) ([]model.BrowserStats, error)
- func (client *Client) SelectBrowserVersionStats(ctx context.Context, query string, args ...any) ([]model.BrowserVersionStats, error)
- func (client *Client) SelectChannelStats(ctx context.Context, query string, args ...any) ([]model.ChannelStats, error)
- func (client *Client) SelectCityStats(ctx context.Context, query string, args ...any) ([]model.CityStats, error)
- func (client *Client) SelectCountryStats(ctx context.Context, query string, args ...any) ([]model.CountryStats, error)
- func (client *Client) SelectEntryStats(ctx context.Context, includeTitle bool, query string, args ...any) ([]model.EntryStats, error)
- func (client *Client) SelectEventListStats(ctx context.Context, query string, args ...any) ([]model.EventListStats, error)
- func (client *Client) SelectEventStats(ctx context.Context, breakdown bool, query string, args ...any) ([]model.EventStats, error)
- func (client *Client) SelectEvents(ctx context.Context, query string, args ...any) ([]model.Event, error)
- func (client *Client) SelectExitStats(ctx context.Context, includeTitle bool, query string, args ...any) ([]model.ExitStats, error)
- func (client *Client) SelectFunnelSteps(ctx context.Context, query string, args ...any) ([]model.FunnelStep, error)
- func (client *Client) SelectHostnameStats(ctx context.Context, query string, args ...any) ([]model.HostnameStats, error)
- func (client *Client) SelectLanguageStats(ctx context.Context, query string, args ...any) ([]model.LanguageStats, error)
- func (client *Client) SelectOSStats(ctx context.Context, query string, args ...any) ([]model.OSStats, error)
- func (client *Client) SelectOSVersionStats(ctx context.Context, query string, args ...any) ([]model.OSVersionStats, error)
- func (client *Client) SelectOptions(ctx context.Context, query string, args ...any) ([]string, error)
- func (client *Client) SelectPageStats(ctx context.Context, includeTitle, includeTimeSpent bool, query string, ...) ([]model.PageStats, error)
- func (client *Client) SelectPageViews(ctx context.Context, query string, args ...any) ([]model.PageView, error)
- func (client *Client) SelectReferrerStats(ctx context.Context, query string, args ...any) ([]model.ReferrerStats, error)
- func (client *Client) SelectRegionStats(ctx context.Context, query string, args ...any) ([]model.RegionStats, error)
- func (client *Client) SelectScreenClassStats(ctx context.Context, query string, args ...any) ([]model.ScreenClassStats, error)
- func (client *Client) SelectSessions(ctx context.Context, query string, args ...any) ([]model.Session, error)
- func (client *Client) SelectTagStats(ctx context.Context, breakdown bool, query string, args ...any) ([]model.TagStats, error)
- func (client *Client) SelectTimeSpentStats(ctx context.Context, period pkg.Period, query string, args ...any) ([]model.TimeSpentStats, error)
- func (client *Client) SelectTotalSessions(ctx context.Context, query string, args ...any) (int, error)
- func (client *Client) SelectTotalVisitorSessionStats(ctx context.Context, query string, args ...any) ([]model.TotalVisitorSessionStats, error)
- func (client *Client) SelectUTMCampaignStats(ctx context.Context, query string, args ...any) ([]model.UTMCampaignStats, error)
- func (client *Client) SelectUTMContentStats(ctx context.Context, query string, args ...any) ([]model.UTMContentStats, error)
- func (client *Client) SelectUTMMediumStats(ctx context.Context, query string, args ...any) ([]model.UTMMediumStats, error)
- func (client *Client) SelectUTMSourceStats(ctx context.Context, query string, args ...any) ([]model.UTMSourceStats, error)
- func (client *Client) SelectUTMTermStats(ctx context.Context, query string, args ...any) ([]model.UTMTermStats, error)
- func (client *Client) SelectVisitorHourStats(ctx context.Context, query string, includeCR, includeCustomMetrics bool, ...) ([]model.VisitorHourStats, error)
- func (client *Client) SelectVisitorMinuteStats(ctx context.Context, query string, includeCR, includeCustomMetrics bool, ...) ([]model.VisitorMinuteStats, error)
- func (client *Client) SelectVisitorStats(ctx context.Context, period pkg.Period, query string, ...) ([]model.VisitorStats, error)
- func (client *Client) SelectVisitorWeekdayHourStats(ctx context.Context, query string, args ...any) ([]model.VisitorWeekdayHourStats, error)
- func (client *Client) Session(ctx context.Context, clientID, fingerprint uint64, maxAge time.Time) (*model.Session, error)
- type ClientConfig
- type ClientMock
- func (client *ClientMock) Count(context.Context, string, ...any) (int, error)
- func (client *ClientMock) GetConversionsStats(context.Context, string, bool, ...any) (*model.ConversionsStats, error)
- func (client *ClientMock) GetEvents() []model.Event
- func (client *ClientMock) GetGrowthStats(context.Context, string, bool, bool, ...any) (*model.GrowthStats, error)
- func (client *ClientMock) GetPageViews() []model.PageView
- func (client *ClientMock) GetPlatformStats(context.Context, string, ...any) (*model.PlatformStats, error)
- func (client *ClientMock) GetRequests() []model.Request
- func (client *ClientMock) GetSessions() []model.Session
- func (client *ClientMock) GetTotalPageViewStats(context.Context, string, ...any) (int, error)
- func (client *ClientMock) GetTotalSessionStats(context.Context, string, ...any) (int, error)
- func (client *ClientMock) GetTotalUniqueVisitorStats(context.Context, string, ...any) (int, error)
- func (client *ClientMock) GetTotalVisitorStats(context.Context, string, bool, bool, ...any) (*model.TotalVisitorStats, error)
- func (client *ClientMock) GetTotalVisitorsPageViewsStats(context.Context, string, ...any) (*model.TotalVisitorsPageViewsStats, error)
- func (client *ClientMock) SaveEvents(events []model.Event) error
- func (client *ClientMock) SavePageViews(pageViews []model.PageView) error
- func (client *ClientMock) SaveRequests(bots []model.Request) error
- func (client *ClientMock) SaveSessions(sessions []model.Session) error
- func (client *ClientMock) SelectActiveVisitorStats(context.Context, bool, string, ...any) ([]model.ActiveVisitorStats, error)
- func (client *ClientMock) SelectAvgTimeSpentStats(context.Context, string, ...any) ([]model.AvgTimeSpentStats, error)
- func (client *ClientMock) SelectBrowserStats(context.Context, string, ...any) ([]model.BrowserStats, error)
- func (client *ClientMock) SelectBrowserVersionStats(context.Context, string, ...any) ([]model.BrowserVersionStats, error)
- func (client *ClientMock) SelectChannelStats(ctx context.Context, query string, args ...any) ([]model.ChannelStats, error)
- func (client *ClientMock) SelectCityStats(context.Context, string, ...any) ([]model.CityStats, error)
- func (client *ClientMock) SelectCountryStats(context.Context, string, ...any) ([]model.CountryStats, error)
- func (client *ClientMock) SelectEntryStats(context.Context, bool, string, ...any) ([]model.EntryStats, error)
- func (client *ClientMock) SelectEventListStats(context.Context, string, ...any) ([]model.EventListStats, error)
- func (client *ClientMock) SelectEventStats(context.Context, bool, string, ...any) ([]model.EventStats, error)
- func (client *ClientMock) SelectEvents(context.Context, string, ...any) ([]model.Event, error)
- func (client *ClientMock) SelectExitStats(context.Context, bool, string, ...any) ([]model.ExitStats, error)
- func (client *ClientMock) SelectFunnelSteps(context.Context, string, ...any) ([]model.FunnelStep, error)
- func (client *ClientMock) SelectHostnameStats(context.Context, string, ...any) ([]model.HostnameStats, error)
- func (client *ClientMock) SelectLanguageStats(context.Context, string, ...any) ([]model.LanguageStats, error)
- func (client *ClientMock) SelectOSStats(context.Context, string, ...any) ([]model.OSStats, error)
- func (client *ClientMock) SelectOSVersionStats(context.Context, string, ...any) ([]model.OSVersionStats, error)
- func (client *ClientMock) SelectOptions(context.Context, string, ...any) ([]string, error)
- func (client *ClientMock) SelectPageStats(context.Context, bool, bool, string, ...any) ([]model.PageStats, error)
- func (client *ClientMock) SelectPageViews(context.Context, string, ...any) ([]model.PageView, error)
- func (client *ClientMock) SelectReferrerStats(context.Context, string, ...any) ([]model.ReferrerStats, error)
- func (client *ClientMock) SelectRegionStats(context.Context, string, ...any) ([]model.RegionStats, error)
- func (client *ClientMock) SelectScreenClassStats(context.Context, string, ...any) ([]model.ScreenClassStats, error)
- func (client *ClientMock) SelectSessions(ctx context.Context, query string, args ...any) ([]model.Session, error)
- func (client *ClientMock) SelectTagStats(context.Context, bool, string, ...any) ([]model.TagStats, error)
- func (client *ClientMock) SelectTimeSpentStats(context.Context, pkg.Period, string, ...any) ([]model.TimeSpentStats, error)
- func (client *ClientMock) SelectTotalSessions(context.Context, string, ...any) (int, error)
- func (client *ClientMock) SelectTotalVisitorSessionStats(context.Context, string, ...any) ([]model.TotalVisitorSessionStats, error)
- func (client *ClientMock) SelectUTMCampaignStats(context.Context, string, ...any) ([]model.UTMCampaignStats, error)
- func (client *ClientMock) SelectUTMContentStats(context.Context, string, ...any) ([]model.UTMContentStats, error)
- func (client *ClientMock) SelectUTMMediumStats(context.Context, string, ...any) ([]model.UTMMediumStats, error)
- func (client *ClientMock) SelectUTMSourceStats(context.Context, string, ...any) ([]model.UTMSourceStats, error)
- func (client *ClientMock) SelectUTMTermStats(context.Context, string, ...any) ([]model.UTMTermStats, error)
- func (client *ClientMock) SelectVisitorHourStats(context.Context, string, bool, bool, ...any) ([]model.VisitorHourStats, error)
- func (client *ClientMock) SelectVisitorMinuteStats(context.Context, string, bool, bool, ...any) ([]model.VisitorMinuteStats, error)
- func (client *ClientMock) SelectVisitorStats(context.Context, pkg.Period, string, bool, bool, ...any) ([]model.VisitorStats, error)
- func (client *ClientMock) SelectVisitorWeekdayHourStats(ctx context.Context, query string, args ...any) ([]model.VisitorWeekdayHourStats, error)
- func (client *ClientMock) Session(context.Context, uint64, uint64, time.Time) (*model.Session, error)
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
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 ¶
Client is a ClickHouse database client.
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) 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 ¶
SaveEvents implements the Store interface.
func (*Client) SavePageViews ¶
SavePageViews implements the Store interface.
func (*Client) SaveRequests ¶ added in v6.7.0
SaveRequests implements the Store interface.
func (*Client) SaveSessions ¶
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) SelectChannelStats ¶ added in v6.19.0
func (client *Client) SelectChannelStats(ctx context.Context, query string, args ...any) ([]model.ChannelStats, error)
SelectChannelStats 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) SelectFunnelSteps ¶ added in v6.12.0
func (client *Client) SelectFunnelSteps(ctx context.Context, query string, args ...any) ([]model.FunnelStep, error)
SelectFunnelSteps implements the Store interface.
func (*Client) SelectHostnameStats ¶ added in v6.15.0
func (client *Client) SelectHostnameStats(ctx context.Context, query string, args ...any) ([]model.HostnameStats, error)
SelectHostnameStats 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) SelectRegionStats ¶ added in v6.9.0
func (client *Client) SelectRegionStats(ctx context.Context, query string, args ...any) ([]model.RegionStats, error)
SelectRegionStats 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) SelectVisitorWeekdayHourStats ¶ added in v6.15.0
func (client *Client) SelectVisitorWeekdayHourStats(ctx context.Context, query string, args ...any) ([]model.VisitorWeekdayHourStats, error)
SelectVisitorWeekdayHourStats selects model.VisitorWeekdayHourStats.
type ClientConfig ¶
type ClientConfig struct { // Hostnames is the database hostname. Hostnames []string // Port is the database port. Port int // Cluster is the optional database cluster to use. Cluster string // 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 // contains filtered or unexported fields }
ClientConfig is the optional configuration for the Client.
type ClientMock ¶
ClientMock is a mock Store implementation.
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
GetTotalPageViewStats implements the Store interface.
func (*ClientMock) GetTotalSessionStats ¶ added in v6.4.0
GetTotalSessionStats implements the Store interface.
func (*ClientMock) GetTotalUniqueVisitorStats ¶ added in v6.2.0
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(events []model.Event) error
SaveEvents implements the Store interface.
func (*ClientMock) SavePageViews ¶
func (client *ClientMock) SavePageViews(pageViews []model.PageView) error
SavePageViews implements the Store interface.
func (*ClientMock) SaveRequests ¶ added in v6.7.0
func (client *ClientMock) SaveRequests(bots []model.Request) error
SaveRequests implements the Store interface.
func (*ClientMock) SaveSessions ¶
func (client *ClientMock) SaveSessions(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) SelectChannelStats ¶ added in v6.19.0
func (client *ClientMock) SelectChannelStats(ctx context.Context, query string, args ...any) ([]model.ChannelStats, error)
SelectChannelStats 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
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) SelectFunnelSteps ¶ added in v6.12.0
func (client *ClientMock) SelectFunnelSteps(context.Context, string, ...any) ([]model.FunnelStep, error)
SelectFunnelSteps implements the Store interface.
func (*ClientMock) SelectHostnameStats ¶ added in v6.15.0
func (client *ClientMock) SelectHostnameStats(context.Context, string, ...any) ([]model.HostnameStats, error)
SelectHostnameStats 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 ¶
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 ¶
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) SelectRegionStats ¶ added in v6.9.0
func (client *ClientMock) SelectRegionStats(context.Context, string, ...any) ([]model.RegionStats, error)
SelectRegionStats 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 ¶
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) SelectVisitorWeekdayHourStats ¶ added in v6.15.0
func (client *ClientMock) SelectVisitorWeekdayHourStats(ctx context.Context, query string, args ...any) ([]model.VisitorWeekdayHourStats, error)
SelectVisitorWeekdayHourStats selects model.VisitorWeekdayHourStats.
type Store ¶
type Store interface { // SavePageViews saves given hits. SavePageViews([]model.PageView) error // SaveSessions saves given sessions. SaveSessions([]model.Session) error // SaveEvents saves given events. SaveEvents([]model.Event) error // SaveRequests saves given requests. SaveRequests([]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) // SelectVisitorWeekdayHourStats selects model.VisitorWeekdayHourStats. SelectVisitorWeekdayHourStats(context.Context, string, ...any) ([]model.VisitorWeekdayHourStats, error) // SelectVisitorMinuteStats selects model.VisitorMinuteStats. SelectVisitorMinuteStats(context.Context, string, bool, bool, ...any) ([]model.VisitorMinuteStats, error) // SelectHostnameStats selects model.HostnameStats. SelectHostnameStats(context.Context, string, ...any) ([]model.HostnameStats, 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) // SelectRegionStats selects model.RegionStats. SelectRegionStats(context.Context, string, ...any) ([]model.RegionStats, 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) // SelectChannelStats selects model.ChannelStats. SelectChannelStats(context.Context, string, ...any) ([]model.ChannelStats, 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) // SelectFunnelSteps selects funnel steps. SelectFunnelSteps(context.Context, string, ...any) ([]model.FunnelStep, error) }
Store is the database storage interface.