Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assets ¶
type Assets struct {
Dist http.FileSystem
Img http.FileSystem
}
type Config ¶
type Config struct {
HostPort string
DBPath string
LitestreamYml string
Startup time.Time
DevFileServer bool
}
Config is the type definition of the JSON config file.
type Link ¶
type Link struct {
bun.BaseModel `bun:"table:links,alias:l"`
ShortLink string `bun:"short_link,pk"`
FullURL string `bun:"full_url,notnull"`
UserID int64 `bun:"user_id,notnull"`
CreatedAt time.Time `bun:"created_at,nullzero,notnull"`
UpdatedAt time.Time `bun:"updated_at,nullzero,notnull"`
User *User `bun:"rel:has-one,join:user_id=id"`
Visits []*LinkVisit `bun:"rel:has-many,join:short_link=short_link"`
VisitsCount int64 `bun:"visits_count,scanonly"`
}
type Request ¶
type Request struct {
*Context
Writer http.ResponseWriter
Request *http.Request
Params httprouter.Params
Session *Session
PreviousSession *Session
User *User
}
func (*Request) PreviousCSRFToken ¶
PreviousCSRFToken returns the CSRF token for the potentially rotated out session.
type User ¶
type User struct {
bun.BaseModel `bun:"table:users,alias:u"`
ID int64 `bun:"id,pk,autoincrement"`
DisplayName string `bun:"display_name,notnull"`
UserName string `bun:"user_name,unique"`
HashedPassword string `bun:"hashed_password,notnull"`
CreatedAt time.Time `bun:"created_at,nullzero,notnull"`
UpdatedAt time.Time `bun:"updated_at,nullzero,notnull"`
}
Click to show internal directories.
Click to hide internal directories.