Documentation ¶
Overview ¶
Package models provides models for controllers
Index ¶
- type Directory
- type DirectoryModel
- type DirectoryType
- type FavoriteModel
- type FavoriteType
- type FavoritedModel
- type FavoritedType
- type FavoritesHeader
- type FavoritesModel
- type FavoritesType
- type ImageHeader
- type ImageModel
- type ImageTags
- type ImageType
- type Imageboard
- type ImageboardsModel
- type ImageboardsType
- type IndexModel
- type IndexThreadHeader
- type IndexType
- type NewModel
- type NewType
- type OnlyImage
- type PopularModel
- type PopularType
- type Post
- type PostModel
- type PostType
- type RandomModel
- type TagHeader
- type TagModel
- type TagSearchModel
- type TagSearchType
- type TagType
- type TagTypes
- type TagTypesModel
- type TagTypesType
- type Tags
- type TagsModel
- type TagsType
- type ThreadIds
- type ThreadInfo
- type ThreadModel
- type ThreadPosts
- type ThreadSearchModel
- type ThreadSearchType
- type ThreadType
- type UserInfo
- type UserType
- type WhoAmIModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Directory ¶
type Directory struct { ID uint `json:"id"` Title string `json:"title"` Closed bool `json:"closed"` Sticky bool `json:"sticky"` Posts uint `json:"postcount"` Pages uint `json:"pages"` Last *time.Time `json:"last_post"` Images uint `json:"images"` }
Directory holds the thread entries for the directory page
type DirectoryModel ¶
type DirectoryModel struct { Ib uint Page uint Result DirectoryType }
DirectoryModel holds the parameters from the request and also the key for the cache
func (*DirectoryModel) Get ¶
func (i *DirectoryModel) Get() (err error)
Get will gather the information from the database and return it as JSON serialized data
type DirectoryType ¶
type DirectoryType struct {
Body u.PagedResponse `json:"directory"`
}
DirectoryType is the top level of the JSON response
type FavoriteModel ¶
type FavoriteModel struct { User uint ID uint Result FavoriteType }
FavoriteModel holds the parameters from the request and also the key for the cache
func (*FavoriteModel) Get ¶
func (i *FavoriteModel) Get() (err error)
Get will gather the information from the database and return it as JSON serialized data
type FavoriteType ¶
type FavoriteType struct {
Starred bool `json:"starred"`
}
FavoriteType is the top level of the JSON response
type FavoritedModel ¶
type FavoritedModel struct { Ib uint Result FavoritedType }
FavoritedModel holds the parameters from the request and also the key for the cache
func (*FavoritedModel) Get ¶
func (i *FavoritedModel) Get() (err error)
Get will gather the information from the database and return it as JSON serialized data
type FavoritedType ¶
type FavoritedType struct {
Body []OnlyImage `json:"favorited,omitempty"`
}
FavoritedType is the top level of the JSON response
type FavoritesHeader ¶
type FavoritesHeader struct {
Images []OnlyImage `json:"images,omitempty"`
}
FavoritesHeader is the header for favorites page
type FavoritesModel ¶
type FavoritesModel struct { User uint Ib uint Page uint Result FavoritesType }
FavoritesModel holds the parameters from the request and also the key for the cache
func (*FavoritesModel) Get ¶
func (i *FavoritesModel) Get() (err error)
Get will gather the information from the database and return it as JSON serialized data
type FavoritesType ¶
type FavoritesType struct {
Body u.PagedResponse `json:"favorites"`
}
FavoritesType is the top level of the JSON response
type ImageHeader ¶
type ImageHeader struct { ID uint `json:"id"` Thread uint `json:"thread"` PostNum uint `json:"post_num"` PostID uint `json:"post_id"` Prev *uint `json:"prev,omitempty"` Next *uint `json:"next,omitempty"` Width uint `json:"width"` Height uint `json:"height"` File string `json:"filename"` Tags []ImageTags `json:"tags,omitempty"` }
ImageHeader is the header for image page
type ImageModel ¶
ImageModel holds the parameters from the request and also the key for the cache
func (*ImageModel) Get ¶
func (i *ImageModel) Get() (err error)
Get will gather the information from the database and return it as JSON serialized data
type ImageType ¶
type ImageType struct {
Body ImageHeader `json:"image"`
}
ImageType is the top level of the JSON response
type Imageboard ¶
type Imageboard struct { ID uint `json:"id"` Title string `json:"title"` Description string `json:"description"` Domain string `json:"url"` Threads uint `json:"threads"` Posts uint `json:"posts"` Images uint `json:"images"` }
Imageboard has information and statistics about the boards on a pram
type ImageboardsModel ¶
type ImageboardsModel struct {
Result ImageboardsType
}
ImageboardsModel holds the parameters from the request and also the key for the cache
func (*ImageboardsModel) Get ¶
func (i *ImageboardsModel) Get() (err error)
Get will gather the information from the database and return it as JSON serialized data
type ImageboardsType ¶
type ImageboardsType struct {
Body []Imageboard `json:"imageboards"`
}
ImageboardsType is the top level of the JSON response
type IndexModel ¶
IndexModel holds the parameters from the request and also the key for the cache
func (*IndexModel) Get ¶
func (i *IndexModel) Get() (err error)
Get will gather the information from the database and return it as JSON serialized data
type IndexThreadHeader ¶
type IndexThreadHeader struct { ID uint `json:"id"` Title string `json:"title"` Closed bool `json:"closed"` Sticky bool `json:"sticky"` Total uint `json:"total"` Images uint `json:"images"` Pages uint `json:"pages"` Posts []ThreadPosts `json:"posts"` }
IndexThreadHeader holds the information for the threads
type IndexType ¶
type IndexType struct {
Body u.PagedResponse `json:"index"`
}
IndexType is the top level of the JSON response
type NewType ¶
type NewType struct {
Body []OnlyImage `json:"new,omitempty"`
}
NewType is the top level of the JSON response
type OnlyImage ¶
type OnlyImage struct { ID uint `json:"id"` File *string `json:"filename"` Thumb *string `json:"thumbnail"` ThumbHeight *uint `json:"tn_height"` ThumbWidth *uint `json:"tn_width"` }
OnlyImage struct for tag page
type PopularModel ¶
type PopularModel struct { Ib uint Result PopularType }
PopularModel holds the parameters from the request and also the key for the cache
func (*PopularModel) Get ¶
func (i *PopularModel) Get() (err error)
Get will gather the information from the database and return it as JSON serialized data
type PopularType ¶
type PopularType struct {
Body []OnlyImage `json:"popular,omitempty"`
}
PopularType is the top level of the JSON response
type Post ¶
type Post struct { ThreadID uint `json:"thread_id"` PostID uint `json:"post_id"` Num uint `json:"num"` Name string `json:"name"` UID uint `json:"uid"` Group uint `json:"group"` Time *time.Time `json:"time"` Text *string `json:"comment"` ImageID *uint `json:"img_id,omitempty"` File *string `json:"filename,omitempty"` Thumb *string `json:"thumbnail,omitempty"` ThumbHeight *uint `json:"tn_height,omitempty"` ThumbWidth *uint `json:"tn_width,omitempty"` }
Post holds the post information
type PostType ¶
type PostType struct {
Body Post `json:"post"`
}
PostType is the top level of the JSON response
type RandomModel ¶ added in v1.3.0
RandomModel holds the parameters from the request and also the key for the cache
func (*RandomModel) Get ¶ added in v1.3.0
func (i *RandomModel) Get() (err error)
Get will gather the information from the database and return it as JSON serialized data
type TagHeader ¶
type TagHeader struct { ID uint `json:"id"` Tag *string `json:"tag"` Type *uint `json:"type"` Images []OnlyImage `json:"images,omitempty"` }
TagHeader is the header for the tag page
type TagSearchModel ¶
type TagSearchModel struct { Ib uint Term string Result TagSearchType }
TagSearchModel holds the parameters from the request and also the key for the cache
func (*TagSearchModel) Get ¶
func (i *TagSearchModel) Get() (err error)
Get will gather the information from the database and return it as JSON serialized data
type TagSearchType ¶
type TagSearchType struct {
Body []Tags `json:"tagsearch"`
}
TagSearchType is the top level of the JSON response
type TagType ¶
type TagType struct {
Body u.PagedResponse `json:"tag"`
}
TagType is the top level of the JSON response
type TagTypesModel ¶
type TagTypesModel struct {
Result TagTypesType
}
TagTypesModel holds the parameters from the request and also the key for the cache
func (*TagTypesModel) Get ¶
func (i *TagTypesModel) Get() (err error)
Get will gather the information from the database and return it as JSON serialized data
type TagTypesType ¶
type TagTypesType struct {
Body []TagTypes `json:"tagtypes"`
}
TagTypesType is the top level of the JSON response
type Tags ¶
type Tags struct { ID uint `json:"id"` Tag string `json:"tag"` Total uint `json:"total"` Type uint `json:"type"` }
Tags struct
type TagsType ¶
type TagsType struct {
Body u.PagedResponse `json:"tags"`
}
TagsType is the top level of the JSON response
type ThreadInfo ¶
type ThreadInfo struct { ID uint `json:"id"` Title string `json:"title"` Closed bool `json:"closed"` Sticky bool `json:"sticky"` Posts []ThreadPosts `json:"posts"` }
ThreadInfo header for thread view
type ThreadModel ¶
type ThreadModel struct { Ib uint Thread uint Page uint Posts uint Result ThreadType }
ThreadModel holds the parameters from the request and also the key for the cache
func (*ThreadModel) Get ¶
func (i *ThreadModel) Get() (err error)
Get will gather the information from the database and return it as JSON serialized data
type ThreadPosts ¶
type ThreadPosts struct { ID uint `json:"id"` Num uint `json:"num"` Name string `json:"name"` UID uint `json:"uid"` Group uint `json:"group"` Time *time.Time `json:"time"` Text *string `json:"comment"` ImageID *uint `json:"img_id,omitempty"` File *string `json:"filename,omitempty"` Thumb *string `json:"thumbnail,omitempty"` ThumbHeight *uint `json:"tn_height,omitempty"` ThumbWidth *uint `json:"tn_width,omitempty"` }
ThreadPosts holds the posts for a thread
type ThreadSearchModel ¶
type ThreadSearchModel struct { Ib uint Term string Result ThreadSearchType }
ThreadSearchModel holds the parameters from the request and also the key for the cache
func (*ThreadSearchModel) Get ¶
func (i *ThreadSearchModel) Get() (err error)
Get will gather the information from the database and return it as JSON serialized data
type ThreadSearchType ¶
type ThreadSearchType struct {
Body []Directory `json:"threadsearch"`
}
ThreadSearchType is the top level of the JSON response
type ThreadType ¶
type ThreadType struct {
Body u.PagedResponse `json:"thread"`
}
ThreadType is the top level of the JSON response
type UserInfo ¶
type UserInfo struct { ID uint `json:"id"` Name string `json:"name"` Group uint `json:"group"` Authenticated bool `json:"authenticated"` Email *string `json:"email,omitempty"` LastActive time.Time `json:"last_active,omitempty"` }
UserInfo holds all the user metadata
type UserType ¶
type UserType struct {
Body UserInfo `json:"user"`
}
UserType is the top level of the JSON response
type WhoAmIModel ¶ added in v1.2.0
WhoAmIModel holds the parameters from the request and also the key for the cache
func (*WhoAmIModel) Get ¶ added in v1.2.0
func (i *WhoAmIModel) Get() (err error)
Get will gather the information from the database and return it as JSON serialized data