Documentation ¶
Index ¶
Constants ¶
View Source
const Untitled = `无标题`
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Category ¶
type Category struct { ID int64 `json:"id"` Name string `json:"name"` Slug string `json:"slug"` ParentID int64 `json:"parent"` Path string `json:"path"` Children []*Category `json:"children"` }
Category is a post category
type Comment ¶
type Comment struct { ID int64 `json:"id"` Parent int64 `json:"parent"` Root int64 `json:"root"` PostID int64 `json:"post_id"` Author string `json:"author"` Email string `json:"email"` URL string `json:"url"` IP string `json:"ip"` Date int32 `json:"date"` Modified int32 `json:"modified"` SourceType string `json:"source_type"` Source string `json:"source"` }
Comment in database.
type Geo ¶
type Geo struct { Name string `json:"name,omitempty" yaml:"name,omitempty"` // 地理位置的名字 Longitude float32 `json:"longitude,omitempty" yaml:"longitude,omitempty"` // 经度 Latitude float32 `json:"latitude,omitempty" yaml:"latitude,omitempty"` // 纬度 }
本来想用 GeoJSON 的,但是感觉标准化程度还不高。 想想还是算了,我只是想不丢失早期说说的地理位置信息。 那就用最简单的方式:经、纬度、名字,后期再升级吧。 https://geojson.org/ https://en.wikipedia.org/wiki/GeoJSON
type Post ¶
type Post struct { ID int64 Date int32 Modified int32 LastCommentedAt int32 Title string Slug string Type string Category uint Status string PageView uint CommentStatus uint Comments uint Metas PostMeta Source string SourceType string }
Post ...
type PostForRelated ¶
type PostMeta ¶
type PostMeta struct { Header string `json:"header,omitempty" yaml:"header,omitempty"` Outdated bool `json:"outdated,omitempty" yaml:"outdated,omitempty"` Wide bool `json:"wide,omitempty" yaml:"wide,omitempty"` Weixin string `json:"weixin,omitempty" yaml:"weixin,omitempty"` Sources map[string]*PostMetaSource `json:"sources,omitempty" yaml:"sources,omitempty"` Geo *Geo `json:"geo,omitempty" yaml:"geo,omitempty"` }
NOTE 如果要添加字段,记得同步 isEmpty 方法。
func PostMetaFrom ¶
func (*PostMeta) ToProtocols ¶
type PostMetaSource ¶
type Redirect ¶
type TagWithCount ¶
type TagWithCount struct { // taorm yet doesn't support embedded field scanning. Name string Count int64 }
TagWithCount is a tag with associated post count.
Click to show internal directories.
Click to hide internal directories.