commonConfig

package
v1.2.23 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2025 License: Apache-2.0 Imports: 6 Imported by: 28

Documentation

Index

Constants

View Source
const (
	MODE_DEVELOPMENT = "development"
	MODE_PRODUCTION  = "production"
	MODE_TEST
)

Variables

View Source
var FALSE = "false"
View Source
var TRUE = "true"

Functions

This section is empty.

Types

type Settings

type Settings struct {
	Application struct {
		Name        string `toml:"name"`
		Prefix      string `toml:"prefix"`
		Home        string `toml:"home"`
		Description string `toml:"description"`
		Version     string `toml:"version"`
		Environment string `toml:"environment"`
		ReleaseDate string `toml:"releaseDate"`
		Copyright   string `toml:"copyright"`
		Author      string `toml:"author"`
		License     string `toml:"license"`
		Locale      string `toml:"locale"`
	} `toml:"Application"`
	Database struct {
		Version  int    `toml:"version"`
		Type     string `toml:"type"`
		Host     string `toml:"host"`
		Port     int    `toml:"port"`
		Name     string `toml:"name"`
		User     string `toml:"user"`
		Pass     string `toml:"pass"`
		Path     string `toml:"path"`
		PoolSize int    `toml:"poolSize"`
		Timeout  int    `toml:"timeout"`
	} `toml:"Database"`
	Server struct {
		Host        string `toml:"host"`
		Port        int    `toml:"port"`
		Protocol    string `toml:"protocol"`
		Environment string `toml:"environment"`
	} `toml:"Server"`
	Translation struct {
		Host     string `toml:"host"`
		Port     int    `toml:"port"`
		Locale   string `toml:"locale"`
		Protocol string `toml:"protocol"`
	} `toml:"Translation"`
	Assets struct {
		Logo    string `toml:"logo"`
		Favicon string `toml:"favicon"`
	} `toml:"Assets"`
	Dates struct {
		DateTimeFormat string `toml:"dateTimeFormat"`
		DateFormat     string `toml:"dateFormat"`
		TimeFormat     string `toml:"timeFormat"`
		Backup         string `toml:"backup"`
		BackupFolder   string `toml:"backupFolder"`
		Human          string `toml:"human"`
		DMY2           string `toml:"dmy2"`
		YMD            string `toml:"ymd"`
		Internal       string `toml:"internal"`
	} `toml:"Dates"`
	History struct {
		MaxEntries int `toml:"maxEntries"`
	} `toml:"History"`
	Hosts []struct {
		Name string `toml:"name"`
		FQDN string `toml:"fqdn"`
		IP   string `toml:"ip"`
		Zone string `toml:"zone"`
	} `toml:"Hosts"`
	Security struct {
		SessionKeyName     string `toml:"sessionKey"`
		SessionUserIDKey   string `toml:"sessionUserIDKey"`
		SessionUserCodeKey string `toml:"sessionUserCodeKey"`
		SessionTokenKey    string `toml:"sessionTokenKey"`
		SessionExpiry      int    `toml:"sessionExpiry"`
		ServiceUserName    string `toml:"serviceUserName"`
		ServiceUserCode    string `toml:"serviceUserCode"`
		SessionExpiryKey   string `toml:"sessionExpiryKey"`
	} `toml:"Security"`
	Message struct {
		TypeKey    string `toml:"typeKey"`
		TitleKey   string `toml:"titleKey"`
		ContentKey string `toml:"contentKey"`
		ActionKey  string `toml:"actionKey"`
	} `toml:"Message"`
	Display struct {
		Delimiter string `toml:"delim"`
	} `toml:"Display"`
	Pushover struct {
		UserKey  string `toml:"userKey"`
		APIToken string `toml:"apiToken"`
	} `toml:"Pushover"`
	Status struct {
		UNKNOWN string `toml:"unknown"`
		ONLINE  string `toml:"online"`
		OFFLINE string `toml:"offline"`
		ERROR   string `toml:"error"`
		WARNING string `toml:"warning"`
	} `toml:"Status"`
	AllowedOrigins []struct {
		Name string `toml:"name"`
	} `toml:"Origins"`
	Locales []struct {
		Key  string `toml:"key"`
		Name string `toml:"name"`
	} `toml:"Locales"`
	Email struct {
		Host     string `toml:"host"`
		Port     int    `toml:"port"`
		User     string `toml:"user"`
		Password string `toml:"password"`
		From     string `toml:"from"`
		Footer   string `toml:"footer"`
		Admin    string `toml:"admin"`
	} `toml:"Email"`
	Logging struct {
		Disable struct {
			General string `toml:"general"`
			Timing  string `toml:"timing"`
			Service string `toml:"service"`
			Audit   string `toml:"audit"`

			Translation string `toml:"translation"`
			Trace       string `toml:"trace"`
			Warning     string `toml:"warning"`
			Event       string `toml:"event"`
			Security    string `toml:"security"`
			Database    string `toml:"database"`
			Api         string `toml:"api"`
			All         string `toml:"all"`
		} `toml:"disable"`
		Defaults struct {
			MaxSize    string `toml:"maxSize"`
			MaxBackups string `toml:"maxBackups"`
			MaxAge     string `toml:"maxAge"`
			Compress   string `toml:"compress"`
		} `toml:"Defaults"`
	} `toml:"Logging"`
}

