config

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2023 License: AGPL-3.0 Imports: 10 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 added in v0.0.8

func New() repository.Config

New returns a new configuration

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

Jump to

Keyboard shortcuts

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