package settings
import "git.dotya.ml/mirre-mt/pcmt/app/settings"
Index ¶
- type Settings
- func New() *Settings
- func (s *Settings) APIKeyDehashed() string
- func (s *Settings) APIKeyHIBP() string
- func (s *Settings) AppName() string
- func (s *Settings) AppPath() string
- func (s *Settings) AssetsPath() string
- func (s *Settings) Consolidate(conf *config.Config, host *string, port *int, devel *bool, version string)
- func (s *Settings) DbConnstring() string
- func (s *Settings) DbIsSetUp() bool
- func (s *Settings) DbType() string
- func (s *Settings) DefaultLoggerSkipAssets() bool
- func (s *Settings) DefaultServerReadHeaderTimeout() time.Duration
- func (s *Settings) DefaultServerWriteTimeout() time.Duration
- func (s *Settings) EraseENVs() error
- func (s *Settings) HTTPCSP() string
- func (s *Settings) HTTPDomain() string
- func (s *Settings) HTTPGzipEnabled() bool
- func (s *Settings) HTTPGzipLevel() int
- func (s *Settings) HTTPRateLimit() int
- func (s *Settings) HTTPRateLimitEnabled() bool
- func (s *Settings) HTTPSecure() bool
- func (s *Settings) Host() string
- func (s *Settings) InitAdminPassword() string
- func (s *Settings) InitCreateAdmin() bool
- func (s *Settings) IsDevel() bool
- func (s *Settings) IsLive() bool
- func (s *Settings) LoggerIsJSON() bool
- func (s *Settings) Port() int
- func (s *Settings) SessionAuthIsHex() bool
- func (s *Settings) SessionCookieAuthSecret() string
- func (s *Settings) SessionCookieEncrSecret() string
- func (s *Settings) SessionCookieName() string
- func (s *Settings) SessionEncrIsHex() bool
- func (s *Settings) SessionMaxAge() int
- func (s *Settings) SetAPIKeyDehashed(k string)
- func (s *Settings) SetAPIKeyHIBP(k string)
- func (s *Settings) SetAppPath(appPath string)
- func (s *Settings) SetAssetsPath(assetsPath string)
- func (s *Settings) SetDbConnstring(connstring string)
- func (s *Settings) SetDbIsSetUp(is bool)
- func (s *Settings) SetDbType(dbType string)
- func (s *Settings) SetHTTPCSP(csp string)
- func (s *Settings) SetHTTPDomain(domain string)
- func (s *Settings) SetHTTPGzipEnabled(enabled bool)
- func (s *Settings) SetHTTPGzipLevel(level int)
- func (s *Settings) SetHTTPRateLimit(rateLimit int)
- func (s *Settings) SetHTTPRateLimitEnabled(enabled bool)
- func (s *Settings) SetHTTPSecure(secure bool)
- func (s *Settings) SetHost(host string)
- func (s *Settings) SetInitAdminPassword(password string)
- func (s *Settings) SetInitCreateAdmin(create bool)
- func (s *Settings) SetIsDevel(devel bool)
- func (s *Settings) SetIsLive(live bool)
- func (s *Settings) SetLoggerIsJSON(isJSON bool)
- func (s *Settings) SetPort(port int)
- func (s *Settings) SetSessionCookieAuthSecret(sessionCookieAuthSecret string)
- func (s *Settings) SetSessionCookieEncrSecret(sessionCookieEncrSecret string)
- func (s *Settings) SetSessionCookieName(sessionCookieName string)
- func (s *Settings) SetSessionMaxAge(sessionMaxAge int)
- func (s *Settings) SetTemplatesPath(templatesPath string)
- func (s *Settings) SetVersion(version string)
- func (s *Settings) TemplatesPath() string
- func (s *Settings) Version() string
Types ¶
type Settings ¶
type Settings struct { RegistrationAllowed bool // contains filtered or unexported fields }
func New ¶
func New() *Settings
New returns a new instance of the settings struct.
func (*Settings) APIKeyDehashed ¶
APIKeyDehashed returns the dehashedAPIKey.
func (*Settings) APIKeyHIBP ¶
APIKeyHIBP returns the hibpAPIKey.
func (*Settings) AppName ¶
AppName returns the appName.
func (*Settings) AppPath ¶
AppPath returns the appPath.
func (*Settings) AssetsPath ¶
AssetsPath returns the assetsPath.
func (*Settings) Consolidate ¶
func (s *Settings) Consolidate(conf *config.Config, host *string, port *int, devel *bool, version string)
Consolidate reconciles whatever values are set in config and via flags and sets it to one place that should be regarded as a single source of truth - the settings struct. Order of preference for values is (from higher to lower) as follows: flag -> Env var -> configuration file.
func (*Settings) DbConnstring ¶
DbConnstring returns the dbConnString.
func (*Settings) DbIsSetUp ¶
DbIsSetUp returns the dbIsSetUp.
func (*Settings) DbType ¶
DbType returns the dbType.
func (*Settings) DefaultLoggerSkipAssets ¶
DefaultLoggerSkipAssets returns whether the logger skips reporting asset visits.
func (*Settings) DefaultServerReadHeaderTimeout ¶
DefaultServerReadHeaderTimeout returns the server default read header timeout.
func (*Settings) DefaultServerWriteTimeout ¶
DefaultServerWriteTimeout returns the server default write timeout.
func (*Settings) EraseENVs ¶
EraseENVs attempts to clear environment vars pertaining to pcmt.
func (*Settings) HTTPCSP ¶
HTTPCSP returns the httpCSP.
func (*Settings) HTTPDomain ¶
HTTPDomain returns the httpDomain.
func (*Settings) HTTPGzipEnabled ¶
HTTPGzipEnabled returns the httpGzipEnabled variable.
func (*Settings) HTTPGzipLevel ¶
HTTPGzipLevel returns the httpGzipLevel.
func (*Settings) HTTPRateLimit ¶
HTTPRateLimit returns the httpRateLimit.
func (*Settings) HTTPRateLimitEnabled ¶
HTTPRateLimitEnabled returns the httpRateLimitEnabled variable.
func (*Settings) HTTPSecure ¶
HTTPSecure returns the httpSecure.
func (*Settings) Host ¶
Host returns the host.
func (*Settings) InitAdminPassword ¶
InitAdminPassword returns the value of initAdminPassword of the receiver.
func (*Settings) InitCreateAdmin ¶
InitCreateAdmin returns the value of initCreateAdmin of the receiver.
func (*Settings) IsDevel ¶
IsDevel returns the value of isDevel of the receiver.
func (*Settings) IsLive ¶
IsLive returns the value of isLive of the receiver.
func (*Settings) LoggerIsJSON ¶
LoggerIsJSON returns whether the logger should use the JSON handler.
func (*Settings) Port ¶
Port returns the port.
func (*Settings) SessionAuthIsHex ¶
SessionAuthIsHex returns whether the session cookie authentication secret is hex.
func (*Settings) SessionCookieAuthSecret ¶
SessionCookieAuthSecret returns the session cookie authentication secret.
func (*Settings) SessionCookieEncrSecret ¶
SessionCookieEncrSecret returns the session cookie encryption secret.
func (*Settings) SessionCookieName ¶
SessionCookieName returns the name of the session cookie.
func (*Settings) SessionEncrIsHex ¶
SessionEncrIsHex returns whether the session cookie encryption secret is hex.
func (*Settings) SessionMaxAge ¶
SessionMaxAge returns the session cookie MaxAge value.
func (*Settings) SetAPIKeyDehashed ¶
SetAPIKeyDehashed sets the dehashedAPIKey.
func (*Settings) SetAPIKeyHIBP ¶
SetAPIKeyHIBP sets the hibpAPIKey.
func (*Settings) SetAppPath ¶
SetAppPath sets the appPath.
func (*Settings) SetAssetsPath ¶
SetAssetsPath sets the assetsPath.
func (*Settings) SetDbConnstring ¶
SetDbConnstring sets the dbConnString.
func (*Settings) SetDbIsSetUp ¶
SetDbIsSetUp sets the dbIsSetUp.
func (*Settings) SetDbType ¶
SetDbType sets the dbType.
func (*Settings) SetHTTPCSP ¶
SetHTTPCSP sets the content security policy.
func (*Settings) SetHTTPDomain ¶
SetHTTPDomain sets the httpDomain.
func (*Settings) SetHTTPGzipEnabled ¶
SetHTTPGzipEnabled sets the httpGzipEnabled variable.
func (*Settings) SetHTTPGzipLevel ¶
SetHTTPGzipLevel sets the httpGzipLevel.
func (*Settings) SetHTTPRateLimit ¶
SetHTTPRateLimit sets the httpRateLimit.
func (*Settings) SetHTTPRateLimitEnabled ¶
SetHTTPRateLimitEnabled sets the httpRateLimitEnabled variable.
func (*Settings) SetHTTPSecure ¶
SetHTTPSecure sets the httpSecure.
func (*Settings) SetHost ¶
SetHost sets the host.
func (*Settings) SetInitAdminPassword ¶
SetInitAdminPassword sets the value of initAdminPassword of the receiver.
func (*Settings) SetInitCreateAdmin ¶
SetInitCreateAdmin sets the value of initCreateAdmin of the receiver.
func (*Settings) SetIsDevel ¶
SetIsDevel sets the value of isDevel of the receiver.
func (*Settings) SetIsLive ¶
SetIsLive sets the value of isLive of the receiver.
func (*Settings) SetLoggerIsJSON ¶
SetLoggerIsJSON sets the setting value of loggerIsJSON.
func (*Settings) SetPort ¶
SetPort sets the port.
func (*Settings) SetSessionCookieAuthSecret ¶
SetSessionCookieAuthSecret sets the session cookie authentication secret.
func (*Settings) SetSessionCookieEncrSecret ¶
SetSessionCookieEncrSecret sets the session cookie encryption secret.
func (*Settings) SetSessionCookieName ¶
SetSessionCookieName sets session cookie name.
func (*Settings) SetSessionMaxAge ¶
SetSessionMaxAge sets sessionMaxAge.
func (*Settings) SetTemplatesPath ¶
SetTemplatesPath sets the templatesPath.
func (*Settings) SetVersion ¶
SetVersion sets the version.
func (*Settings) TemplatesPath ¶
TemplatesPath returns the templatesPath.
func (*Settings) Version ¶
Version returns the version.
Source Files ¶
api-keys.go defaults.go helper.go settings.go
- Version
- v0.0.0-20230910121657-4d10510f5ba4 (latest)
- Published
- Sep 10, 2023
- Platform
- linux/amd64
- Imports
- 6 packages
- Last checked
- 1 month ago –
Tools for package owners.