Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrShortyNotFound = errors.New("shorty not found") ErrShortyExists = errors.New("shorty already exist") )
Functions ¶
This section is empty.
Types ¶
type Shorty ¶
type Shorty struct { ID string `json:"id" db:"id"` URL string `json:"url" db:"url"` Visits []Visit `json:"visits" db:"visits"` CreatedAt *time.Time `json:"created_at" db:"created_at"` UpdatedAt *time.Time `json:"updated_at" db:"updated_at"` }
func (*Shorty) BeforeCreate ¶
func (s *Shorty) BeforeCreate()
func (*Shorty) BeforeUpdate ¶
func (s *Shorty) BeforeUpdate()
type ShortyInput ¶
type Visit ¶
type Visit struct { ShortyID string `json:"shorty_id" db:"shorty_id"` Referer string `json:"referer" db:"referer"` UserIP string `json:"user_ip" db:"user_ip"` UserAgent string `json:"user_agent" db:"user_agent"` CreatedAt *time.Time `json:"created_at" db:"created_at"` UpdatedAt *time.Time `json:"updated_at" db:"updated_at"` }
func (*Visit) BeforeCreate ¶
func (v *Visit) BeforeCreate()
Click to show internal directories.
Click to hide internal directories.