config

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2024 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package config provides everything related to configuration

Index

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

func New

func New() repository.Config

New returns a new configuration

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

Jump to

Keyboard shortcuts

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