Documentation
¶
Index ¶
- Variables
- func ExtractMenu(html string) string
- func Initialize(ctx context.Context)
- func ParseMarkdown2HTML(md []byte) (cnt string)
- type Type
- func (s *Type) IsNameExists(name string) (bool, error)
- func (s *Type) LoadAllCategories() (cates []*model.Category, err error)
- func (s *Type) LoadCategoryByID(cateid bson.ObjectId) (cate *model.Category, err error)
- func (s *Type) LoadCategoryByName(name string) (cate *model.Category, err error)
- func (s *Type) LoadCategoryByURL(url string) (cate *model.Category, err error)
- func (s *Type) LoadPostInfo() (*dto.PostInfo, error)
- func (s *Type) LoadPostSeries(id bson.ObjectId, key string) (se []*model.PostSeries, err error)
- func (s *Type) LoadPosts(cfg *dto.PostCfg) (results []*model.Post, err error)
- func (s *Type) LoadUserByID(uid bson.ObjectId) (user *model.User, err error)
- func (s *Type) NewPost(authorID bson.ObjectId, title, name, md, ptype string) (post *model.Post, err error)
- func (s *Type) UpdatePost(user *model.User, name string, title string, md string, typeArg string) (p *model.Post, err error)
- func (s *Type) UpdatePostCategory(name, category string) (p *model.Post, err error)
- func (s *Type) ValidateAndGetUser(ctx context.Context) (user *model.User, err error)
- func (s *Type) ValidateLogin(account, password string) (u *model.User, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrLogin = errors.New("Password Or Username Incorrect")
Functions ¶
func ExtractMenu ¶
func Initialize ¶
func ParseMarkdown2HTML ¶
ParseMarkdown2HTML parse markdown to string
Types ¶
type Type ¶
type Type struct {
// contains filtered or unexported fields
}
var Instance *Type
func (*Type) LoadAllCategories ¶
func (*Type) LoadCategoryByID ¶
func (*Type) LoadCategoryByName ¶
func (*Type) LoadCategoryByURL ¶
func (*Type) LoadPostSeries ¶
func (*Type) LoadUserByID ¶
func (*Type) NewPost ¶
func (s *Type) NewPost(authorID bson.ObjectId, title, name, md, ptype string) (post *model.Post, err error)
NewPost insert new post
- title: post title
- name: post url
- md: post markdown content
- ptype: post type, markdown/slide
func (*Type) UpdatePost ¶
func (*Type) UpdatePostCategory ¶
UpdatePostCategory change blog post's category
func (*Type) ValidateAndGetUser ¶
Click to show internal directories.
Click to hide internal directories.