Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrBackupFileNotExist is returned when the file the backup was saved to does not exist anymore ErrBackupFileNotExist = errors.New("Backup file does not exist") // ErrBackupOriginalFileNotExist is returned when the original file of the backup does not exist ErrBackupOriginalFileNotExist = errors.New("Original file does not exist") )
Functions ¶
func NewMainConfigStorage ¶
func NewMainConfigStorage(n agent.Nginx) storage.MainConfigStorage
NewMainConfigStorage stores the config in the file system configures a local nginx instance
func NewServerConfigStorage ¶
func NewServerConfigStorage(n agent.Nginx) storage.ServerConfigStorage
NewServerConfigStorage stores the config in the file system configures a local nginx instance
Types ¶
type Backup ¶
type Backup struct {
// contains filtered or unexported fields
}
Backup represents the backup of a file
func CreateBackup ¶
CreateBackup creates a new backup
type BackupFactory ¶
BackupFactory creates backups
type Transaction ¶
type Transaction interface { Delete(filename string) error Update(filename, content string) error Rollback() Apply() }
Transaction records file changes and is able to roll them back
func CreateTransaction ¶
func CreateTransaction() Transaction
CreateTransaction creates a new transaction instance
type TransactionFactory ¶
type TransactionFactory func() Transaction
TransactionFactory creates new transactions
Click to show internal directories.
Click to hide internal directories.