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) Get_Hauth() string
- func (cfg *Configuration) Get_Httpauth() []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) ProdKeys() string
- func (cfg *Configuration) Protocol() string
- func (cfg *Configuration) Rename() bool
- 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 ¶
type Configuration struct { ShopHost string `mapstructure:"host"` ShopProtocol string `mapstructure:"protocol"` Keys string `mapstructure:"keys"` RenameFiles bool `mapstructure:"renameFiles"` 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 ¶
func (cfg *Configuration) AddBeforeHook(f func(repository.Config))
AddBeforeHook Add hook function before on change config
func (*Configuration) AddHook ¶
func (cfg *Configuration) AddHook(f func(repository.Config))
AddHook Add hook function on change config
func (*Configuration) BannedTheme ¶
func (cfg *Configuration) BannedTheme() []string
BannedTheme returns all banned theme
func (*Configuration) CustomDB ¶
func (cfg *Configuration) CustomDB() map[string]repository.TitleDBEntry
CustomDB returns the list of custom title db
func (*Configuration) DebugNfs ¶
func (cfg *Configuration) DebugNfs() bool
DebugNfs tells if we should display additional log for nfs
func (*Configuration) DebugNoSecurity ¶
func (cfg *Configuration) DebugNoSecurity() bool
DebugNoSecurity returns if we should disable security or not
func (*Configuration) DebugTicket ¶
func (cfg *Configuration) DebugTicket() bool
DebugTicket tells if we should display additional log for ticket verification
func (*Configuration) Directories ¶
func (cfg *Configuration) Directories() []string
Directories returns the list of directories sources
func (*Configuration) ForwardAuthURL ¶
func (cfg *Configuration) ForwardAuthURL() string
ForwardAuthURL returns the url of the forward auth
func (*Configuration) Get_Hauth ¶ added in v0.5.1
func (cfg *Configuration) Get_Hauth() string
get Hauth code
func (*Configuration) Get_Httpauth ¶ added in v0.5.1
func (cfg *Configuration) Get_Httpauth() []string
get Httpauth list
func (*Configuration) Host ¶
func (cfg *Configuration) Host() string
Host returns the host of the shop
func (*Configuration) IsBannedTheme ¶
func (cfg *Configuration) IsBannedTheme(theme string) bool
IsBannedTheme tells if the theme is banned or not
func (*Configuration) IsBlacklisted ¶
func (cfg *Configuration) IsBlacklisted(uid string) bool
IsBlacklisted tells if the uid is blacklisted or not
func (*Configuration) IsWhitelisted ¶
func (cfg *Configuration) IsWhitelisted(uid string) bool
IsWhitelisted tells if the uid is whitelisted or not
func (*Configuration) LoadConfig ¶
func (cfg *Configuration) LoadConfig()
LoadConfig handles viper under the hood
func (*Configuration) NfsShares ¶
func (cfg *Configuration) NfsShares() []string
NfsShares returns the list of nfs sources
func (*Configuration) NoWelcomeMessage ¶
func (cfg *Configuration) NoWelcomeMessage() bool
NoWelcomeMessage returns the NoWelcomeMessage
func (*Configuration) Port ¶
func (cfg *Configuration) Port() int
Port returns the port number for outside access
func (*Configuration) ProdKeys ¶
func (cfg *Configuration) ProdKeys() string
Protocol returns the path/keys file
func (*Configuration) Protocol ¶
func (cfg *Configuration) Protocol() string
Protocol returns the protocol scheme (http or https)
func (*Configuration) Rename ¶
func (cfg *Configuration) Rename() bool
Tells if files should be renamed after decrypting
func (*Configuration) ReverseProxy ¶
func (cfg *Configuration) ReverseProxy() bool
ReverseProxy returns the ReverseProxy setting
func (*Configuration) RootShop ¶
func (cfg *Configuration) RootShop() string
RootShop returns the RootShop url
func (*Configuration) SetRootShop ¶
func (cfg *Configuration) SetRootShop(root string)
SetRootShop allow to change the root url of the shop
func (*Configuration) SetShopTemplateData ¶
func (cfg *Configuration) SetShopTemplateData(data repository.ShopTemplate)
SetShopTemplateData sets the data for template
func (*Configuration) ShopTemplateData ¶
func (cfg *Configuration) ShopTemplateData() repository.ShopTemplate
ShopTemplateData returns the data needed to render template
func (*Configuration) ShopTitle ¶
func (cfg *Configuration) ShopTitle() string
ShopTitle returns the name of the shop
func (*Configuration) Sources ¶
func (cfg *Configuration) Sources() repository.ConfigSources
Sources returns all available sources
func (*Configuration) VerifyNSP ¶
func (cfg *Configuration) VerifyNSP() bool
VerifyNSP tells if we need to verify NSP
func (*Configuration) WelcomeMessage ¶
func (cfg *Configuration) WelcomeMessage() string
WelcomeMessage returns the WelcomeMessage