Documentation
¶
Index ¶
- Constants
- type Checkpoint
- type FilesystemConfig
- type FilesystemOptions
- type FilesystemProvider
- func (fp *FilesystemProvider) Close() error
- func (fp *FilesystemProvider) DeleteVersion(version string) error
- func (fp *FilesystemProvider) GetBasePath() string
- func (fp *FilesystemProvider) Initialize() error
- func (fp *FilesystemProvider) ListVersions() ([]*immutableconfig.ConfigVersion, error)
- func (fp *FilesystemProvider) Load(version string) (*immutableconfig.ConfigData, error)
- func (fp *FilesystemProvider) Save(config *immutableconfig.ConfigData) (*immutableconfig.ConfigVersion, error)
- func (fp *FilesystemProvider) VerifyIntegrity() (map[string]bool, error)
- type ImmutableFilesystem
- func (fs *ImmutableFilesystem) Close() error
- func (fs *ImmutableFilesystem) CompactWAL() error
- func (fs *ImmutableFilesystem) CreateSnapshot(name string, description string) (*snapshot.Snapshot, error)
- func (fs *ImmutableFilesystem) Delete(version string) error
- func (fs *ImmutableFilesystem) DeleteSnapshot(snapshotID string) error
- func (fs *ImmutableFilesystem) ExportCheckpoint() (*Checkpoint, error)
- func (fs *ImmutableFilesystem) GetAuditLog() []*logging.AuditEntry
- func (fs *ImmutableFilesystem) GetWALStats() map[string]int64
- func (fs *ImmutableFilesystem) GetWatcherStatus() map[string]interface{}
- func (fs *ImmutableFilesystem) Initialize() error
- func (fs *ImmutableFilesystem) IsSealed() bool
- func (fs *ImmutableFilesystem) ListSnapshots() ([]*snapshot.Snapshot, error)
- func (fs *ImmutableFilesystem) ListVersions() ([]*immutableconfig.ConfigVersion, error)
- func (fs *ImmutableFilesystem) Load(version string) (*immutableconfig.ConfigData, error)
- func (fs *ImmutableFilesystem) LoadLatest() (*immutableconfig.ConfigData, error)
- func (fs *ImmutableFilesystem) Recover() error
- func (fs *ImmutableFilesystem) RestoreSnapshot(snapshotID string) error
- func (fs *ImmutableFilesystem) Save(config *immutableconfig.ConfigData) (*immutableconfig.ConfigVersion, error)
- func (fs *ImmutableFilesystem) Seal() error
- func (fs *ImmutableFilesystem) SealedAt() time.Time
- func (fs *ImmutableFilesystem) Unseal() error
- func (fs *ImmutableFilesystem) VerifyIntegrity() (map[string]bool, error)
Constants ¶
const ( // DefaultPermissions for config files DefaultPermissions = 0644 // DefaultDirPermissions for directories DefaultDirPermissions = 0755 // ConfigFileExtension for config files ConfigFileExtension = ".config" // MetaFileExtension for metadata files MetaFileExtension = ".meta" // HashFileExtension for hash files HashFileExtension = ".hash" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Checkpoint ¶
type Checkpoint struct {
Created time.Time `json:"created"`
Versions []string `json:"versions"`
Checksums map[string]string `json:"checksums"`
WALStats map[string]int64 `json:"wal_stats"`
AuditLog []*logging.AuditEntry `json:"audit_log"`
}
Checkpoint represents a complete filesystem checkpoint
func (*Checkpoint) ToJSON ¶
func (c *Checkpoint) ToJSON() (string, error)
ToJSON exports the checkpoint to JSON
type FilesystemConfig ¶
type FilesystemConfig struct {
BasePath string
MaxVersions int
MaxAuditEntries int
WatchInterval time.Duration
EnableWatch bool
AutoSeal bool
}
FilesystemConfig configures the immutable filesystem
func DefaultFilesystemConfig ¶
func DefaultFilesystemConfig() *FilesystemConfig
DefaultFilesystemConfig returns default configuration
type FilesystemOptions ¶
FilesystemOptions for configuring the filesystem provider
func DefaultFilesystemOptions ¶
func DefaultFilesystemOptions() *FilesystemOptions
DefaultFilesystemOptions returns default filesystem options
type FilesystemProvider ¶
type FilesystemProvider struct {
// contains filtered or unexported fields
}
FilesystemProvider implements Provider using the filesystem
func NewFilesystemProvider ¶
func NewFilesystemProvider(opts *FilesystemOptions) (*FilesystemProvider, error)
NewFilesystemProvider creates a new filesystem-based provider
func (*FilesystemProvider) Close ¶
func (fp *FilesystemProvider) Close() error
Close closes the filesystem provider
func (*FilesystemProvider) DeleteVersion ¶
func (fp *FilesystemProvider) DeleteVersion(version string) error
DeleteVersion deletes a specific version (admin operation)
func (*FilesystemProvider) GetBasePath ¶
func (fp *FilesystemProvider) GetBasePath() string
GetBasePath returns the base path for the filesystem provider
func (*FilesystemProvider) Initialize ¶
func (fp *FilesystemProvider) Initialize() error
Initialize initializes the filesystem provider
func (*FilesystemProvider) ListVersions ¶
func (fp *FilesystemProvider) ListVersions() ([]*immutableconfig.ConfigVersion, error)
ListVersions lists all available versions
func (*FilesystemProvider) Load ¶
func (fp *FilesystemProvider) Load(version string) (*immutableconfig.ConfigData, error)
Load loads a specific version of the configuration
func (*FilesystemProvider) Save ¶
func (fp *FilesystemProvider) Save(config *immutableconfig.ConfigData) (*immutableconfig.ConfigVersion, error)
Save saves a new configuration version to disk
func (*FilesystemProvider) VerifyIntegrity ¶
func (fp *FilesystemProvider) VerifyIntegrity() (map[string]bool, error)
VerifyIntegrity verifies the integrity of all stored configurations
type ImmutableFilesystem ¶
type ImmutableFilesystem struct {
// contains filtered or unexported fields
}
ImmutableFilesystem provides a complete immutable, read-only filesystem implementation
func NewImmutableFilesystem ¶
func NewImmutableFilesystem(cfg *FilesystemConfig) (*ImmutableFilesystem, error)
NewImmutableFilesystem creates a new immutable filesystem
func (*ImmutableFilesystem) Close ¶
func (fs *ImmutableFilesystem) Close() error
Close closes the immutable filesystem
func (*ImmutableFilesystem) CompactWAL ¶
func (fs *ImmutableFilesystem) CompactWAL() error
CompactWAL compacts the WAL
func (*ImmutableFilesystem) CreateSnapshot ¶
func (fs *ImmutableFilesystem) CreateSnapshot(name string, description string) (*snapshot.Snapshot, error)
CreateSnapshot creates a point-in-time snapshot
func (*ImmutableFilesystem) Delete ¶
func (fs *ImmutableFilesystem) Delete(version string) error
Delete deletes a configuration version (admin operation, requires unsealed)
func (*ImmutableFilesystem) DeleteSnapshot ¶
func (fs *ImmutableFilesystem) DeleteSnapshot(snapshotID string) error
DeleteSnapshot deletes a snapshot
func (*ImmutableFilesystem) ExportCheckpoint ¶
func (fs *ImmutableFilesystem) ExportCheckpoint() (*Checkpoint, error)
ExportCheckpoint exports a complete checkpoint
func (*ImmutableFilesystem) GetAuditLog ¶
func (fs *ImmutableFilesystem) GetAuditLog() []*logging.AuditEntry
GetAuditLog returns the audit log
func (*ImmutableFilesystem) GetWALStats ¶
func (fs *ImmutableFilesystem) GetWALStats() map[string]int64
GetWALStats returns WAL statistics
func (*ImmutableFilesystem) GetWatcherStatus ¶
func (fs *ImmutableFilesystem) GetWatcherStatus() map[string]interface{}
GetWatcherStatus returns watcher status
func (*ImmutableFilesystem) Initialize ¶
func (fs *ImmutableFilesystem) Initialize() error
Initialize initializes the immutable filesystem
func (*ImmutableFilesystem) IsSealed ¶
func (fs *ImmutableFilesystem) IsSealed() bool
IsSealed returns whether the filesystem is sealed
func (*ImmutableFilesystem) ListSnapshots ¶
func (fs *ImmutableFilesystem) ListSnapshots() ([]*snapshot.Snapshot, error)
ListSnapshots lists all snapshots
func (*ImmutableFilesystem) ListVersions ¶
func (fs *ImmutableFilesystem) ListVersions() ([]*immutableconfig.ConfigVersion, error)
ListVersions lists all available versions
func (*ImmutableFilesystem) Load ¶
func (fs *ImmutableFilesystem) Load(version string) (*immutableconfig.ConfigData, error)
Load loads a configuration version
func (*ImmutableFilesystem) LoadLatest ¶
func (fs *ImmutableFilesystem) LoadLatest() (*immutableconfig.ConfigData, error)
LoadLatest loads the latest configuration version
func (*ImmutableFilesystem) Recover ¶
func (fs *ImmutableFilesystem) Recover() error
Recover recovers from WAL after a crash
func (*ImmutableFilesystem) RestoreSnapshot ¶
func (fs *ImmutableFilesystem) RestoreSnapshot(snapshotID string) error
RestoreSnapshot restores from a snapshot
func (*ImmutableFilesystem) Save ¶
func (fs *ImmutableFilesystem) Save(config *immutableconfig.ConfigData) (*immutableconfig.ConfigVersion, error)
Save saves a configuration with write-ahead logging
func (*ImmutableFilesystem) Seal ¶
func (fs *ImmutableFilesystem) Seal() error
Seal seals the filesystem, preventing all future modifications
func (*ImmutableFilesystem) SealedAt ¶
func (fs *ImmutableFilesystem) SealedAt() time.Time
SealedAt returns when the filesystem was sealed
func (*ImmutableFilesystem) Unseal ¶
func (fs *ImmutableFilesystem) Unseal() error
Unseal unseals the filesystem (admin operation)
func (*ImmutableFilesystem) VerifyIntegrity ¶
func (fs *ImmutableFilesystem) VerifyIntegrity() (map[string]bool, error)
VerifyIntegrity verifies the integrity of all configurations