config

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2023 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 added in v0.0.8

func New() repository.Config

New returns a new configuration

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

func (cfg *File) BannedTheme() []string

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) DebugNfs

func (cfg *File) DebugNfs() bool

DebugNfs tells if we should display additional log for nfs

func (*File) DebugNoSecurity

func (cfg *File) DebugNoSecurity() bool

DebugNoSecurity returns if we should disable security or not

func (*File) DebugTicket added in v0.0.7

func (cfg *File) DebugTicket() bool

DebugTicket tells if we should display additional log for ticket verification

func (*File) Directories

func (cfg *File) Directories() []string

Directories returns the list of directories sources

func (*File) ForwardAuthURL added in v0.2.0

func (cfg *File) ForwardAuthURL() string

ForwardAuthURL returns the url of the forward auth

func (*File) Host

func (cfg *File) Host() string

Host returns the host of the shop

func (*File) IsBannedTheme

func (cfg *File) IsBannedTheme(theme string) bool

IsBannedTheme tells if the theme is banned or not

func (*File) IsBlacklisted

func (cfg *File) IsBlacklisted(uid string) bool

IsBlacklisted tells if the uid is blacklisted or not

func (*File) IsWhitelisted

func (cfg *File) IsWhitelisted(uid string) bool

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) NfsShares

func (cfg *File) NfsShares() []string

NfsShares returns the list of nfs sources

func (*File) Port

func (cfg *File) Port() int

Port returns the port number for outside access

func (*File) Protocol

func (cfg *File) Protocol() string

Protocol returns the protocol scheme (http or https)

func (*File) ReverseProxy added in v0.1.0

func (cfg *File) ReverseProxy() bool

func (*File) RootShop

func (cfg *File) RootShop() string

RootShop returns the RootShop url

func (*File) SetRootShop

func (cfg *File) SetRootShop(root string)

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) ShopTitle

func (cfg *File) ShopTitle() string

ShopTitle returns the name of the shop

func (*File) Sources

func (cfg *File) Sources() repository.ConfigSources

Sources returns all available sources

func (*File) VerifyNSP added in v0.0.7

func (cfg *File) VerifyNSP() bool

VerifyNSP tells if we need to verify NSP

Jump to

Keyboard shortcuts

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