Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FetchWallpaper ¶
FetchWallpaper creates a FetchFunc for Wallpaper
func SetAutoMigrate ¶
func SetAutoMigrate(auto bool)
Types ¶
type Database ¶
type Database struct {
PublicSchema `goe:"public;prefix:t_"`
*goent.DB
}
Database represents the database connection.
type DetailData ¶
type DetailData struct {
GUID string `json:"guid"`
Date string `json:"date"`
Title string `json:"title"`
Copyright string `json:"copyright"`
Headline string `json:"headline"`
Description string `json:"description"`
Filepath string `json:"filepath"`
}
DetailData represents the data section of the detail API response
type ListResponseData ¶
type ListResponseData struct {
Page int `json:"page"`
PageCount int `json:"pageCount"`
DataCount int `json:"dataCount"`
PageSize int `json:"pageSize"`
Data []WallpaperRaw `json:"data"`
}
ListResponseData represents the data section of the list API response
type PublicSchema ¶
PublicSchema contains all table definitions
type Wallpaper ¶
type Wallpaper struct {
ID int64 `goe:"pk"` // Primary key, auto increment
GUID string `json:"guid" goe:"column:guid"` // Unique identifier
Date string `json:"date" goe:"unique"` // Date, unique
Slug string `json:"slug"` // Image ID without OHR. prefix and resolution
Title string `json:"title"` // Title
Headline string `json:"headline"` // Headline
Copyright string `json:"copyright"` // Copyright
Description *string `json:"description"` // Description
ImageDPI string `json:"image_dpi" goe:"column:image_dpi"` // Resolution, e.g. "1920x1080"
FileSize int64 `json:"file_size" goe:"default:0"` // File size in KB
}
Wallpaper represents the wallpapers table
func (*Wallpaper) ScanDest ¶
ScanDest returns a slice of pointers to Wallpaper fields for database scanning
func (*Wallpaper) UpdatePairs ¶
UpdatePairs returns a slice of Pair for updating non-primary key fields
type WallpaperRaw ¶
type WallpaperRaw struct {
GUID string `json:"guid"`
Date string `json:"date"`
Title string `json:"title"`
Copyright string `json:"copyright"`
Headline string `json:"headline"`
Filepath string `json:"filepath"`
Description string `json:"description"`
}
WallpaperRaw represents the raw data from the API
type WiliiDetailResponse ¶
type WiliiDetailResponse struct {
Status int `json:"status"`
Success bool `json:"success"`
Msg string `json:"msg"`
Response DetailData `json:"response"`
}
WiliiDetailResponse represents the response from the detail API
type WiliiListResponse ¶
type WiliiListResponse struct {
Status int `json:"status"`
Success bool `json:"success"`
Msg string `json:"msg"`
Response ListResponseData `json:"response"`
}
WiliiListResponse represents the response from the list API
Click to show internal directories.
Click to hide internal directories.