Documentation ¶
Index ¶
- Variables
- func All()
- func CleanTokens()
- func CreateComment(cid int, c *Comment)
- func CreateFilePath(dir string, f *File) string
- func CreateReader(c *Comment)
- func CreateUser(u *User) error
- func DefaultNavigators()
- func GetCustomSettings() map[string]string
- func GetNavigators() []*navItem
- func GetSetting(key string) string
- func GetVersion() *version
- func Init(v int)
- func LoadComments()
- func LoadContents()
- func LoadFiles()
- func LoadMessages()
- func LoadNavigators()
- func LoadReaders()
- func LoadSettings()
- func LoadTokens()
- func LoadUsers()
- func RecycleComments()
- func RecycleMessages()
- func RemoveComment(cid int, id int)
- func RemoveContent(c *Content)
- func RemoveFile(id int)
- func RemoveToken(v string)
- func RemoveUser(u *User)
- func SaveComment(c *Comment)
- func SaveContent(c *Content)
- func SaveMessageRead(m *Message)
- func SetMessageGenerator(name string, fn func(v interface{}) string)
- func SetNavigators(order []string, text []string, title []string, link []string)
- func SetSetting(key string, v string)
- func SortNavigators()
- func StartCommentsTimer()
- func StartContentsTimer()
- func StartMessageTimer()
- func SyncAll()
- func SyncContent(c *Content)
- func SyncContents()
- func SyncFiles()
- func SyncMessages()
- func SyncNavigators()
- func SyncReaders()
- func SyncSettings()
- func SyncTokens()
- func SyncUsers()
- func SyncVersion()
- func UpdateCommentAdmin(user *User)
- type Comment
- type Content
- func CreateContent(c *Content, t string) (*Content, error)
- func GetArticleList(page, size int) ([]*Content, *utils.Pager)
- func GetContentById(id int) *Content
- func GetContentBySlug(slug string) *Content
- func GetPageList(page, size int) ([]*Content, *utils.Pager)
- func GetPublishArticleList(page, size int) ([]*Content, *utils.Pager)
- type File
- type Message
- type Reader
- type Statis
- type Token
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Storage *jsonStorage
)
Functions ¶
func CreateComment ¶
func CreateFilePath ¶
func CreateReader ¶
func CreateReader(c *Comment)
func DefaultNavigators ¶ added in v0.2.0
func DefaultNavigators()
func GetCustomSettings ¶
func GetNavigators ¶ added in v0.2.0
func GetNavigators() []*navItem
func GetSetting ¶
func GetVersion ¶ added in v0.1.5
func GetVersion() *version
func LoadComments ¶
func LoadComments()
func LoadMessages ¶ added in v0.2.0
func LoadMessages()
func LoadNavigators ¶ added in v0.2.0
func LoadNavigators()
func LoadReaders ¶
func LoadReaders()
func LoadSettings ¶
func LoadSettings()
func RecycleComments ¶ added in v0.2.0
func RecycleComments()
func RecycleMessages ¶ added in v0.2.0
func RecycleMessages()
func RemoveComment ¶
func RemoveContent ¶
func RemoveContent(c *Content)
remove a content. not delete file, just change status to DELETE. it can't be loaded in memory from json.
func RemoveFile ¶
func RemoveFile(id int)
func SaveComment ¶
func SaveComment(c *Comment)
func SaveMessageRead ¶ added in v0.2.0
func SaveMessageRead(m *Message)
func SetMessageGenerator ¶ added in v0.2.0
func SetNavigators ¶ added in v0.2.0
func SetSetting ¶
func SortNavigators ¶ added in v0.2.0
func SortNavigators()
func StartCommentsTimer ¶ added in v0.2.0
func StartCommentsTimer()
func StartContentsTimer ¶
func StartContentsTimer()
func StartMessageTimer ¶ added in v0.2.0
func StartMessageTimer()
func SyncMessages ¶ added in v0.2.0
func SyncMessages()
func SyncNavigators ¶ added in v0.2.0
func SyncNavigators()
func SyncReaders ¶
func SyncReaders()
func SyncSettings ¶
func SyncSettings()
func SyncVersion ¶ added in v0.1.5
func SyncVersion()
func UpdateCommentAdmin ¶ added in v0.2.0
func UpdateCommentAdmin(user *User)
Types ¶
type Comment ¶
type Comment struct { Id int Author string Email string Url string Avatar string Content string CreateTime int64 Cid int Pid int Status string Ip string UserAgent string IsAdmin bool }
func GetCommentById ¶
func (*Comment) GetContent ¶
func (*Comment) IsRemovable ¶ added in v0.2.0
type Content ¶
type Content struct { Id int Title string Slug string Text string //Category string Tags []string CreateTime int64 EditTime int64 UpdateTime int64 IsComment bool IsLinked bool AuthorId int Template string Type string Status string Format string Comments []*Comment Hits int }
func GetArticleList ¶
get articles list.
func GetPublishArticleList ¶ added in v0.2.0
func (*Content) ChangeSlug ¶
change slug and check unique.
type File ¶
type File struct { Id int Name string UploadTime int64 Url string ContentType string Author int IsUsed bool Size int64 Type string Hits int }
func CreateFile ¶
type Message ¶ added in v0.2.0
func CreateMessage ¶ added in v0.2.0
func GetMessage ¶ added in v0.2.0
func GetMessages ¶ added in v0.2.0
func GetMessages() []*Message
func GetTypedMessages ¶ added in v0.2.0
func GetUnreadMessages ¶ added in v0.2.0
func GetUnreadMessages() []*Message
type Token ¶
func CreateToken ¶
create new token from user and context.
Click to show internal directories.
Click to hide internal directories.