Documentation
¶
Index ¶
- func AddExtension(e Extension)
- func CancelTransaction() error
- func CommitTransaction() error
- func CreateAccount(account *Account) error
- func CreateBan(Ban *Ban) error
- func CreateKeyword(Keyword *Keyword) error
- func CreateLog(Log *Log) error
- func CreatePost(Post *Post) error
- func CreateReport(Report *Report) error
- func DeleteAccount(account *Account) error
- func DeleteBan(Ban *Ban) error
- func DeleteKeyword(Keyword *Keyword) error
- func DeleteLog(Log *Log) error
- func DeletePost(Post *Post) error
- func DeleteReport(Report *Report) error
- func Run(driver string, dataSource string) error
- func StartTransaction() error
- func UpdateAccount(account *Account) error
- func UpdateBan(Ban *Ban) error
- func UpdateKeyword(Keyword *Keyword) error
- func UpdateLog(Log *Log) error
- func UpdatePost(Post *Post) error
- func UpdateReport(Report *Report) error
- type Account
- type Attachment
- type AttachmentType
- type Ban
- type Board
- type Extension
- type ExtensionAttach
- type ExtensionPost
- type ExtensionSettings
- type Keyword
- type Log
- type Post
- type Report
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddExtension ¶
func AddExtension(e Extension)
func CancelTransaction ¶
func CancelTransaction() error
func CommitTransaction ¶
func CommitTransaction() error
func CreateAccount ¶
func CreateKeyword ¶
func CreatePost ¶
func CreateReport ¶
func DeleteAccount ¶
func DeleteKeyword ¶
func DeletePost ¶
func DeleteReport ¶
func StartTransaction ¶
func StartTransaction() error
func UpdateAccount ¶
func UpdateKeyword ¶
func UpdatePost ¶
func UpdateReport ¶
Types ¶
type Attachment ¶
type Attachment struct {
ID int
Post int
File string
Size int64
Hash string
Width int
Height int
Thumb string
ThumbWidth int
ThumbHeight int
Uploaded time.Time
}
Attachment represents an attachment. It may be a normal file or a shortcut to an external resource via oEmbed.
type AttachmentType ¶
type Extension ¶
type Extension interface {
Init(settings *ExtensionSettings) (description string)
}
type ExtensionAttach ¶
type ExtensionAttach interface {
Extension
// Types returns a list of attachment types handled by this extension.
Types() []*AttachmentType
// Attach handles an uploaded file.
Attach(file io.Reader, size int64, mime string) (*Attachment, error)
}
ExtensionAttach defines the interface for extensions that handle attaching files when creating a post.
type ExtensionPost ¶
type ExtensionPost interface {
Extension
// Post is called when a new post is created. Extensions may modify the
// post and apply formatting or other operations on it. All text is
// initially HTML-escaped.
Post(post *Post) error
}
ExtensionPost defines the interface for extensions that handle creating a post.
type ExtensionSettings ¶
type ExtensionSettings struct {
}
func (*ExtensionSettings) Get ¶
func (s *ExtensionSettings) Get(name string) string
func (*ExtensionSettings) Set ¶
func (s *ExtensionSettings) Set(name string, value string)
type Post ¶
func PostByName ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.