Documentation ¶
Overview ¶
Package config stores and exports the configuration for server-side use and the public availability JSON struct, which includes a small subset of the server configuration.
Index ¶
- Variables
- func GetAllBoardIDs() (ids []string)
- func GetBoardIDs() (ids []string)
- func GetBoardsJSON() (data []byte)
- func GetJSON() []byte
- func IsBoard(b string) bool
- func IsModOnlyBoard(b string) bool
- func IsReadOnlyBoard(b string) bool
- func RemoveBoard(b string)
- func Set(c ServerConfig) (err error)
- func SetBoardConfig(conf BoardConfig) (err error)
- type AccessMode
- type BoardConfig
- type BoardConfigs
- type BoardPublic
- type ServerConfig
- type ServerPublic
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Defaults contains the default server configuration values DefaultServerConfig = ServerConfig{ ServerPublic: ServerPublic{ MaxSize: common.DefaultMaxSize, MaxFiles: common.DefaultMaxFiles, DefaultCSS: common.DefaultCSS, }, } )
Functions ¶
func GetBoardIDs ¶
func GetBoardIDs() (ids []string)
func GetBoardsJSON ¶
func GetBoardsJSON() (data []byte)
func IsModOnlyBoard ¶
func IsReadOnlyBoard ¶
func RemoveBoard ¶
func RemoveBoard(b string)
RemoveBoard removes a board from the exiting board list and deletes its configurations. To be called, when a board is deleted.
func Set ¶
func Set(c ServerConfig) (err error)
func SetBoardConfig ¶
func SetBoardConfig(conf BoardConfig) (err error)
Set configurations for a specific board as well as pregenerate its public JSON. Return if any changes were made to the configs.
Types ¶
type AccessMode ¶
type AccessMode int
const ( AccessBypass AccessMode = iota - 1 AccessViaBlacklist AccessViaWhitelist )
type BoardConfig ¶
type BoardConfig struct { BoardPublic ModOnly bool `json:"modOnly,omitempty"` AccessMode AccessMode `json:"accessMode,omitempty"` IncludeAnon bool `json:"includeAnon,omitempty"` // contains filtered or unexported fields }
Some fields will be duplicated in DB because we need to pass them to JS client but that doesn't matter.
func GetBoardConfig ¶
func GetBoardConfig(b string) BoardConfig
type BoardConfigs ¶
type BoardConfigs []BoardConfig
Implements sort.Interface
func GetBoardConfigs ¶
func GetBoardConfigs() BoardConfigs
func GetBoardConfigsByID ¶
func GetBoardConfigsByID(ids []string) (cs BoardConfigs)
func (BoardConfigs) Len ¶
func (b BoardConfigs) Len() int
func (BoardConfigs) Less ¶
func (b BoardConfigs) Less(i, j int) bool
func (BoardConfigs) Swap ¶
func (b BoardConfigs) Swap(i, j int)
func (*BoardConfigs) TryMarshal ¶
func (cs *BoardConfigs) TryMarshal() []byte
type BoardPublic ¶
Click to show internal directories.
Click to hide internal directories.