models

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CachedLink struct {
	ID        string       `db:"id" json:"id"`
	Url       string       `db:"url" json:"url"`
	ExpiredAt sql.NullTime `db:"expires_at" json:"expires_at"`
}

type Click

type Click struct {
	LinkID    string    `db:"link_id" json:"link_id"`
	Ip        string    `db:"ip" json:"ip"`
	Referer   string    `db:"referer" json:"referer"`
	UserAgent string    `db:"user_agent" json:"user_agent"`
	ClickedAt time.Time `db:"clicked_at" json:"clicked_at"`
}

type Config

type Config struct {
	Username       string `db:"admin_username" json:"username"`
	HashedPassword string `db:"admin_password" json:"-"`

	CreatedAt time.Time `db:"created_at" json:"created_at"`
	UpdatedAt time.Time `db:"updated_at" json:"updated_at"`
}

type ConfigureUserData

type ConfigureUserData struct {
	Username   string `json:"username" binding:"required,gte=3,alphanumunicode"`
	Password   string `json:"password" binding:"required,gte=6"`
	RememberMe bool   `json:"remember_me"`
}
type Link struct {
	ID          string       `db:"id" json:"id"`
	Url         string       `db:"url" json:"url"`
	TotalClicks int          `db:"total_clicks" json:"total_clicks"`
	CreatedAt   time.Time    `db:"created_at" json:"created_at"`
	ExpiredAt   sql.NullTime `db:"expires_at" json:"expires_at"`
	UpdatedAt   time.Time    `db:"updated_at" json:"updated_at"`
}

type LinkWithStats

type LinkWithStats struct {
	ID             string    `db:"id" json:"id"`
	Url            string    `db:"url" json:"url"`
	TotalClicks    int       `db:"total_clicks" json:"total_clicks"`
	UniqueVisitors int       `db:"unique_visitors" json:"unique_visitors"`
	CreatedAt      time.Time `db:"created_at" json:"created_at"`
}

type Stats

type Stats struct {
	TotalClicks    int    `db:"total_clicks" json:"total_clicks"`
	UniqueVisitors string `db:"unique_visitors" json:"unique_visitors"`
}

type UpdateConfigData

type UpdateConfigData struct {
	Username string `db:"admin_username" json:"username"`
	Password string `db:"admin_password" json:"password"`
}

Jump to

Keyboard shortcuts

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