models

package
v0.0.0-...-0a9b7e3 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountHistoriesByTrackID

func CountHistoriesByTrackID(ctx context.Context, db *database.Database, trackId string) (int, error)

func DeleteHistoriesByTrackID

func DeleteHistoriesByTrackID(ctx context.Context, db *database.Database, trackId string) error

func DeleteTrackByTrackID

func DeleteTrackByTrackID(ctx context.Context, db *database.Database, trackId string) error

Types

type History

type History struct {
	UniqueId  string    `datastore:"uniqueId" json:"unique_id"`
	TrackId   string    `datastore:"trackId" json:"track_id"`
	Ip        string    `datastore:"ip" json:"ip"`
	UserAgent string    `datastore:"useragent" json:"useragent"`
	Date      time.Time `datastore:"date" json:"time"`
}

func GetHistoriesByTrackID

func GetHistoriesByTrackID(ctx context.Context, db *database.Database, trackId string, limit int) ([]History, error)

func (*History) Add

func (c *History) Add(ctx context.Context, db *database.Database) error

type Track

type Track struct {
	TrackId     string    `datastore:"trackId"`
	AccessKey   string    `datastore:"accessKey"`
	RedirectUrl string    `datastore:"redirectUrl"`
	Create      time.Time `datastore:"create"`
}

func GetTrackByTrackID

func GetTrackByTrackID(ctx context.Context, db *database.Database, trackId string) (*Track, error)

func (*Track) Add

func (c *Track) Add(ctx context.Context, db *database.Database) error

Jump to

Keyboard shortcuts

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