analytics

package
v0.5.13 Latest Latest
Warning

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

Go to latest
Published: May 3, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

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