publish

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregatedFields

type AggregatedFields map[string]int64

type AggregatedFieldsByDate

type AggregatedFieldsByDate map[string]AggregatedFields

type ApiInstallation

type ApiInstallation struct {
	Id        int64       `json:"id"`
	Uid       string      `json:"uid"`
	FirstSeen time.Time   `json:"first_seen"`
	LastSeen  time.Time   `json:"last_seen"`
	LastIp    string      `json:"last_ip"`
	Record    interface{} `json:"record"`
}

type ApiRecord

type ApiRecord struct {
	Id     int64       `json:"id"`
	Uid    string      `json:"uid"`
	Ts     time.Time   `json:"ts"`
	Record interface{} `json:"record"`
}

type Postgres

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

func NewPostgres

func NewPostgres(c *cli.Context) *Postgres

func (*Postgres) GetAccountHash

func (p *Postgres) GetAccountHash(user string) (string, error)

func (*Postgres) GetActiveCountByDay

func (p *Postgres) GetActiveCountByDay() (AggregatedFields, error)

func (*Postgres) GetActiveInstalls

func (p *Postgres) GetActiveInstalls(hours int) ([]ApiInstallation, error)

func (*Postgres) GetAllInstalls

func (p *Postgres) GetAllInstalls() ([]ApiInstallation, error)

func (*Postgres) GetRecordById

func (p *Postgres) GetRecordById(id string) (ApiRecord, error)

func (*Postgres) GetRecordsByDay added in v0.6.0

func (p *Postgres) GetRecordsByDay(day string) ([]ApiInstallation, error)

func (*Postgres) GetRecordsByUid

func (p *Postgres) GetRecordsByUid(uid string, days int) ([]ApiRecord, error)

func (*Postgres) GetRecordsGroupedByDay

func (p *Postgres) GetRecordsGroupedByDay(days int) (RecordsByDateByUid, error)

func (*Postgres) Ping

func (p *Postgres) Ping() error

func (*Postgres) Report

func (p *Postgres) Report(r record.Record, clientIp string) error

func (*Postgres) SumByDay

func (p *Postgres) SumByDay(days int, fields []string, uid string) (AggregatedFieldsByDate, error)

func (*Postgres) SumByDayMap

func (p *Postgres) SumByDayMap(days int, field string, uid string) (AggregatedFieldsByDate, error)

func (*Postgres) SumByDayValue

func (p *Postgres) SumByDayValue(days int, field string, uid string) (AggregatedFieldsByDate, error)

func (*Postgres) SumOfActiveInstalls

func (p *Postgres) SumOfActiveInstalls(hours int, fields []string) (AggregatedFields, error)

func (*Postgres) SumOfActiveInstallsMap

func (p *Postgres) SumOfActiveInstallsMap(hours int, field string) (AggregatedFields, error)

func (*Postgres) SumOfActiveInstallsValue

func (p *Postgres) SumOfActiveInstallsValue(hours int, field string) (AggregatedFields, error)

type RecordsByDateByUid

type RecordsByDateByUid map[string]RecordsByUid

type RecordsByUid

type RecordsByUid map[string]ApiRecord

type ToUrl

type ToUrl struct {
	// contains filtered or unexported fields
}

func NewToUrl

func NewToUrl(c *cli.Context) *ToUrl

func (*ToUrl) Report

func (p *ToUrl) Report(r record.Record, clientIp string) error

Jump to

Keyboard shortcuts

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