entities

package
v0.0.0-...-96dbec4 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2020 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 Action

type Action int

type AnalyticsActionRequest

type AnalyticsActionRequest struct {
	Action Action `json:"action"`
	Year   date   `json:"year"`
	Month  date   `json:"month"`
	Day    date   `json:"day"`
	Hour   date   `json:"hour"`
}

type AnalyticsActionResponse

type AnalyticsActionResponse struct {
	Year           int      `json:"y" bson:"y, omitempty"`
	Month          int      `json:"m" bson:"m, omitempty"`
	Day            int      `json:"d" bson:"d, omitempty"`
	Hour           int      `json:"h" bson:"h, omitempty"`
	Visitors       []string `json:"v" bson:"v, omitempty"`
	UniqueVisitors []string `json:"uv" bson:"uv, omitempty"`
}

type Login

type Login struct {
	Email    string `json:"email" bson:"email"`
	Password string `json:"password" bson:"password"`
}

type Token

type Token struct {
	Token   string
	Uuid    string
	Expires int64
	UserId  string
	Role    string
	Type    string
}

type TokenResponse

type TokenResponse struct {
	AccessToken  *Token `json:"at"`
	RefreshToken *Token `json:"rt"`
}

type Trace

type Trace struct {
	ID        primitive.ObjectID `json:"id" bson:"_id,omitempty"`
	IP        string             `json:"ip" bson:"ip"`
	Location  string             `json:"loc" bson:"loc"`
	TimeStamp int64              `json:"ts" bson:"ts"`
	Year      int                `json:"y" bson:"y"`
	Month     int                `json:"m" bson:"m"`
	Day       int                `json:"d" bson:"d"`
	Hour      int                `json:"h" bson:"h"`
	Agent     string             `json:"a" bson:"a"`
	Action    Action             `json:"act" bson:"act"`
	Tag       string             `json:"tag" bson:"tag"`
}

func ToTrace

func ToTrace(traceDto *TraceDTO) *Trace

type TraceDTO

type TraceDTO struct {
	ID       primitive.ObjectID `json:"id" bson:"_id"`
	IP       string             `json:"ip"`
	Location string             `json:"loc"`
	Agent    string             `json:"a"`
	Action   Action             `json:"act"`
	Tag      string             `json:"tag"`
}

func ToTraceDTO

func ToTraceDTO(trace *Trace) *TraceDTO

func ToTraceDTOs

func ToTraceDTOs(traces []*Trace) []*TraceDTO

type User

type User struct {
	ID       primitive.ObjectID `json:"id" bson:"_id,omitempty"`
	Name     string             `json:"name" bson:"name"`
	Email    string             `json:"email" bson:"email"`
	Password string             `json:"password" bson:"password"`
}

type UserResponse

type UserResponse struct {
	Name  string `json:"name" bson:"name"`
	Email string `json:"email" bson:"email"`
}

Jump to

Keyboard shortcuts

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