models

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redir

type Redir struct {
	ID        string    `json:"-"          yaml:"-"          bson:"_id"`
	Alias     string    `json:"alias"      yaml:"alias"      bson:"alias"`
	URL       string    `json:"url"        yaml:"url"        bson:"url"`
	Private   bool      `json:"private"    yaml:"private"    bson:"private"`
	Trust     bool      `json:"trust"      yaml:"trust"      bson:"trust"`
	ValidFrom time.Time `json:"valid_from" yaml:"valid_from" bson:"valid_from"`
	CreatedBy string    `json:"created_by" yaml:"created_by" bson:"created_by"`
	UpdatedBy string    `json:"updated_by" yaml:"updated_by" bson:"updated_by"`
	CreatedAt time.Time `json:"-"          yaml:"created_at" bson:"created_at"`
	UpdatedAt time.Time `json:"-" yaml:"updated_at" bson:"updated_at"`
}

Redir is the core redir model, it records a kind of alias and its correlated link.

type RedirIndex

type RedirIndex struct {
	ID        string    `json:"-"          yaml:"-"          bson:"_id"`
	Alias     string    `json:"alias"      yaml:"alias"      bson:"alias"`
	URL       string    `json:"url"        yaml:"url"        bson:"url"`
	Private   bool      `json:"private"    yaml:"private"    bson:"private"`
	Trust     bool      `json:"trust"      yaml:"trust"      bson:"trust"`
	ValidFrom time.Time `json:"valid_from" yaml:"valid_from" bson:"valid_from"`
	CreatedBy string    `json:"created_by" yaml:"created_by" bson:"created_by"`
	UpdatedBy string    `json:"updated_by" yaml:"updated_by" bson:"updated_by"`
	CreatedAt time.Time `json:"-"          yaml:"created_at" bson:"created_at"`
	UpdatedAt time.Time `json:"-"          yaml:"updated_at" bson:"updated_at"`
	UV        int64     `json:"uv"         yaml:"uv"         bson:"uv"`
	PV        int64     `json:"pv"         yaml:"pv"         bson:"pv"`
}

RedirIndex is an extension to Redir, which offers more statistic information such as PV/UV.

type RefStat

type RefStat struct {
	Referer string `json:"referer" bson:"referer"`
	Count   int64  `json:"count"   bson:"count"`
}

Referrer statistic

type TimeHist

type TimeHist struct {
	Time time.Time `bson:"time" json:"time"`
	PV   int       `bson:"pv"   json:"pv"`
	UV   int       `bson:"uv"   json:"uv"`
}

TimeHist statistics

type UAStat

type UAStat struct {
	UA    string `json:"ua"    bson:"ua"`
	Count int64  `json:"count" bson:"count"`
}

UAStat statistics

type Visit

type Visit struct {
	VisitorID string    `json:"visitor_id" bson:"visitor_id"`
	Alias     string    `json:"alias"      bson:"alias"`
	IP        string    `json:"ip"         bson:"ip"`
	UA        string    `json:"ua"         bson:"ua"`
	Referer   string    `json:"referer"    bson:"referer"`
	Time      time.Time `json:"time"       bson:"time"`
}

Visit indicates an record of visit pattern.

type VisitRecord

type VisitRecord struct {
	Alias string `json:"alias" bson:"alias"`
	UV    int64  `json:"uv"    bson:"uv"`
	PV    int64  `json:"pv"    bson:"pv"`
}

VisitRecord represents the visit record of an alias. The record does not contain time range so that the user of this struct can customize it.

Jump to

Keyboard shortcuts

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