Documentation
¶
Index ¶
- Constants
- Variables
- func GetAppHash() string
- func GetAppId() int
- func GetBaseDirForBackup(value string) string
- func GetBotToken() string
- func GetDbPath() string
- func GetGlobalLogChannels() []int64
- func GetPgDumpCommand() string
- func GetPrefixes() []rune
- func GetProxy() string
- func GetScheduleManagerInterval() time.Duration
- func GetSessionPath() string
- func IsDebug() bool
- func IsOwner(id int64) bool
- func LoadConfig() error
- func LoadConfigFromFile(fileName string) error
- func PrepareDirectories()
- type DatabaseBackupType
- type MainConfigSection
- type ValueSection
Constants ¶
View Source
const (
CompressedFileExtension = ".zip"
)
Variables ¶
View Source
var WotoConf *strongParser.MainAndArrayContainer[MainConfigSection, ValueSection]
Functions ¶
func GetAppHash ¶
func GetAppHash() string
func GetBaseDirForBackup ¶
func GetBotToken ¶
func GetBotToken() string
func GetGlobalLogChannels ¶
func GetGlobalLogChannels() []int64
func GetPgDumpCommand ¶
func GetPgDumpCommand() string
func GetPrefixes ¶
func GetPrefixes() []rune
func GetSessionPath ¶
func GetSessionPath() string
func LoadConfig ¶
func LoadConfig() error
func LoadConfigFromFile ¶
func PrepareDirectories ¶
func PrepareDirectories()
Types ¶
type DatabaseBackupType ¶
type DatabaseBackupType string
const ( // BackupTypeDump will make a .dump file output from the postgres database. BackupTypeDump DatabaseBackupType = "dump" // BackupTypeSQL will make a .sql file output from the postgres database. BackupTypeSQL DatabaseBackupType = "sql" // BackupTypeSQLite will just make a zip from the sqlite file. BackupTypeSQLite DatabaseBackupType = "sqlite" // BackupTypeFile will just convert the file to zip. BackupTypeFile DatabaseBackupType = "file" // BackupTypeDirectory will just convert the directory to zip. BackupTypeDirectory DatabaseBackupType = "directory" // BackupTypeFolder will just convert the folder to zip. BackupTypeFolder DatabaseBackupType = "folder" // same as directory )
backup types
func (DatabaseBackupType) IsInvalidType ¶
func (d DatabaseBackupType) IsInvalidType() bool
type MainConfigSection ¶
type MainConfigSection struct { AppId int `key:"app_id"` AppHash string `key:"app_hash"` Proxy string `key:"proxy"` BotToken string `key:"bot_token"` DatabasePath string `key:"database_path"` BackupsBaseDir string `key:"backups_base_directory_path"` PgDumpCommand string `key:"pg_dump_command"` GlobalLogChannels []int64 `key:"global_log_channels"` Owners []int64 `key:"owners"` CmdPrefixes []rune `key:"cmd_prefixes" type:"[]rune"` SessionFile string `key:"session_file"` ScheduleManagerInterval int `key:"schedule_manager_interval" default:"10"` Debug bool `key:"debug"` }
type ValueSection ¶
type ValueSection struct { DbUrl string `key:"db_url"` DbPath string `key:"db_path"` LogChannels []int64 `key:"log_channels"` BackupType string `key:"backup_type" default:"sql"` BackupInterval int `key:"backup_interval" default:"10"` NoGlobal bool `key:"no_global"` // contains filtered or unexported fields }
func GetDatabasesConfigs ¶
func GetDatabasesConfigs() []*ValueSection
func GetSectionValueByName ¶
func GetSectionValueByName(name string) *ValueSection
func (*ValueSection) GetSectionName ¶
func (v *ValueSection) GetSectionName() string
func (*ValueSection) SetSectionName ¶
func (v *ValueSection) SetSectionName(name string)
Click to show internal directories.
Click to hide internal directories.