func Get

func Get() *Settings

func (*Settings) AreAllLogsDisabled

func (s *Settings) AreAllLogsDisabled() bool

func (*Settings) DateFormatBackup

func (s *Settings) DateFormatBackup() string

func (*Settings) Delimiter

func (s *Settings) Delimiter() string

func (*Settings) GetAdminEmail

func (s *Settings) GetAdminEmail() string

func (*Settings) GetApplicationAuthor

func (s *Settings) GetApplicationAuthor() string

func (*Settings) GetApplicationCopyright

func (s *Settings) GetApplicationCopyright() string

func (*Settings) GetApplicationDescription

func (s *Settings) GetApplicationDescription() string

func (*Settings) GetApplicationEnvironment

func (s *Settings) GetApplicationEnvironment() string

func (*Settings) GetApplicationHomePath

func (s *Settings) GetApplicationHomePath() string

func (*Settings) GetApplicationLocale

func (s *Settings) GetApplicationLocale() string

func (*Settings) GetApplicationName

func (s *Settings) GetApplicationName() string

func (*Settings) GetApplicationPrefix

func (s *Settings) GetApplicationPrefix() string

func (*Settings) GetApplicationReleaseDate

func (s *Settings) GetApplicationReleaseDate() string

func (*Settings) GetApplicationVersion

func (s *Settings) GetApplicationVersion() string

func (*Settings) GetDatabaseHost

func (s *Settings) GetDatabaseHost() string

func (*Settings) GetDatabaseName

func (s *Settings) GetDatabaseName() string

func (*Settings) GetDatabasePassword

func (s *Settings) GetDatabasePassword() string

func (*Settings) GetDatabasePath

func (s *Settings) GetDatabasePath() string

func (*Settings) GetDatabasePoolSize

func (s *Settings) GetDatabasePoolSize() int

func (*Settings) GetDatabasePort

func (s *Settings) GetDatabasePort() int

func (*Settings) GetDatabasePortAsString

func (s *Settings) GetDatabasePortAsString() string

func (*Settings) GetDatabaseTimeout

func (s *Settings) GetDatabaseTimeout() int

func (*Settings) GetDatabaseType

func (s *Settings) GetDatabaseType() string

func (*Settings) GetDatabaseUser

func (s *Settings) GetDatabaseUser() string

func (*Settings) GetDatabaseVersion

func (s *Settings) GetDatabaseVersion() int

func (*Settings) GetDateFormat

func (s *Settings) GetDateFormat() string

func (*Settings) GetDateFormatDMY2

func (s *Settings) GetDateFormatDMY2() string

func (*Settings) GetDateFormatForBackupDirectory

func (s *Settings) GetDateFormatForBackupDirectory() string

func (*Settings) GetDateFormatYMD

func (s *Settings) GetDateFormatYMD() string

func (*Settings) GetDateTimeFormat

func (s *Settings) GetDateTimeFormat() string

func (*Settings) GetDisplayDelimiter

func (s *Settings) GetDisplayDelimiter() string

func (*Settings) GetEmailFooter

func (s *Settings) GetEmailFooter() string

func (*Settings) GetEmailHost

func (s *Settings) GetEmailHost() string

func (*Settings) GetEmailPassword

func (s *Settings) GetEmailPassword() string

func (*Settings) GetEmailPort

func (s *Settings) GetEmailPort() int

func (*Settings) GetEmailPortAsString

func (s *Settings) GetEmailPortAsString() string

func (*Settings) GetEmailSender

func (s *Settings) GetEmailSender() string

func (*Settings) GetEmailUser

func (s *Settings) GetEmailUser() string

func (*Settings) GetFaviconPath

func (s *Settings) GetFaviconPath() string

func (*Settings) GetHumanReadableDateFormat

func (s *Settings) GetHumanReadableDateFormat() string

func (*Settings) GetInternalDateFormat

func (s *Settings) GetInternalDateFormat() string

func (*Settings) GetLocaleName

func (s *Settings) GetLocaleName(in string) string

func (*Settings) GetLocales

func (s *Settings) GetLocales() []struct {
	Key  string "toml:\"key\""
	Name string "toml:\"name\""
}

func (*Settings) GetLogoPath

func (s *Settings) GetLogoPath() string

func (*Settings) GetLogsMaxAge

func (s *Settings) GetLogsMaxAge() int

func (*Settings) GetLogsMaxBackups

func (s *Settings) GetLogsMaxBackups() int

func (*Settings) GetLogsMaxSize

func (s *Settings) GetLogsMaxSize() int

func (*Settings) GetMaxHistoryEntries

func (s *Settings) GetMaxHistoryEntries() int

func (*Settings) GetMessageActionKey

func (s *Settings) GetMessageActionKey() string

