...

Package sriracha

Overview ▾

Package sriracha implements an imageboard.

Constants

Board types

const (
    BoardNormal   = 1
    BoardCategory = 2
    BoardLink     = 3
)

func Run

func Run(options *Options) error

Run initializes and runs a sriracha imageboard system.

type Attachment

type Attachment struct {
    ID   int
    Post int

    File string
    Size int64
    Hash string

    Thumb       string
    ThumbWidth  int
    ThumbHeight int

    Uploaded time.Time
}

type Board

Board represents an imageboard, category or link.

type Board struct {
    ID          int
    Parent      int
    Type        int
    Dir         string
    Name        string
    Description string
    MinAccess   int
}

type Extension

Extension defines the methods of sriracha extensions.

type Extension interface {
    Start() error // Initialize

    Stop() error // Terminate

    Attach(file io.Reader, size int64, mime string) (*Attachment, error) // Attach a file

    Post() error // Process a post
}

type Options

type Options struct {
    Extensions []UseExtension
}

type Post

type Post struct {
    ID      int
    Parent  int
    Subject string
    Name    string
    Message string

    Posted   time.Time
    Modified time.Time
    Bumped   time.Time
}

type UseExtension

type UseExtension struct {
    Extension Extension
    FileTypes []string
    Events    []string
}

type User

User represents a user account.

type User struct {
    ID       int
    Access   int
    Email    string
    Password string
    Name     string
}

Subdirectories

Name Synopsis
..
extension Package extension provides sriracha extension support.