config

package
v1.7.6-0...-a17e0fe Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2016 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package config parses JSON configuration files and exports the Config struct for server-side use and the ClientConfig struct, for JSON stringification and passing to the client,

Index

Constants

This section is empty.

Variables

View Source
var ClientConfig []byte

ClientConfig exports public settings all clients can access

View Source
var Hash string

Hash stores the truncated MD5 hash of Config

Functions

func LoadConfig

func LoadConfig() error

LoadConfig reads and parses the JSON config file

Types

type Server

type Server struct {
	HTTP struct {
		Addr, Origin, Cert, Key string
		SSL, TrustProxies, Gzip bool
	}
	Rethinkdb struct {
		Addr, Db string
	}
	Boards struct {
		Enabled []string
		Boards  map[string]struct {
			MaxThreads, MaxBump int
			Title               string
		}
		Default, Staff string
		Psuedo, Links  [][2]string
		Prune          bool
	}
	Lang struct {
		Enabled []string
		Default string
	}
	Staff struct {
		Classes     map[string]StaffClass
		Keyword     string
		SessionTime int
	}
	Images struct {
		Max struct {
			Size, Width, Height, Pixels int64
		}
		JpegQuality        uint8
		PngQuality         string
		WebmAudio          bool
		Hats               bool
		DuplicateThreshold uint8
		Spoilers           []uint8
		Formats            map[string]bool
	}
	Posts struct {
		Salt, ExcludeRegex                       string
		ThreadCreationCooldown, MaxSubjectLength int
		ReadOnly, SageEnabled, ForcedAnon        bool
	}
	Recaptcha struct {
		Public, Private string
	}
	Banners, FAQ, Eightball                                        []string
	Radio, Pyu, IllyaDance                                         bool
	FeedbackEmail, DefaultCSS, Frontpage, InfoBanner, InjectJSPath string
}

Server stores the global configuration. It is loaded only once during start up and considered implicitly immutable during the rest of runtime.

var Config Server

Config contains currently loaded server configuration

type StaffClass

type StaffClass struct {
	Alias   string
	Members map[string]string
	Rights  map[string]bool
}

StaffClass contains properties of a single staff personel type

Jump to

Keyboard shortcuts

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