func (*Settings) GetMessageContentKey

func (s *Settings) GetMessageContentKey() string

func (*Settings) GetMessageTitleKey

func (s *Settings) GetMessageTitleKey() string

func (*Settings) GetMessageTypeKey

func (s *Settings) GetMessageTypeKey() string

func (*Settings) GetPushoverToken

func (s *Settings) GetPushoverToken() string

func (*Settings) GetPushoverUserKey

func (s *Settings) GetPushoverUserKey() string

func (*Settings) GetSecurityServiceUserCode

func (s *Settings) GetSecurityServiceUserCode() string

func (*Settings) GetSecurityServiceUserName

func (s *Settings) GetSecurityServiceUserName() string

func (*Settings) GetSecuritySessionExpiryKey

func (s *Settings) GetSecuritySessionExpiryKey() string

func (*Settings) GetSecuritySessionExpiryPeriodKey

func (s *Settings) GetSecuritySessionExpiryPeriodKey() int

func (*Settings) GetSecuritySessionKeyName

func (s *Settings) GetSecuritySessionKeyName() string

func (*Settings) GetSecuritySessionTokenKey

func (s *Settings) GetSecuritySessionTokenKey() string

func (*Settings) GetSecuritySessionUserCodeKey

func (s *Settings) GetSecuritySessionUserCodeKey() string

func (*Settings) GetSecuritySessionUserIDKey

func (s *Settings) GetSecuritySessionUserIDKey() string

func (*Settings) GetServerHost

func (s *Settings) GetServerHost() string

func (*Settings) GetServerPort

func (s *Settings) GetServerPort() int

func (*Settings) GetServerPortAsString

func (s *Settings) GetServerPortAsString() string

func (*Settings) GetServerProtocol

func (s *Settings) GetServerProtocol() string

func (*Settings) GetStatus_Error

func (s *Settings) GetStatus_Error() string

func (*Settings) GetStatus_Offline

func (s *Settings) GetStatus_Offline() string

func (*Settings) GetStatus_Online

func (s *Settings) GetStatus_Online() string

func (*Settings) GetStatus_Unknown

func (s *Settings) GetStatus_Unknown() string

func (*Settings) GetStatus_Warning

func (s *Settings) GetStatus_Warning() string

func (*Settings) GetTimeFormat

func (s *Settings) GetTimeFormat() string

func (*Settings) GetTranslationLocale

func (s *Settings) GetTranslationLocale() string

func (*Settings) GetTranslationServerHost

func (s *Settings) GetTranslationServerHost() string

func (*Settings) GetTranslationServerPort

func (s *Settings) GetTranslationServerPort() int

func (*Settings) GetTranslationServerPortAsString

func (s *Settings) GetTranslationServerPortAsString() string

func (*Settings) GetTranslationServerProtocol

func (s *Settings) GetTranslationServerProtocol() string

func (*Settings) GetValidHosts

func (s *Settings) GetValidHosts() []struct {
	Name string "toml:\"name\""
	FQDN string "toml:\"fqdn\""
	IP   string "toml:\"ip\""
	Zone string "toml:\"zone\""
}

func (*Settings) GetValidOrigins

func (s *Settings) GetValidOrigins() []string

func (*Settings) IsApiLoggingDisabled

func (s *Settings) IsApiLoggingDisabled() bool

func (*Settings) IsApplicationMode

func (s *Settings) IsApplicationMode(inMode string) bool

func (*Settings) IsAuditLoggingDisabled

func (s *Settings) IsAuditLoggingDisabled() bool

func (*Settings) IsDatabaseLoggingDisabled

func (s *Settings) IsDatabaseLoggingDisabled() bool

func (*Settings) IsEventLoggingDisabled

func (s *Settings) IsEventLoggingDisabled() bool

func (*Settings) IsGeneralLoggingDisabled

func (s *Settings) IsGeneralLoggingDisabled() bool

func (*Settings) IsLogCompressionEnabled

func (s *Settings) IsLogCompressionEnabled() bool

func (*Settings) IsSecurityLoggingDisabled

func (s *Settings) IsSecurityLoggingDisabled() bool

func (*Settings) IsServiceLoggingDisabled

func (s *Settings) IsServiceLoggingDisabled() bool

func (*Settings) IsTimingLoggingDisabled

func (s *Settings) IsTimingLoggingDisabled() bool

func (*Settings) IsTraceLoggingDisabled

func (s *Settings) IsTraceLoggingDisabled() bool

func (*Settings) IsTranslationLoggingDisabled

func (s *Settings) IsTranslationLoggingDisabled() bool

func (*Settings) IsValidLocale

func (s *Settings) IsValidLocale(in string) bool

func (*Settings) IsValidOrigin

func (s *Settings) IsValidOrigin(in string) bool

func (*Settings) IsWarningLoggingDisabled

func (s *Settings) IsWarningLoggingDisabled() bool

func (*Settings) SEP

func (s *Settings) SEP() string

func (*Settings) Spew

func (s *Settings) Spew()

Jump to

Keyboard shortcuts

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