...

Package server

Overview ▾

Package server is the Sriracha imageboard and forum server.

Variables

SrirachaVersion is the version of the software. In official releases, this variable is replaced during compilation with the version of the release.

var SrirachaVersion = "DEV"

func FormatValue

func FormatValue(v interface{}) interface{}

FormatValue formats a value as a human-readable string.

type NewsOption

NewsOption represents a News setting option.

type NewsOption int

News options.

const (
    NewsDisable      NewsOption = 0
    NewsWriteToNews  NewsOption = 1
    NewsWriteToIndex NewsOption = 2
)

type Server

Server is the Sriracha imageboard and forum server.

type Server struct {
    Boards []*Board
    // contains filtered or unexported fields
}

func NewServer

func NewServer() *Server

NewServer returns a new server.

func (*Server) Run

func (s *Server) Run() error

Run initializes the server and starts listening for connections.

func (*Server) Stop

func (s *Server) Stop()

Stop shuts down the server gracefully.

type ServerOptions

ServerOptions represents server configuration options and related data.

type ServerOptions struct {
    SiteName         string
    SiteHome         string
    News             NewsOption
    BoardIndex       bool
    CAPTCHA          bool
    Refresh          int
    Uploads          []*UploadType
    Embeds           [][2]string
    OekakiWidth      int
    OekakiHeight     int
    Overboard        string
    OverboardType    BoardType
    OverboardThreads int
    OverboardReplies int
    Identifiers      bool
    Locale           string
    Locales          map[string]string
    LocalesSorted    []string
    Access           map[string]string
    Banners          map[int][]*Banner
    Notifications    bool
    DevMode          bool
    FuncMaps         map[string]template.FuncMap
}

func (*ServerOptions) DefaultLocaleName

func (opt *ServerOptions) DefaultLocaleName() string

DefaultLocaleName returns the name of the configured default locale.