Documentation
¶
Index ¶
- Constants
- type DatabaseObject
- func (dbo *DatabaseObject) CountForumsById(forumId uint) (n int, err error)
- func (dbo *DatabaseObject) CountMessagesById(messageId uint) (n int, err error)
- func (dbo *DatabaseObject) CountRootSections() (n int, err error)
- func (dbo *DatabaseObject) CountSectionsById(sectionId uint) (n int, err error)
- func (dbo *DatabaseObject) CountThreadsById(threadId uint) (n int, err error)
- func (dbo *DatabaseObject) DeleteForumById(forumId uint) (err error)
- func (dbo *DatabaseObject) DeleteMessageById(messageId uint) (err error)
- func (dbo *DatabaseObject) DeleteSectionById(sectionId uint) (err error)
- func (dbo *DatabaseObject) DeleteThreadById(threadId uint) (err error)
- func (dbo *DatabaseObject) GetForumById(forumId uint) (forum *mm.Forum, err error)
- func (dbo *DatabaseObject) GetForumSectionById(forumId uint) (sectionId uint, err error)
- func (dbo *DatabaseObject) GetForumThreadsById(forumId uint) (threads *ul.UidList, err error)
- func (dbo *DatabaseObject) GetMessageById(messageId uint) (message *mm.Message, err error)
- func (dbo *DatabaseObject) GetMessageCreatorAndTimeById(messageId uint) (creatorUserId uint, ToC time.Time, ToE *time.Time, err error)
- func (dbo *DatabaseObject) GetMessageThreadById(messageId uint) (thread uint, err error)
- func (dbo *DatabaseObject) GetPreparedStatementByIndex(i int) (ps *sql.Stmt)
- func (dbo *DatabaseObject) GetSectionById(sectionId uint) (section *mm.Section, err error)
- func (dbo *DatabaseObject) GetSectionChildTypeById(sectionId uint) (childType byte, err error)
- func (dbo *DatabaseObject) GetSectionChildrenById(sectionId uint) (children *ul.UidList, err error)
- func (dbo *DatabaseObject) GetSectionParentById(sectionId uint) (parent *uint, err error)
- func (dbo *DatabaseObject) GetThreadById(threadId uint) (thread *mm.Thread, err error)
- func (dbo *DatabaseObject) GetThreadForumById(threadId uint) (forum uint, err error)
- func (dbo *DatabaseObject) GetThreadMessagesById(threadId uint) (messages *ul.UidList, err error)
- func (dbo *DatabaseObject) Init() (err error)
- func (dbo *DatabaseObject) InsertNewForum(sectionId uint, name string, creatorUserId uint) (lastInsertedId int64, err error)
- func (dbo *DatabaseObject) InsertNewMessage(parentThread uint, messageText string, textChecksum uint32, creatorUserId uint) (lastInsertedId int64, err error)
- func (dbo *DatabaseObject) InsertNewSection(parent *uint, name string, creatorUserId uint) (lastInsertedId int64, err error)
- func (dbo *DatabaseObject) InsertNewThread(parentForum uint, threadName string, creatorUserId uint) (lastInsertedId int64, err error)
- func (dbo *DatabaseObject) ReadForums() (forums []mm.Forum, err error)
- func (dbo *DatabaseObject) ReadMessagesById(messageIds ul.UidList) (messages []mm.Message, err error)
- func (dbo *DatabaseObject) ReadSections() (sections []mm.Section, err error)
- func (dbo *DatabaseObject) ReadThreadsById(threadIds ul.UidList) (threads []mm.Thread, err error)
- func (dbo *DatabaseObject) SetForumNameById(forumId uint, name string, editorUserId uint) (err error)
- func (dbo *DatabaseObject) SetForumSectionById(forumId uint, sectionId uint, editorUserId uint) (err error)
- func (dbo *DatabaseObject) SetForumThreadsById(forumId uint, threads *ul.UidList) (err error)
- func (dbo *DatabaseObject) SetMessageTextById(messageId uint, text string, textChecksum uint32, editorUserId uint) (err error)
- func (dbo *DatabaseObject) SetMessageThreadById(messageId uint, thread uint, editorUserId uint) (err error)
- func (dbo *DatabaseObject) SetSectionChildTypeById(sectionId uint, childType byte) (err error)
- func (dbo *DatabaseObject) SetSectionChildrenById(sectionId uint, children *ul.UidList) (err error)
- func (dbo *DatabaseObject) SetSectionNameById(sectionId uint, name string, editorUserId uint) (err error)
- func (dbo *DatabaseObject) SetSectionParentById(sectionId uint, parent uint, editorUserId uint) (err error)
- func (dbo *DatabaseObject) SetThreadForumById(threadId uint, forum uint, editorUserId uint) (err error)
- func (dbo *DatabaseObject) SetThreadMessagesById(threadId uint, messages *ul.UidList) (err error)
- func (dbo *DatabaseObject) SetThreadNameById(threadId uint, name string, editorUserId uint) (err error)
- type TableNames
Constants ¶
View Source
const ( TableSections = "Sections" TableForums = "Forums" TableThreads = "Threads" TableMessages = "Messages" )
View Source
const ( DbPsid_ReadSections = 0 DbPsid_InsertNewForum = 1 DbPsid_CountForumsById = 2 DbPsid_DeleteSectionById = 3 DbPsid_GetSectionById = 4 DbPsid_SetForumNameById = 5 DbPsid_SetSectionChildTypeById = 6 DbPsid_SetForumSectionById = 7 DbPsid_GetForumSectionById = 8 DbPsid_InsertNewThread = 9 DbPsid_GetForumThreadsById = 10 DbPsid_SetForumThreadsById = 11 DbPsid_SetThreadNameById = 12 DbPsid_GetThreadForumById = 13 DbPsid_SetThreadForumById = 14 DbPsid_CountThreadsById = 15 DbPsid_GetThreadMessagesById = 16 DbPsid_InsertNewMessage = 17 DbPsid_SetThreadMessagesById = 18 DbPsid_SetMessageTextById = 19 DbPsid_GetMessageThreadById = 20 DbPsid_SetMessageThreadById = 21 DbPsid_GetMessageCreatorAndTimeById = 22 DbPsid_GetMessageById = 23 DbPsid_DeleteMessageById = 24 DbPsid_GetThreadByIdM = 25 DbPsid_DeleteThreadById = 26 DbPsid_GetForumById = 27 DbPsid_DeleteForumById = 28 DbPsid_ReadForums = 29 DbPsid_CountRootSections = 30 DbPsid_InsertNewSection = 31 DbPsid_CountSectionsById = 32 DbPsid_GetSectionChildrenById = 33 DbPsid_SetSectionChildrenById = 34 DbPsid_SetSectionNameById = 35 DbPsid_GetSectionParentById = 36 DbPsid_SetSectionParentById = 37 DbPsid_GetSectionChildTypeById = 38 DbPsid_CountMessagesById = 39 )
Indices of prepared statements.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatabaseObject ¶
type DatabaseObject struct { cdbo.DatabaseObject // contains filtered or unexported fields }
func NewDatabaseObject ¶
func NewDatabaseObject(settings ms.DbSettings) (dbo *DatabaseObject)
func (*DatabaseObject) CountForumsById ¶
func (dbo *DatabaseObject) CountForumsById(forumId uint) (n int, err error)
func (*DatabaseObject) CountMessagesById ¶
func (dbo *DatabaseObject) CountMessagesById(messageId uint) (n int, err error)
func (*DatabaseObject) CountRootSections ¶
func (dbo *DatabaseObject) CountRootSections() (n int, err error)
func (*DatabaseObject) CountSectionsById ¶
func (dbo *DatabaseObject) CountSectionsById(sectionId uint) (n int, err error)
func (*DatabaseObject) CountThreadsById ¶
func (dbo *DatabaseObject) CountThreadsById(threadId uint) (n int, err error)
func (*DatabaseObject) DeleteForumById ¶
func (dbo *DatabaseObject) DeleteForumById(forumId uint) (err error)
func (*DatabaseObject) DeleteMessageById ¶
func (dbo *DatabaseObject) DeleteMessageById(messageId uint) (err error)
func (*DatabaseObject) DeleteSectionById ¶
func (dbo *DatabaseObject) DeleteSectionById(sectionId uint) (err error)
func (*DatabaseObject) DeleteThreadById ¶
func (dbo *DatabaseObject) DeleteThreadById(threadId uint) (err error)
func (*DatabaseObject) GetForumById ¶
func (dbo *DatabaseObject) GetForumById(forumId uint) (forum *mm.Forum, err error)
func (*DatabaseObject) GetForumSectionById ¶
func (dbo *DatabaseObject) GetForumSectionById(forumId uint) (sectionId uint, err error)
func (*DatabaseObject) GetForumThreadsById ¶
func (dbo *DatabaseObject) GetForumThreadsById(forumId uint) (threads *ul.UidList, err error)
func (*DatabaseObject) GetMessageById ¶
func (dbo *DatabaseObject) GetMessageById(messageId uint) (message *mm.Message, err error)
func (*DatabaseObject) GetMessageCreatorAndTimeById ¶
func (*DatabaseObject) GetMessageThreadById ¶
func (dbo *DatabaseObject) GetMessageThreadById(messageId uint) (thread uint, err error)
func (*DatabaseObject) GetPreparedStatementByIndex ¶
func (dbo *DatabaseObject) GetPreparedStatementByIndex(i int) (ps *sql.Stmt)
func (*DatabaseObject) GetSectionById ¶
func (dbo *DatabaseObject) GetSectionById(sectionId uint) (section *mm.Section, err error)
func (*DatabaseObject) GetSectionChildTypeById ¶
func (dbo *DatabaseObject) GetSectionChildTypeById(sectionId uint) (childType byte, err error)
func (*DatabaseObject) GetSectionChildrenById ¶
func (dbo *DatabaseObject) GetSectionChildrenById(sectionId uint) (children *ul.UidList, err error)
func (*DatabaseObject) GetSectionParentById ¶
func (dbo *DatabaseObject) GetSectionParentById(sectionId uint) (parent *uint, err error)
func (*DatabaseObject) GetThreadById ¶
func (dbo *DatabaseObject) GetThreadById(threadId uint) (thread *mm.Thread, err error)
func (*DatabaseObject) GetThreadForumById ¶
func (dbo *DatabaseObject) GetThreadForumById(threadId uint) (forum uint, err error)
func (*DatabaseObject) GetThreadMessagesById ¶
func (dbo *DatabaseObject) GetThreadMessagesById(threadId uint) (messages *ul.UidList, err error)
func (*DatabaseObject) Init ¶
func (dbo *DatabaseObject) Init() (err error)
Init connects to the database, initialises the tables and prepares SQL statements.
func (*DatabaseObject) InsertNewForum ¶
func (*DatabaseObject) InsertNewMessage ¶
func (*DatabaseObject) InsertNewSection ¶
func (*DatabaseObject) InsertNewThread ¶
func (*DatabaseObject) ReadForums ¶
func (dbo *DatabaseObject) ReadForums() (forums []mm.Forum, err error)
func (*DatabaseObject) ReadMessagesById ¶
func (dbo *DatabaseObject) ReadMessagesById(messageIds ul.UidList) (messages []mm.Message, err error)
func (*DatabaseObject) ReadSections ¶
func (dbo *DatabaseObject) ReadSections() (sections []mm.Section, err error)
func (*DatabaseObject) ReadThreadsById ¶
func (dbo *DatabaseObject) ReadThreadsById(threadIds ul.UidList) (threads []mm.Thread, err error)
func (*DatabaseObject) SetForumNameById ¶
func (dbo *DatabaseObject) SetForumNameById(forumId uint, name string, editorUserId uint) (err error)
func (*DatabaseObject) SetForumSectionById ¶
func (dbo *DatabaseObject) SetForumSectionById(forumId uint, sectionId uint, editorUserId uint) (err error)
func (*DatabaseObject) SetForumThreadsById ¶
func (dbo *DatabaseObject) SetForumThreadsById(forumId uint, threads *ul.UidList) (err error)
func (*DatabaseObject) SetMessageTextById ¶
func (*DatabaseObject) SetMessageThreadById ¶
func (dbo *DatabaseObject) SetMessageThreadById(messageId uint, thread uint, editorUserId uint) (err error)
func (*DatabaseObject) SetSectionChildTypeById ¶
func (dbo *DatabaseObject) SetSectionChildTypeById(sectionId uint, childType byte) (err error)
func (*DatabaseObject) SetSectionChildrenById ¶
func (dbo *DatabaseObject) SetSectionChildrenById(sectionId uint, children *ul.UidList) (err error)
func (*DatabaseObject) SetSectionNameById ¶
func (dbo *DatabaseObject) SetSectionNameById(sectionId uint, name string, editorUserId uint) (err error)
func (*DatabaseObject) SetSectionParentById ¶
func (dbo *DatabaseObject) SetSectionParentById(sectionId uint, parent uint, editorUserId uint) (err error)
func (*DatabaseObject) SetThreadForumById ¶
func (dbo *DatabaseObject) SetThreadForumById(threadId uint, forum uint, editorUserId uint) (err error)
func (*DatabaseObject) SetThreadMessagesById ¶
func (dbo *DatabaseObject) SetThreadMessagesById(threadId uint, messages *ul.UidList) (err error)
func (*DatabaseObject) SetThreadNameById ¶
func (dbo *DatabaseObject) SetThreadNameById(threadId uint, name string, editorUserId uint) (err error)
Click to show internal directories.
Click to hide internal directories.