Documentation
¶
Index ¶
- Variables
- type Ban
- type BanModel
- func (bm *BanModel) BanUser(ip net.IP, endDate time.Time, reason string) error
- func (bm *BanModel) GetBan(ip net.IP) (Ban, error)
- func (bm *BanModel) GetBans(pageNumber, itemsPerPage uint) ([]Ban, error)
- func (bm *BanModel) IsBanned(r *http.Request) (bool, Ban, error)
- func (bm *BanModel) UnbanUser(ip net.IP) error
- type Board
- type BoardModel
- type Citation
- type CitationModel
- type FileInfo
- type FileInfoModel
- func (fiModel *FileInfoModel) Delete(fileId string) error
- func (fiModel *FileInfoModel) DeleteOrphanedFiles() error
- func (fiModel *FileInfoModel) GetFilesForPosts(boardId string, posts ...*Post) error
- func (fiModel *FileInfoModel) GetLatestFiles() ([]map[string]interface{}, error)
- func (fiModel *FileInfoModel) InsertFile(fileName string, file []byte) (FileInfo, error)
- type Post
- type Reply
- type ReplyModel
- func (m *ReplyModel) Delete(boardId string, id uint) (uint, error)
- func (m *ReplyModel) Get(boardId string, replyId uint) (*Reply, error)
- func (m *ReplyModel) GetLatestReplies(boardId string, limit int, threads ...*Thread) error
- func (m *ReplyModel) GetLatestRepliesFromEveryThread() ([]*Reply, error)
- func (m *ReplyModel) GetRepliesToThreads(boardId string, threads ...*Thread) error
- func (m *ReplyModel) Insert(boardId string, threadId uint, content string, files []FileInfo, ...) (uint, error)
- type Thread
- type ThreadModel
- func (m *ThreadModel) Delete(boardId string, threadIds ...uint) error
- func (m *ThreadModel) Get(boardId string, threadId uint) (*Thread, error)
- func (m *ThreadModel) GetBanCount() (uint, error)
- func (m *ThreadModel) GetLatest(boardId string, pageNumber, itemsPerPage uint) ([]*Thread, error)
- func (m *ThreadModel) GetLatestFromEveryBoard() ([]*Thread, error)
- func (m *ThreadModel) GetThreadCount(boardId string) (uint, error)
- func (m *ThreadModel) Insert(boardId, title, content string, files []FileInfo, posterIp string) (uint, error)
- type User
- type UserModel
- func (um *UserModel) ChangeUserPassword(username, password string) error
- func (um *UserModel) Delete(username string) error
- func (um *UserModel) GetUser(username string) (User, error)
- func (um *UserModel) GetUsers() ([]User, error)
- func (um *UserModel) Login(username, password string) (User, error)
- func (um *UserModel) RegisterUser(username string, displayName string, permission UserPermission) (string, error)
- func (um *UserModel) ResetUserPassword(username string) (string, error)
- func (um *UserModel) SetPassword(username, newPassword string) error
- func (um *UserModel) Update(user User) error
- type UserPermission
- type WrongPasswordError
Constants ¶
This section is empty.
Variables ¶
View Source
var GreentextRegex = regexp.MustCompile(">.+")
View Source
var PostCitationRegex = regexp.MustCompile(">> ([0-9]+)")
Functions ¶
This section is empty.
Types ¶
type BoardModel ¶
type BoardModel struct {
DbConn *goqu.Database
ThreadModel *ThreadModel
}
func (*BoardModel) Delete ¶
func (m *BoardModel) Delete(id string) error
func (*BoardModel) GetBoards ¶
func (m *BoardModel) GetBoards() ([]Board, error)
func (*BoardModel) Insert ¶
func (m *BoardModel) Insert(id string, name string, bumpLimit uint) error
func (*BoardModel) Update ¶
func (m *BoardModel) Update(board Board) error
type CitationModel ¶
func (*CitationModel) GetCitationsForPosts ¶
func (cm *CitationModel) GetCitationsForPosts(boardId string, posts ...*Post) error
type FileInfo ¶
func (FileInfo) ContainsImage ¶
type FileInfoModel ¶
type FileInfoModel struct {
DbConn *goqu.Database
FileStore filestorage.FileStore
}
func (*FileInfoModel) Delete ¶
func (fiModel *FileInfoModel) Delete(fileId string) error
func (*FileInfoModel) DeleteOrphanedFiles ¶
func (fiModel *FileInfoModel) DeleteOrphanedFiles() error
func (*FileInfoModel) GetFilesForPosts ¶
func (fiModel *FileInfoModel) GetFilesForPosts(boardId string, posts ...*Post) error
func (*FileInfoModel) GetLatestFiles ¶
func (fiModel *FileInfoModel) GetLatestFiles() ([]map[string]interface{}, error)
func (*FileInfoModel) InsertFile ¶
func (fiModel *FileInfoModel) InsertFile(fileName string, file []byte) (FileInfo, error)
type Post ¶
type Post struct {
ID uint
BoardID string
CreatedAt time.Time
Content string
Files []FileInfo
Citations []Citation
PosterIP net.IP
}
func (Post) FormatCreationDate ¶
func (Post) FormatedContent ¶
type ReplyModel ¶
type ReplyModel struct {
DbConn *goqu.Database
FileInfoModel *FileInfoModel
CitationModel *CitationModel
}
func (*ReplyModel) GetLatestReplies ¶
func (m *ReplyModel) GetLatestReplies(boardId string, limit int, threads ...*Thread) error
func (*ReplyModel) GetLatestRepliesFromEveryThread ¶
func (m *ReplyModel) GetLatestRepliesFromEveryThread() ([]*Reply, error)
func (*ReplyModel) GetRepliesToThreads ¶
func (m *ReplyModel) GetRepliesToThreads(boardId string, threads ...*Thread) error
type ThreadModel ¶
type ThreadModel struct {
DbConn *goqu.Database
FileInfoModel *FileInfoModel
CitationModel *CitationModel
ReplyModel *ReplyModel
}
func (*ThreadModel) GetBanCount ¶
func (m *ThreadModel) GetBanCount() (uint, error)
func (*ThreadModel) GetLatest ¶
func (m *ThreadModel) GetLatest(boardId string, pageNumber, itemsPerPage uint) ([]*Thread, error)
func (*ThreadModel) GetLatestFromEveryBoard ¶
func (m *ThreadModel) GetLatestFromEveryBoard() ([]*Thread, error)
func (*ThreadModel) GetThreadCount ¶
func (m *ThreadModel) GetThreadCount(boardId string) (uint, error)
type User ¶
type User struct {
Username string
DisplayName string
Permission UserPermission
}
type UserModel ¶
func (*UserModel) ChangeUserPassword ¶
func (*UserModel) RegisterUser ¶
func (*UserModel) ResetUserPassword ¶
func (*UserModel) SetPassword ¶
type WrongPasswordError ¶
type WrongPasswordError struct{}
func (WrongPasswordError) Error ¶
func (e WrongPasswordError) Error() string
Click to show internal directories.
Click to hide internal directories.