Documentation ¶
Index ¶
- func GetDatabaseConfigName() ([]string, error)
- func GetStorageConfigName() ([]string, error)
- func InteractiveRegisterDatabase()
- func InteractiveRegisterStorage()
- func RegisterDatabase(databaseType DatabaseType, name string, cronExpr string, storages []string, ...) error
- func RegisterLocalFilesDatabase(path string) (*localfiles.LocalFilesRequirements, error)
- func RegisterLocalStorage(path string) (*localstorage.LocalStorageRequirements, error)
- func RegisterPostgresqlDatabase(host string, user string, name string, password string) (*postgresql.PostgresqlRequirements, error)
- func RegisterS3Storage(bucket_name string, access_key_id string, access_key_secret string, ...) (*s3.S3Requirements, error)
- func RegisterSqlite3Database(path string) (*sqlite3.Sqlite3Requirements, error)
- func RegisterStorage(storageType StorageType, name string, retention int, cipher_key string, ...) error
- func SetMasterPassword(config *Config, password string) error
- func UpdateConfig(config Config) error
- func ValidateMasterPassword(config *Config, password string) error
- func WriteConfigUnciphered(path string, config Config) error
- type Config
- type Database
- type DatabaseType
- type SecureManager
- type Storage
- type StorageType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetDatabaseConfigName ¶
func GetStorageConfigName ¶
func InteractiveRegisterDatabase ¶
func InteractiveRegisterDatabase()
func InteractiveRegisterStorage ¶
func InteractiveRegisterStorage()
func RegisterDatabase ¶
func RegisterDatabase(databaseType DatabaseType, name string, cronExpr string, storages []string, requirements interface{}) error
func RegisterLocalStorage ¶
func RegisterLocalStorage(path string) (*localstorage.LocalStorageRequirements, error)
func RegisterPostgresqlDatabase ¶
func RegisterPostgresqlDatabase(host string, user string, name string, password string) (*postgresql.PostgresqlRequirements, error)
func RegisterS3Storage ¶
func RegisterSqlite3Database ¶
func RegisterSqlite3Database(path string) (*sqlite3.Sqlite3Requirements, error)
func RegisterStorage ¶
func SetMasterPassword ¶
SetMasterPassword sets the master password for config export
func UpdateConfig ¶
UpdateConfig updates the configuration file with the provided config
func ValidateMasterPassword ¶
ValidateMasterPassword checks if the provided password matches the stored hash
func WriteConfigUnciphered ¶
WriteConfigUnciphered writes the config to the specified path without encryption
Types ¶
type Config ¶
type Config struct { Version string `yaml:"version"` MasterHash string `yaml:"master_hash,omitempty"` Databases []Database `yaml:"databases,omitempty"` Storages []Storage `yaml:"storages,omitempty"` }
func ReadConfigUnciphered ¶
ReadConfigUnciphered reads the config file and returns an unciphered copy
type Database ¶
type Database struct { Type DatabaseType `yaml:"database_type"` Name string `yaml:"name"` Postgresql postgresql.PostgresqlRequirements `yaml:"postgresql,omitempty"` Sqlite3 sqlite3.Sqlite3Requirements `yaml:"sqlite3,omitempty"` LocalFiles localfiles.LocalFilesRequirements `yaml:"local_files,omitempty"` Storages []string `yaml:"storages"` Cron string `yaml:"cron"` }
func ReadDatabaseConfig ¶
type DatabaseType ¶
type DatabaseType int64
const ( Postgresql DatabaseType = 1 Sqlite3 DatabaseType = 2 LocalFiles DatabaseType = 3 )
type SecureManager ¶
type SecureManager struct {
// contains filtered or unexported fields
}
func NewSecureManager ¶
func NewSecureManager(noEncryption bool) (*SecureManager, error)
NewSecureManager creates a new secure manager instance
func (*SecureManager) DecryptConfig ¶
func (sm *SecureManager) DecryptConfig(config *Config) error
DecryptConfig decrypts sensitive fields in the configuration
func (*SecureManager) SecureConfig ¶
func (sm *SecureManager) SecureConfig(config *Config) error
SecureConfig encrypts sensitive fields in the configuration
type Storage ¶
type Storage struct { Type StorageType `yaml:"storage_type"` Name string `yaml:"name"` CipherKey string `yaml:"cypher_key"` RetentionDays int `yaml:"retention_days" default:"21"` ExecuteRetentionPolicy bool `yaml:"execute_retention_policy" default:"true"` Compression bool `yaml:"compression" default:"true"` LocalStorage localstorage.LocalStorageRequirements `yaml:"local_storage,omitempty"` // Make local_storage optional S3 s3.S3Requirements `yaml:"s3,omitempty"` // Make s3 optional }
func ReadStorageConfig ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.