sriracha

package module
v0.0.0-...-e9e3651 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 15, 2024 License: AGPL-3.0 Imports: 11 Imported by: 0

README

Sriracha - Extensible imageboard

GoDoc Donate via Patreon Donate via LiberaPay

Warning: This software is not yet stable. Here be dragons.

Sriracha is a multi-board imageboard that may be customized by adding and removing extensions.

Install

To install Sriracha at ~/go/bin/sriracha run the following command:

go install code.rocket9labs.com/tslocum/sriracha@latest

Migrate from TinyIB

Coming soon.

Support

Please share issues and suggestions here.

Documentation

Index

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 CreateAccount(account *Account) error

func CreateBan

func CreateBan(Ban *Ban) error

func CreateKeyword

func CreateKeyword(Keyword *Keyword) error

func CreateLog

func CreateLog(Log *Log) error

func CreatePost

func CreatePost(Post *Post) error

func CreateReport

func CreateReport(Report *Report) error

func DeleteAccount

func DeleteAccount(account *Account) error

func DeleteBan

func DeleteBan(Ban *Ban) error

func DeleteKeyword

func DeleteKeyword(Keyword *Keyword) error

func DeleteLog

func DeleteLog(Log *Log) error

func DeletePost

func DeletePost(Post *Post) error

func DeleteReport

func DeleteReport(Report *Report) error

func Run

func Run(driver string, dataSource string) error

func StartTransaction

func StartTransaction() error

func UpdateAccount

func UpdateAccount(account *Account) error

func UpdateBan

func UpdateBan(Ban *Ban) error

func UpdateKeyword

func UpdateKeyword(Keyword *Keyword) error

func UpdateLog

func UpdateLog(Log *Log) error

func UpdatePost

func UpdatePost(Post *Post) error

func UpdateReport

func UpdateReport(Report *Report) error

Types

type Account

type Account struct {
	ID       int
	Username string
	Password string
}

func AccountByID

func AccountByID(id int) (*Account, error)

func AccountByName

func AccountByName(name string) (*Account, error)

func Accounts

func Accounts() ([]*Account, error)

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 AttachmentType struct {
	MIME      string // MIME type.
	Extension string // File extension.
}

type Ban

type Ban struct {
}

func BanByID

func BanByID(id int) (*Ban, error)

func BanByName

func BanByName(name string) (*Ban, error)

func Bans

func Bans() ([]*Ban, error)

type Board

type Board struct {
	ID          int
	Dir         string
	Name        string
	Description string
}

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 Keyword

type Keyword struct{}

func KeywordByID

func KeywordByID(id int) (*Keyword, error)

func KeywordByName

func KeywordByName(name string) (*Keyword, error)

func Keywords

func Keywords() ([]*Keyword, error)

type Log

type Log struct{}

func LogByID

func LogByID(id int) (*Log, error)

func LogByName

func LogByName(name string) (*Log, error)

func Logs

func Logs() ([]*Log, error)

type Post

type Post struct {
	ID      int
	Thread  int
	Name    string
	Email   string
	Subject string
	Message string
}

func PostByID

func PostByID(id int) (*Post, error)

func PostByName

func PostByName(name string) (*Post, error)

func Posts

func Posts() ([]*Post, error)

func (*Post) ThreadID

func (p *Post) ThreadID() int

type Report

type Report struct{}

func ReportByID

func ReportByID(id int) (*Report, error)

func ReportByName

func ReportByName(name string) (*Report, error)

func Reports

func Reports() ([]*Report, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL