Documentation
¶
Index ¶
Constants ¶
View Source
const ( Active = "active" Pending = "pending" Expired = "expired" )
View Source
const ( RoleUser = "user" RoleAdmin = "admin" )
Variables ¶
This section is empty.
Functions ¶
func GenerateSlug ¶
func TransformPassword ¶
func VerifyPassword ¶
Types ¶
type PropertyMap ¶
type PropertyMap map[string]interface{}
PropertyMap is the type for our properties field
func (PropertyMap) Merge ¶
func (lhs PropertyMap) Merge(rhs PropertyMap)
Merge trees represented as PropertyMap from rhs into lhs with keys from rhs taking precedent.
func (*PropertyMap) Scan ¶
func (p *PropertyMap) Scan(src interface{}) error
Scan is the second interface (sql.Scanner), which takes the raw data from the database
and transforms it to our type (unmarshal the JSONB([]byte) to PropertyMap type)
type URL ¶
type URL struct {
Url string `json:"url" db:"url"`
Slug string `json:"slug" db:"slug"`
IP string `json:"ip" db:"ip"`
Counter int `json:"counter" db:"counter"`
Created time.Time `json:"created" db:"created"`
Updated null.Time `json:"updated" db:"updated"`
Status string `json:"status" db:"status"`
Password string `json:"-" db:"password"`
Expired null.Time `json:"expired" db:"expired"`
Mindful bool `json:"mindful" db:"mindful"`
Username string `json:"username" db:"username"`
}
type URLStat ¶
type URLStat struct {
Slug string `json:"slug" db:"slug"`
Country string `json:"country" db:"country"`
State string `json:"state" db:"state"`
Counter int `json:"counter" db:"counter"`
Properties PropertyMap `json:"properties" db:"properties"`
Created time.Time `json:"created" db:"created"`
Updated null.Time `json:"updated" db:"updated"`
}
type User ¶
type User struct {
Username string `json:"username" db:"username"`
Role string `json:"role" db:"role"`
Password string `json:"-" db:"password"`
Status string `json:"status" db:"status"`
Properties PropertyMap `json:"properties" db:"properties"`
Created time.Time `json:"created" db:"created"`
Updated null.Time `json:"updated" db:"updated"`
}
Click to show internal directories.
Click to hide internal directories.