Documentation ¶
Index ¶
Constants ¶
View Source
const Untitled = `无标题`
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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"` DateTimezone string ModifiedTimezone string }
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 DateTimezone string ModifiedTimezone string }
Post ...
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"` Origin *proto.Metas_Origin `json:"origin:omitempty" yaml:"origin,omitempty"` }
NOTE 如果要添加字段,记得同步 isEmpty 方法。
func PostMetaFrom ¶
type PostMetaSource ¶
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.