Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ComposeHistory ¶
type ComposeHistory struct {
DB Database
}
ComposeHistory used to interact with the previous compose files.
func (ComposeHistory) ListVersions ¶
func (s ComposeHistory) ListVersions() ([]Version, error)
ListVersions lists the latest stored versions of the compose history files.
func (ComposeHistory) RestoreLatestVersion ¶
func (s ComposeHistory) RestoreLatestVersion() ([]byte, error)
RestoreLatestVersion returns the latest version of the saved compose history.
func (ComposeHistory) RestoreVersion ¶
func (s ComposeHistory) RestoreVersion(version string) ([]byte, error)
RestoreVersion returns the requested version of the saved compose history.
func (ComposeHistory) SaveCurrentVersion ¶
func (s ComposeHistory) SaveCurrentVersion(bytes []byte) (string, error)
SaveCurrentVersion stores the provided compose history into the compose history records.
type Database ¶
type Database interface { Read(versionID string) ([]byte, error) Write(versionID string, data []byte) error Delete(versionID string) error GetObjectVersions() ([]Version, error) }
Database is the interface for a backing database used to store docker-compose yaml file history.
type FileDatabase ¶
type FileDatabase struct{}
FileDatabase implements is an abstraction of os.WriterFile.
func (FileDatabase) Delete ¶
func (db FileDatabase) Delete(filename string) error
Delete implements the Delete interface for a flat filesystem database.
func (FileDatabase) GetObjectVersions ¶
func (db FileDatabase) GetObjectVersions() ([]Version, error)
GetObjectVersions returns the name and modified time of all objects stored in the DB.
type VersionStore ¶
type VersionStore interface { // todo use VersionID instead of string SaveCurrentVersion(bytes []byte) (string, error) RestoreLatestVersion() ([]byte, error) // todo use VersionID instead of string RestoreVersion(string) ([]byte, error) ListVersions() ([]Version, error) }
VersionStore is the interface for operations performed on the docker-compose yaml file history.