Documentation
¶
Overview ¶
Package model provides Sriracha data types.
Index ¶
- Constants
- 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
- type AccountRole
- type Ban
- type Banner
- type Board
- type BoardApproval
- type BoardHide
- type BoardIdentifiers
- type BoardLock
- type BoardType
- type CAPTCHA
- type Keyword
- type Log
- type News
- type Page
- type Post
- 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) ResetAttachment()
- 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
- type Report
- type Subscription
- type SubscriptionType
Constants ¶
View Source
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 DefaultBoardFiles = 1 DefaultBoardInstances = 1 DefaultBoardGallery = true )
Variables ¶
This section is empty.
Functions ¶
func FormatBoardApproval ¶
func FormatBoardApproval(a BoardApproval) string
func FormatBoardHide ¶
func FormatBoardIdentifiers ¶
func FormatBoardIdentifiers(i BoardIdentifiers) string
func FormatBoardLock ¶
func FormatBoardType ¶
func FormatRole ¶
func FormatRole(role AccountRole) string
Types ¶
type Account ¶
type Account struct {
ID int
Username string
Password string
Role AccountRole
LastActive int64
Session string
Style string
Locale string
}
func (*Account) LastActiveDate ¶
type AccountRole ¶
type AccountRole int
const ( RoleSuperAdmin AccountRole = 1 RoleAdmin AccountRole = 2 RoleMod AccountRole = 3 RoleDisabled AccountRole = 99 )
Account roles.
type Ban ¶
func (*Ban) ExpireDate ¶
type Banner ¶ added in v1.3.7
type Board ¶
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
Files int
Instances int
Identifiers BoardIdentifiers
Gallery bool
// Calculated fields.
Uploads []string
Embeds []string
Rules []string
Unique int `diff:"-"`
}
func (*Board) MaxSizeLabel ¶
func (*Board) UploadTypesLabel ¶
type BoardApproval ¶
type BoardApproval int
const ( ApprovalNone BoardApproval = 0 ApprovalFile BoardApproval = 1 ApprovalAll BoardApproval = 2 )
type BoardIdentifiers ¶
type BoardIdentifiers int
const ( IdentifiersDisable BoardIdentifiers = 0 IdentifiersBoard BoardIdentifiers = 1 IdentifiersGlobal BoardIdentifiers = 2 )
type Keyword ¶
func (*Keyword) ActionLabel ¶
type Log ¶
type Log struct {
ID int
Account *Account
Board *Board
Timestamp int64
Message string
Changes string
}
func (*Log) MessageLabel ¶
func (*Log) TimestampDate ¶
type News ¶
type Page ¶ added in v1.3.3
func (*Page) AddHeaderAndFooter ¶ added in v1.3.3
type Post ¶
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 (*Post) ExpandHTML ¶
func (*Post) FileSizeLabel ¶
func (*Post) MessageTruncated ¶
func (*Post) ResetAttachment ¶ added in v1.2.7
func (p *Post) ResetAttachment()
func (*Post) SetNameBlock ¶
func (*Post) TimestampLabel ¶
type PostModerated ¶
type PostModerated int
const ( ModeratedHidden PostModerated = 0 ModeratedVisible PostModerated = 1 ModeratedApproved PostModerated = 2 )
type Subscription ¶ added in v1.3.9
type Subscription struct {
ID int
IP string // For anti-spam protection. Cleared after 24 hours.
Confirm int64 // Timestamp when confirmation request was zent, or zero once confirmed.
Email string // Email address.
Board int // Only set when Target is a SubscriptionType.
Target int // When greater than zero, Target is a post ID. Otherwise, Target is a SubscriptionType.
}
func (*Subscription) Validate ¶ added in v1.3.9
func (s *Subscription) Validate() error
type SubscriptionType ¶ added in v1.3.9
type SubscriptionType int
const ( SubscriptionAll SubscriptionType = 0 // Subscribe to all new posts. SubscriptionThreads SubscriptionType = -1 // Subscribe to new threads. )
Click to show internal directories.
Click to hide internal directories.