Documentation ¶
Overview ¶
Package config provides everything related to configuration
Index ¶
- func ComputeDefaultValues(config repository.Config) repository.Config
- func New() repository.Config
- type Configuration
- func (cfg *Configuration) AddBeforeHook(f func(repository.Config))
- func (cfg *Configuration) AddHook(f func(repository.Config))
- func (cfg *Configuration) BannedTheme() []string
- func (cfg *Configuration) CustomDB() map[string]repository.TitleDBEntry
- func (cfg *Configuration) DebugNfs() bool
- func (cfg *Configuration) DebugNoSecurity() bool
- func (cfg *Configuration) DebugTicket() bool
- func (cfg *Configuration) Directories() []string
- func (cfg *Configuration) ForwardAuthURL() string
- func (cfg *Configuration) Host() string
- func (cfg *Configuration) IsBannedTheme(theme string) bool
- func (cfg *Configuration) IsBlacklisted(uid string) bool
- func (cfg *Configuration) IsWhitelisted(uid string) bool
- func (cfg *Configuration) LoadConfig()
- func (cfg *Configuration) NfsShares() []string
- func (cfg *Configuration) NoWelcomeMessage() bool
- func (cfg *Configuration) Port() int
- func (cfg *Configuration) Protocol() string
- func (cfg *Configuration) ReverseProxy() bool
- func (cfg *Configuration) RootShop() string
- func (cfg *Configuration) SetRootShop(root string)
- func (cfg *Configuration) SetShopTemplateData(data repository.ShopTemplate)
- func (cfg *Configuration) ShopTemplateData() repository.ShopTemplate
- func (cfg *Configuration) ShopTitle() string
- func (cfg *Configuration) Sources() repository.ConfigSources
- func (cfg *Configuration) VerifyNSP() bool
- func (cfg *Configuration) WelcomeMessage() string
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 Configuration ¶ added in v0.2.1
type Configuration struct { ShopHost string `mapstructure:"host"` ShopProtocol string `mapstructure:"protocol"` ShopWelcomeMessage string `mapstructure:"welcomeMessage"` ShopNoWelcomeMessage bool `mapstructure:"noWelcomeMessage"` 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 }
Configuration holds all config information
func (*Configuration) AddBeforeHook ¶ added in v0.2.1
func (cfg *Configuration) AddBeforeHook(f func(repository.Config))
AddBeforeHook Add hook function before on change config
func (*Configuration) AddHook ¶ added in v0.2.1
func (cfg *Configuration) AddHook(f func(repository.Config))
AddHook Add hook function on change config
func (*Configuration) BannedTheme ¶ added in v0.2.1
func (cfg *Configuration) BannedTheme() []string
BannedTheme returns all banned theme
func (*Configuration) CustomDB ¶ added in v0.2.1
func (cfg *Configuration) CustomDB() map[string]repository.TitleDBEntry
CustomDB returns the list of custom title db
func (*Configuration) DebugNfs ¶ added in v0.2.1
func (cfg *Configuration) DebugNfs() bool
DebugNfs tells if we should display additional log for nfs
func (*Configuration) DebugNoSecurity ¶ added in v0.2.1
func (cfg *Configuration) DebugNoSecurity() bool
DebugNoSecurity returns if we should disable security or not
func (*Configuration) DebugTicket ¶ added in v0.2.1
func (cfg *Configuration) DebugTicket() bool
DebugTicket tells if we should display additional log for ticket verification
func (*Configuration) Directories ¶ added in v0.2.1
func (cfg *Configuration) Directories() []string
Directories returns the list of directories sources
func (*Configuration) ForwardAuthURL ¶ added in v0.2.1
func (cfg *Configuration) ForwardAuthURL() string
ForwardAuthURL returns the url of the forward auth
func (*Configuration) Host ¶ added in v0.2.1
func (cfg *Configuration) Host() string
Host returns the host of the shop
func (*Configuration) IsBannedTheme ¶ added in v0.2.1
func (cfg *Configuration) IsBannedTheme(theme string) bool
IsBannedTheme tells if the theme is banned or not
func (*Configuration) IsBlacklisted ¶ added in v0.2.1
func (cfg *Configuration) IsBlacklisted(uid string) bool
IsBlacklisted tells if the uid is blacklisted or not
func (*Configuration) IsWhitelisted ¶ added in v0.2.1
func (cfg *Configuration) IsWhitelisted(uid string) bool
IsWhitelisted tells if the uid is whitelisted or not
func (*Configuration) LoadConfig ¶ added in v0.2.1
func (cfg *Configuration) LoadConfig()
LoadConfig handles viper under the hood
func (*Configuration) NfsShares ¶ added in v0.2.1
func (cfg *Configuration) NfsShares() []string
NfsShares returns the list of nfs sources
func (*Configuration) NoWelcomeMessage ¶ added in v0.2.1
func (cfg *Configuration) NoWelcomeMessage() bool
NoWelcomeMessage returns the NoWelcomeMessage
func (*Configuration) Port ¶ added in v0.2.1
func (cfg *Configuration) Port() int
Port returns the port number for outside access
func (*Configuration) Protocol ¶ added in v0.2.1
func (cfg *Configuration) Protocol() string
Protocol returns the protocol scheme (http or https)
func (*Configuration) ReverseProxy ¶ added in v0.2.1
func (cfg *Configuration) ReverseProxy() bool
ReverseProxy returns the ReverseProxy setting
func (*Configuration) RootShop ¶ added in v0.2.1
func (cfg *Configuration) RootShop() string
RootShop returns the RootShop url
func (*Configuration) SetRootShop ¶ added in v0.2.1
func (cfg *Configuration) SetRootShop(root string)
SetRootShop allow to change the root url of the shop
func (*Configuration) SetShopTemplateData ¶ added in v0.2.1
func (cfg *Configuration) SetShopTemplateData(data repository.ShopTemplate)
SetShopTemplateData sets the data for template
func (*Configuration) ShopTemplateData ¶ added in v0.2.1
func (cfg *Configuration) ShopTemplateData() repository.ShopTemplate
ShopTemplateData returns the data needed to render template
func (*Configuration) ShopTitle ¶ added in v0.2.1
func (cfg *Configuration) ShopTitle() string
ShopTitle returns the name of the shop
func (*Configuration) Sources ¶ added in v0.2.1
func (cfg *Configuration) Sources() repository.ConfigSources
Sources returns all available sources
func (*Configuration) VerifyNSP ¶ added in v0.2.1
func (cfg *Configuration) VerifyNSP() bool
VerifyNSP tells if we need to verify NSP
func (*Configuration) WelcomeMessage ¶ added in v0.2.1
func (cfg *Configuration) WelcomeMessage() string
WelcomeMessage returns the WelcomeMessage