analytics

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 11 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAnalyticsErr     = fmt.Errorf("analytics error")
	ErrInvalidPageSize  = errors.Wrap(ErrAnalyticsErr, "invalid page size")
	ErrInvalidKey       = errors.Wrap(ErrAnalyticsErr, "invalid key")
	ErrSortNotSupported = errors.Wrap(ErrAnalyticsErr, "sort parameter not supported")
)

Functions

This section is empty.

Types

type AnalyticsRepository

type AnalyticsRepository interface {
	QueryTopResultsByKey(ctx context.Context, params QueryTopResultsByKeyParams) (*QueryResults, error)
	QueryMostRecentResultsByKey(ctx context.Context, params QueryTopResultsByKeyParams) (*QueryResults, error)
	ParseAndStore(context.Context, uuid.UUID, string) error
	GetCountOverTime(ctx context.Context, params QueryTopResultsByKeyParams) (*CountOverTimeResults, error)
}

func NewAnalyticsRepository

func NewAnalyticsRepository(d db.Analytics) AnalyticsRepository

type CountOverTime added in v0.5.13

type CountOverTime struct {
	Time  time.Time
	Count int64
}

type CountOverTimeResults added in v0.5.13

type CountOverTimeResults struct {
	Results []CountOverTime
	Total   int64
}

type QueryResult added in v0.5.13

type QueryResult struct {
	Key   string
	Value interface{}
}

type QueryResults added in v0.5.13

type QueryResults struct {
	Results []QueryResult
	Total   int64
}

type QueryTopResultsByKeyParams

type QueryTopResultsByKeyParams struct {
	Key        string
	PageSize   int
	PageNumber int
	Sort       string
}

func NewQueryTopResultsByKeyParams added in v0.5.13

func NewQueryTopResultsByKeyParams() QueryTopResultsByKeyParams

Jump to

Keyboard shortcuts

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