const (
DefaultBoardThreads = 10
DefaultBoardReplies = 3
DefaultBoardMaxName = 75
DefaultBoardMaxEmail = 75
DefaultBoardMaxSubject = 75
DefaultBoardMaxMessage = 8000
DefaultBoardWordBreak = 200
DefaultBoardDefaultName = "Anonymous"
DefaultBoardTruncate = 15
DefaultBoardMaxSize = 2097152
DefaultBoardThumbWidth = 250
DefaultBoardThumbHeight = 250
DefaultBoardInstances = 1
)
func FormatBoardApproval(a BoardApproval) string
func FormatBoardHide(a BoardHide) string
func FormatBoardIdentifiers(i BoardIdentifiers) string
func FormatBoardLock(l BoardLock) string
func FormatBoardType(t BoardType) string
func FormatRefLink(boardPath string, threadID int, postID int) []byte
func FormatRole(role AccountRole) string
func Get(board *Board, account *Account, str string, vars ...interface{}) string
type Account struct {
ID int
Username string
Password string
Role AccountRole
LastActive int64
Session string
Style string
Locale string
}
func (a *Account) LastActiveDate() string
func (a *Account) Validate() error
type AccountRole int
Account roles.
const (
RoleSuperAdmin AccountRole = 1
RoleAdmin AccountRole = 2
RoleMod AccountRole = 3
RoleDisabled AccountRole = 99
)
type Ban struct {
ID int
IP string
Timestamp int64
Expire int64
Reason string
}
func (b *Ban) ExpireDate() string
func (b *Ban) Info() string
func (b *Ban) TypeLabel() string
func (b *Ban) Validate() error
type Board struct {
ID int
Dir string
Name string
Description string
Type BoardType
Hide BoardHide
Lock BoardLock
Approval BoardApproval
Reports bool
Style string
Locale string
Delay int
MinName int
MaxName int
MinEmail int
MaxEmail int
MinSubject int
MaxSubject int
MinMessage int
MaxMessage int
MinSizeThread int64
MaxSizeThread int64
MinSizeReply int64
MaxSizeReply int64
ThumbWidth int
ThumbHeight int
DefaultName string
WordBreak int
Truncate int
Threads int
Replies int
MaxThreads int
MaxReplies int
Oekaki bool
Backlinks bool
Instances int
Identifiers BoardIdentifiers
// Calculated fields.
Uploads []string
Embeds []string
Rules []string
Unique int `diff:"-"`
}
func NewBoard() *Board
func (b *Board) HasEmbed(name string) bool
func (b *Board) HasUpload(mimeType string) bool
func (b *Board) MaxSizeLabel(thread bool) string
func (b *Board) Path() string
func (b *Board) UploadTypesLabel(uploadTypes []*UploadType) string
func (b *Board) Validate() error
type BoardApproval int
const (
ApprovalNone BoardApproval = 0
ApprovalFile BoardApproval = 1
ApprovalAll BoardApproval = 2
)
type BoardHide int
const (
HideNowhere BoardHide = 0
HideIndex BoardHide = 1
HideOverboard BoardHide = 2
HideEverywhere BoardHide = 3
)
type BoardIdentifiers int
const (
IdentifiersDisable BoardIdentifiers = 0
IdentifiersBoard BoardIdentifiers = 1
IdentifiersGlobal BoardIdentifiers = 2
)
type BoardLock int
Board lock types.
const (
LockNone BoardLock = 0
LockThread BoardLock = 1
LockPost BoardLock = 2
LockStaff BoardLock = 3
)
type BoardType int
Board types.
const (
TypeImageboard BoardType = 0
TypeForum BoardType = 1
)
type CAPTCHA struct {
IP string
Timestamp int64
Refresh int
Image string
Text string
}
type Keyword struct {
ID int
Text string
Action string
Boards []*Board `diff:"-"`
}
func (k *Keyword) ActionLabel(account *Account) string
func (k *Keyword) HasBoard(id int) bool
func (k *Keyword) Validate() error
type Log struct {
ID int
Account *Account
Board *Board
Timestamp int64
Message string
Changes string
}
func (l *Log) InfoLabel() template.HTML
func (l *Log) MessageLabel() template.HTML
func (l *Log) TimestampDate() string
type News struct {
ID int
Account *Account
Timestamp int64
Modified int64
Share bool
Name string
Subject string
Message string
}
func (n *News) DateInput() string
func (n *News) DateLabel() template.HTML
func (n *News) MayDelete(a *Account) bool
func (n *News) MayUpdate(a *Account) bool
func (n *News) Validate() error
type Post struct {
ID int
Board *Board
Parent int
Timestamp int64
Bumped int64
IP string
Name string
Tripcode string
Email string
NameBlock string
Subject string
Message string
Password string
File string
FileMIME string
FileHash string
FileOriginal string
FileSize int64
FileWidth int
FileHeight int
Thumb string
ThumbWidth int
ThumbHeight int
Moderated PostModerated
Stickied bool
Locked bool
// Calculated fields.
Replies int
}
func (p *Post) AddMediaOverlay(img image.Image) image.Image
func (p *Post) Backlinks(posts []*Post) template.HTML
func (p *Post) Copy() *Post
func (p *Post) EmbedInfo() []string
func (p *Post) ExpandHTML() template.HTML
func (p *Post) FileSizeLabel() string
func (p *Post) Identifier(identifiers bool, force bool) string
func (p *Post) IsEmbed() bool
func (p *Post) IsOekaki() bool
func (p *Post) IsSWF() bool
func (p *Post) MessageTruncated(lines int, account *Account) template.HTML
func (p *Post) RefLink() template.HTML
func (p *Post) SetNameBlock(defaultName string, capcode string, identifiers bool)
func (p *Post) Thread() int
func (p *Post) TimestampLabel() template.HTML
func (p *Post) URL(siteHome string) string
type PostModerated int
const (
ModeratedHidden PostModerated = 0
ModeratedVisible PostModerated = 1
ModeratedApproved PostModerated = 2
)
type Report struct {
ID int
Board *Board
Post *Post
Timestamp int64
IP string
// Calculated fields.
Count int
}