Documentation ¶
Overview ¶
Package config provides everything related to configuration
Index ¶
- func ComputeDefaultValues(config repository.Config) repository.Config
- func New() repository.Config
- type File
- func (cfg *File) AddBeforeHook(f func(repository.Config))
- func (cfg *File) AddHook(f func(repository.Config))
- func (cfg *File) BannedTheme() []string
- func (cfg *File) CustomDB() map[string]repository.TitleDBEntry
- func (cfg *File) DebugNfs() bool
- func (cfg *File) DebugNoSecurity() bool
- func (cfg *File) DebugTicket() bool
- func (cfg *File) Directories() []string
- func (cfg *File) ForwardAuthURL() string
- func (cfg *File) Host() string
- func (cfg *File) IsBannedTheme(theme string) bool
- func (cfg *File) IsBlacklisted(uid string) bool
- func (cfg *File) IsWhitelisted(uid string) bool
- func (cfg *File) LoadConfig()
- func (cfg *File) NfsShares() []string
- func (cfg *File) Port() int
- func (cfg *File) Protocol() string
- func (cfg *File) ReverseProxy() bool
- func (cfg *File) RootShop() string
- func (cfg *File) SetRootShop(root string)
- func (cfg *File) SetShopTemplateData(data repository.ShopTemplate)
- func (cfg *File) ShopTemplateData() repository.ShopTemplate
- func (cfg *File) ShopTitle() string
- func (cfg *File) Sources() repository.ConfigSources
- func (cfg *File) VerifyNSP() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeDefaultValues ¶
func ComputeDefaultValues(config repository.Config) repository.Config
ComputeDefaultValues change the value taken from the config file
Types ¶
type File ¶
type File struct { ShopHost string `mapstructure:"host"` ShopProtocol string `mapstructure:"protocol"` ShopPort int `mapstructure:"port"` Debug debug `mapstructure:"debug"` Proxy bool `mapstructure:"reverseProxy"` AllSources repository.ConfigSources `mapstructure:"sources"` Name string `mapstructure:"name"` Security security `mapstructure:"security"` CustomTitleDB map[string]repository.TitleDBEntry `mapstructure:"customTitledb"` NSP nsp `mapstructure:"nsp"` // contains filtered or unexported fields }
File holds all config information
func (*File) AddBeforeHook ¶ added in v0.0.8
func (cfg *File) AddBeforeHook(f func(repository.Config))
AddBeforeHook Add hook function before on change config
func (*File) AddHook ¶ added in v0.0.8
func (cfg *File) AddHook(f func(repository.Config))
AddHook Add hook function on change config
func (*File) BannedTheme ¶
BannedTheme returns all banned theme
func (*File) CustomDB ¶
func (cfg *File) CustomDB() map[string]repository.TitleDBEntry
CustomDB returns the list of custom title db
func (*File) DebugNoSecurity ¶
DebugNoSecurity returns if we should disable security or not
func (*File) DebugTicket ¶ added in v0.0.7
DebugTicket tells if we should display additional log for ticket verification
func (*File) Directories ¶
Directories returns the list of directories sources
func (*File) ForwardAuthURL ¶ added in v0.2.0
ForwardAuthURL returns the url of the forward auth
func (*File) IsBannedTheme ¶
IsBannedTheme tells if the theme is banned or not
func (*File) IsBlacklisted ¶
IsBlacklisted tells if the uid is blacklisted or not
func (*File) IsWhitelisted ¶
IsWhitelisted tells if the uid is whitelisted or not
func (*File) LoadConfig ¶ added in v0.0.8
func (cfg *File) LoadConfig()
LoadConfig handles viper under the hood
func (*File) ReverseProxy ¶ added in v0.1.0
func (*File) SetRootShop ¶
SetRootShop allow to change the root url of the shop
func (*File) SetShopTemplateData ¶
func (cfg *File) SetShopTemplateData(data repository.ShopTemplate)
SetShopTemplateData sets the data for template
func (*File) ShopTemplateData ¶
func (cfg *File) ShopTemplateData() repository.ShopTemplate
ShopTemplateData returns the data needed to render template
func (*File) Sources ¶
func (cfg *File) Sources() repository.ConfigSources
Sources returns all available sources