wotoConfig

package
v0.0.0-...-85f0429 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CompressedFileExtension = ".zip"
)

Variables

Functions

func GetAppHash

func GetAppHash() string

func GetAppId

func GetAppId() int

func GetBaseDirForBackup

func GetBaseDirForBackup(value string) string

func GetBotToken

func GetBotToken() string

func GetDbPath

func GetDbPath() string

func GetGlobalLogChannels

func GetGlobalLogChannels() []int64

func GetPgDumpCommand

func GetPgDumpCommand() string

func GetPrefixes

func GetPrefixes() []rune

func GetProxy

func GetProxy() string

func GetScheduleManagerInterval

func GetScheduleManagerInterval() time.Duration

func GetSessionPath

func GetSessionPath() string

func IsDebug

func IsDebug() bool

func IsOwner

func IsOwner(id int64) bool

func LoadConfig

func LoadConfig() error

func LoadConfigFromFile

func LoadConfigFromFile(fileName string) error

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)

Jump to

Keyboard shortcuts

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