Versions in this module Expand all Collapse all v0 v0.5.1 Jun 14, 2017 Changes in this version + var ErrLDAPConnect = errors.New("无法连接到LDAP服务器") + var ErrLDAPFirstBind = errors.New("第一次LDAP绑定失败") + var ErrLDAPSearch = errors.New("LDAP搜索失败") + var ErrLDAPUserNotFoundOrTooMany = errors.New("LDAP用户不存在或者多于一个") + var ErrMemberAccountFormatError = errors.New("账号只能由英文字母数字组成,且在3-50个字符") + var ErrMemberAuthMethodInvalid = errors.New("不支持此认证方式") + var ErrMemberDescriptionTooLong = errors.New("用户描述必须小于500字") + var ErrMemberEmailEmpty = errors.New("用户邮箱不能为空") + var ErrMemberEmailExist = errors.New("用户邮箱已被使用") + var ErrMemberEmailFormatError = errors.New("邮箱格式不正确") + var ErrMemberExist = errors.New("用户已存在") + var ErrMemberPasswordFormatError = errors.New("密码必须在6-50个字符之间") + var ErrMemberRoleError = errors.New("用户权限不正确") type Attachment + func (m *Attachment) Delete() error + func (m *Attachment) FindListByDocumentId(doc_id int) (attaches []*Attachment, err error) + func (m *Attachment) FindToPager(pageIndex, pageSize int) (attachList []*AttachmentResult, totalCount int64, err error) + type AttachmentResult struct + Account string + BookName string + DocumentName string + FileShortSize string + IsExist bool + LocalHttpPath string + func NewAttachmentResult() *AttachmentResult + func (m *AttachmentResult) Find(id int) (*AttachmentResult, error) type Book + func (m *Book) FindByIdentify(identify string) (*Book, error) type Document + AttachList []*Attachment + func (m *Document) FindListByBookId(book_id int) (docs []*Document, err error) + type DocumentHistory struct + Action string + ActionName string + Content string + DocumentId int + DocumentName string + HistoryId int + Markdown string + MemberId int + ModifyAt int + ModifyTime time.Time + ParentId int + Version int64 + func NewDocumentHistory() *DocumentHistory + func (m *DocumentHistory) Clear(doc_id int) error + func (m *DocumentHistory) Delete(history_id, doc_id int) error + func (m *DocumentHistory) Find(id int) (*DocumentHistory, error) + func (m *DocumentHistory) FindToPager(doc_id, page_index, page_size int) (docs []*DocumentHistorySimpleResult, totalCount int, err error) + func (m *DocumentHistory) InsertOrUpdate() (history *DocumentHistory, err error) + func (m *DocumentHistory) Restore(history_id, doc_id, uid int) error + func (m *DocumentHistory) TableEngine() string + func (m *DocumentHistory) TableName() string + func (m *DocumentHistory) TableNameWithPrefix() string + type DocumentHistorySimpleResult struct + Account string + ActionName string + HistoryId int + MemberId int + ModifyAt int + ModifyName string + ModifyTime time.Time + Version int64 type DocumentSearchResult + func (m *DocumentSearchResult) SearchDocument(keyword string, book_id int) (docs []*DocumentSearchResult, err error) type Logger + func (m *Logger) Add() error type Member + AuthMethod string + func (m *Member) Valid(is_hash_password bool) error + type Migration struct + CreateTime time.Time + MigrationId int + Name string + Statements string + Status string + Version int64 + func NewMigration() *Migration + func (m *Migration) FindFirst() (*Migration, error) + func (m *Migration) TableEngine() string + func (m *Migration) TableName() string + func (m *Migration) TableNameWithPrefix() string type Option + func (m *Option) Init() error type Relationship + func (m *Relationship) FindFounder(book_id int) (*Relationship, error) v0.1.5 May 10, 2017 v0.1.4 May 9, 2017 v0.1.3 May 9, 2017 v0.1.2 May 5, 2017 v0.1.1 May 4, 2017 Changes in this version + const Logger_Exception + const Logger_Operate + const Logger_System + var ErrCommentClosed = errors.New("评论已关闭") + var ErrCommentContentNotEmpty = errors.New("评论内容不能为空") + var ErrDataNotExist = errors.New("数据不存在") + var ErrInvalidParameter = errors.New("Invalid parameter") + var ErrMemberDisabled = errors.New("用户被禁用") + var ErrMemberNoExist = errors.New("用户不存在") + var ErrPermissionDenied = errors.New("Permission denied") + var ErrorMemberPasswordError = errors.New("用户密码错误") + func GetOptionValue(key, def string) string + type Attachment struct + AttachmentId int + BookId int + CreateAt int + CreateTime time.Time + DocumentId int + FileExt string + FileName string + FilePath string + FileSize float64 + HttpPath string + func NewAttachment() *Attachment + func (m *Attachment) Find(id int) (*Attachment, error) + func (m *Attachment) Insert() error + func (m *Attachment) TableEngine() string + func (m *Attachment) TableName() string + func (m *Attachment) TableNameWithPrefix() string + func (m *Attachment) Update() error + type Book struct + BookId int + BookName string + CommentCount int + CommentStatus string + Cover string + CreateTime time.Time + Description string + DocCount int + Editor string + Identify string + Label string + MemberId int + ModifyTime time.Time + OrderIndex int + PrivateToken string + PrivatelyOwned int + Status int + Theme string + Version int64 + func NewBook() *Book + func (book *Book) ToBookResult() *BookResult + func (m *Book) Find(id int) (*Book, error) + func (m *Book) FindByField(field string, value interface{}) ([]*Book, error) + func (m *Book) FindByFieldFirst(field string, value interface{}) (*Book, error) + func (m *Book) FindForHomeToPager(pageIndex, pageSize, member_id int) (books []*BookResult, totalCount int, err error) + func (m *Book) FindToPager(pageIndex, pageSize, memberId int) (books []*BookResult, totalCount int, err error) + func (m *Book) Insert() error + func (m *Book) ResetDocumentNumber(book_id int) + func (m *Book) TableEngine() string + func (m *Book) TableName() string + func (m *Book) TableNameWithPrefix() string + func (m *Book) ThoroughDeleteBook(id int) error + func (m *Book) Update(cols ...string) error + type BookResult struct + BookId int + BookName string + CommentCount int + CommentStatus string + Cover string + CreateName string + CreateTime time.Time + Description string + DocCount int + Editor string + Identify string + IsDisplayComment bool + Label string + LastModifyText string + MemberId int + ModifyTime time.Time + OrderIndex int + PrivateToken string + PrivatelyOwned int + RelationshipId int + RoleId int + RoleName string + Status int + Theme string + func NewBookResult() *BookResult + func (m *BookResult) FindByIdentify(identify string, member_id int) (*BookResult, error) + func (m *BookResult) FindToPager(pageIndex, pageSize int) (books []*BookResult, totalCount int, err error) + type Comment struct + AgainstCount int + AgreeCount int + Approved int + Author string + BookId int + CommentDate time.Time + CommentId int + Content string + DocumentId int + Floor int + IPAddress string + MemberId int + ParentId int + UserAgent string + func NewComment() *Comment + func (m *Comment) Find(id int) (*Comment, error) + func (m *Comment) Insert() error + func (m *Comment) TableEngine() string + func (m *Comment) TableName() string + func (m *Comment) TableNameWithPrefix() string + func (m *Comment) Update(cols ...string) error + type CommentResult struct + Author string + ReplyAccount string + func (m *CommentResult) FindForDocumentToPager(doc_id, page_index, page_size int) (comments []*CommentResult, totalCount int, err error) + type CommentVote struct + CommentId int + CommentMemberId int + CreateTime time.Time + VoteId int + VoteMemberId int + VoteState int + func NewCommentVote() *CommentVote + func (m *CommentVote) InsertOrUpdate() (*CommentVote, error) + func (m *CommentVote) TableEngine() string + func (m *CommentVote) TableName() string + func (m *CommentVote) TableNameWithPrefix() string + func (u *CommentVote) TableUnique() [][]string + type Dashboard struct + AttachmentNumber int64 + BookNumber int64 + CommentNumber int64 + DocumentNumber int64 + MemberNumber int64 + func NewDashboard() *Dashboard + func (m *Dashboard) Query() *Dashboard + type Document struct + BookId int + Content string + CreateTime time.Time + DocumentId int + DocumentName string + Identify string + Markdown string + MemberId int + ModifyAt int + ModifyTime time.Time + OrderSort int + ParentId int + Release string + Version int64 + func NewDocument() *Document + func (m *Document) CreateDocumentTreeForHtml(book_id, selected_id int) (string, error) + func (m *Document) Find(id int) (*Document, error) + func (m *Document) FindByFieldFirst(field string, v interface{}) (*Document, error) + func (m *Document) FindDocumentTree(book_id int) ([]*DocumentTree, error) + func (m *Document) InsertOrUpdate(cols ...string) error + func (m *Document) RecursiveDocument(doc_id int) error + func (m *Document) ReleaseContent(book_id int) + func (m *Document) TableEngine() string + func (m *Document) TableName() string + func (m *Document) TableNameWithPrefix() string + type DocumentSearchResult struct + Author string + BookId int + BookIdentify string + BookName string + CreateTime time.Time + Description string + DocumentId int + DocumentName string + Identify string + ModifyTime time.Time + func NewDocumentSearchResult() *DocumentSearchResult + func (m *DocumentSearchResult) FindToPager(keyword string, page_index, page_size, member_id int) (search_result []*DocumentSearchResult, total_count int, err error) + type DocumentSelected struct + Opened bool + Selected bool + type DocumentTree struct + BookIdentify string + DocumentId int + DocumentName string + Identify string + ParentId interface{} + State *DocumentSelected + Version int64 + type Logger struct + Category string + Content string + CreateTime time.Time + IPAddress string + LoggerId int64 + MemberId int + OriginalData string + PresentData string + UserAgent string + func NewLogger() *Logger + func (m *Logger) TableEngine() string + func (m *Logger) TableName() string + func (m *Logger) TableNameWithPrefix() string + type Member struct + Account string + Avatar string + CreateAt int + CreateTime time.Time + Description string + Email string + LastLoginTime time.Time + MemberId int + Password string + Phone string + Role int + RoleName string + Status int + func NewMember() *Member + func (c *Member) IsAdministrator() bool + func (m *Member) Add() error + func (m *Member) Find(id int) (*Member, error) + func (m *Member) FindByAccount(account string) (*Member, error) + func (m *Member) FindByFieldFirst(field string, value interface{}) (*Member, error) + func (m *Member) FindToPager(pageIndex, pageSize int) ([]*Member, int64, error) + func (m *Member) Login(account string, password string) (*Member, error) + func (m *Member) ResolveRoleName() + func (m *Member) TableEngine() string + func (m *Member) TableName() string + func (m *Member) TableNameWithPrefix() string + func (m *Member) Update(cols ...string) error + type MemberRelationshipResult struct + Account string + Avatar string + BookId int + CreateAt int + CreateTime time.Time + Description string + Email string + MemberId int + Phone string + RelationshipId int + Role int + RoleId int + RoleName string + Status int + func NewMemberRelationshipResult() *MemberRelationshipResult + func (m *MemberRelationshipResult) FindForUsersByBookId(book_id, pageIndex, pageSize int) ([]*MemberRelationshipResult, int, error) + func (m *MemberRelationshipResult) FromMember(member *Member) *MemberRelationshipResult + func (m *MemberRelationshipResult) ResolveRoleName() *MemberRelationshipResult + type MemberToken struct + Email string + IsValid bool + MemberId int + SendTime time.Time + Token string + TokenId int + ValidTime time.Time + func NewMemberToken() *MemberToken + func (m *MemberToken) FindByFieldFirst(field string, value interface{}) (*MemberToken, error) + func (m *MemberToken) FindSendCount(mail string, start_time time.Time, end_time time.Time) (int, error) + func (m *MemberToken) InsertOrUpdate() (*MemberToken, error) + func (m *MemberToken) TableEngine() string + func (m *MemberToken) TableName() string + func (m *MemberToken) TableNameWithPrefix() string + type Model struct + type Option struct + OptionId int + OptionName string + OptionTitle string + OptionValue string + Remark string + func NewOption() *Option + func (m *Option) TableEngine() string + func (m *Option) TableName() string + func (m *Option) TableNameWithPrefix() string + func (p *Option) All() ([]*Option, error) + func (p *Option) Find(id int) (*Option, error) + func (p *Option) FindByKey(key string) (*Option, error) + func (p *Option) InsertMulti(option ...Option) error + func (p *Option) InsertOrUpdate() error + type Relationship struct + BookId int + MemberId int + RelationshipId int + RoleId int + func NewRelationship() *Relationship + func (m *Relationship) DeleteByBookIdAndMemberId(book_id, member_id int) error + func (m *Relationship) Find(id int) (*Relationship, error) + func (m *Relationship) FindByBookIdAndMemberId(book_id, member_id int) (*Relationship, error) + func (m *Relationship) FindForRoleId(book_id, member_id int) (int, error) + func (m *Relationship) Insert() error + func (m *Relationship) TableEngine() string + func (m *Relationship) TableName() string + func (m *Relationship) TableNameWithPrefix() string + func (m *Relationship) Transfer(book_id, founder_id, receive_id int) error + func (m *Relationship) Update() error + func (m *Relationship) UpdateRoleId(book_id, member_id, role_id int) (*Relationship, error) + func (u *Relationship) TableUnique() [][]string