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 GetCustomSettings() map[string]string
- func GetSetting(key string) string
- func GetVersion() *version
- func Init(v int)
- func LoadComments()
- func LoadContents()
- func LoadFiles()
- func LoadReaders()
- func LoadSettings()
- func LoadTokens()
- func LoadUsers()
- 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 SetSetting(key string, v string)
- func StartContentsTimer()
- func SyncContent(c *Content)
- func SyncContents()
- func SyncFiles()
- func SyncReaders()
- func SyncSettings()
- func SyncTokens()
- func SyncUsers()
- func SyncVersion()
- type Comment
- type Content
- type File
- 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 GetCustomSettings ¶
func GetSetting ¶
func GetVersion ¶
func GetVersion() *version
func LoadComments ¶
func LoadComments()
func LoadReaders ¶
func LoadReaders()
func LoadSettings ¶
func LoadSettings()
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 SetSetting ¶
func StartContentsTimer ¶
func StartContentsTimer()
func SyncReaders ¶
func SyncReaders()
func SyncSettings ¶
func SyncSettings()
func SyncVersion ¶
func SyncVersion()
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 ¶
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 (*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 Token ¶
func CreateToken ¶
create new token from user and context.
Click to show internal directories.
Click to hide internal directories.