sriracha

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

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

Go to latest
Published: Apr 30, 2023 License: AGPL-3.0 Imports: 10 Imported by: 0

README

Sriracha - Extensible imageboard

GoDoc Donate via LiberaPay Donate via Patreon

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.

Extensions are simply additional pieces of software written in Go. Because of this, developers have unlimited power to extend and customize Sriracha.

Install

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

go install code.rocketnine.space/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 Run

func Run() error

Types

type Account

type Account struct {
}

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 Ban

type Ban struct {
}

type Extension

type Extension interface {
	Description() string
}

type ExtensionAttach

type ExtensionAttach interface {
	Extension

	// 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 ExtensionDatabase

type ExtensionDatabase interface {
	Extension

	CreateAccount(account *Account) error
	AccountByID(id int) (*Account, error)
	AccountByName(name string) (*Account, error)
	Accounts() ([]*Account, error)
	UpdateAccount(account *Account) error
	DeleteAccount(account *Account) error

	CreateBan(Ban *Ban) error
	BanByID(id int) (*Ban, error)
	BanByName(name string) (*Ban, error)
	Bans() ([]*Ban, error)
	UpdateBan(Ban *Ban) error
	DeleteBan(Ban *Ban) error

	CreateKeyword(Keyword *Keyword) error
	KeywordByID(id int) (*Keyword, error)
	KeywordByName(name string) (*Keyword, error)
	Keywords() ([]*Keyword, error)
	UpdateKeyword(Keyword *Keyword) error
	DeleteKeyword(Keyword *Keyword) error

	CreateLog(Log *Log) error
	LogByID(id int) (*Log, error)
	LogByName(name string) (*Log, error)
	Logs() ([]*Log, error)
	UpdateLog(Log *Log) error
	DeleteLog(Log *Log) error

	CreatePost(Post *Post) error
	PostByID(id int) (*Post, error)
	PostByName(name string) (*Post, error)
	Posts() ([]*Post, error)
	UpdatePost(Post *Post) error
	DeletePost(Post *Post) error

	CreateReport(Report *Report) error
	ReportByID(id int) (*Report, error)
	ReportByName(name string) (*Report, error)
	Reports() ([]*Report, error)
	UpdateReport(Report *Report) error
	DeleteReport(Report *Report) error
}

ExtensionDatabase defines the interface for extensions that handle storing and retrieving information within a database.

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 Keyword

type Keyword struct{}

type Log

type Log struct{}

type Post

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

func (*Post) ThreadID

func (p *Post) ThreadID() int

type Report

type Report struct{}

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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