Compare commits
2 Commits
v0.1.8-alp
...
alpha
Author | SHA1 | Date | |
---|---|---|---|
19c02d3573
|
|||
1f837afadc
|
20
api.go
20
api.go
@ -143,6 +143,18 @@ func New(options AgateOptions) (*Agate, error) {
|
||||
return agate, nil
|
||||
}
|
||||
|
||||
func (a *Agate) GetActiveDir() string {
|
||||
return a.options.BlobStore.GetActiveDir()
|
||||
}
|
||||
|
||||
func (a *Agate) GetMetadataDir() string {
|
||||
return a.metadataDir
|
||||
}
|
||||
|
||||
func (a *Agate) GetBlobsDir() string {
|
||||
return a.blobsDir
|
||||
}
|
||||
|
||||
// SaveSnapshot creates a new snapshot from the current state of the active directory.
|
||||
// If parentID is provided, it will be set as the parent of the new snapshot.
|
||||
// If parentID is empty, it will use the ID of the snapshot currently loaded in the active directory.
|
||||
@ -283,11 +295,13 @@ func (a *Agate) saveCurrentSnapshotID() error {
|
||||
return os.WriteFile(a.currentIDFile, []byte(a.currentSnapshotID), 0644)
|
||||
}
|
||||
|
||||
func (a *Agate) Open() error {
|
||||
return a.options.OpenFunc(a.GetActiveDir())
|
||||
}
|
||||
|
||||
// Close releases all resources used by the Agate instance.
|
||||
func (a *Agate) Close() error {
|
||||
// Currently, we don't have a way to close the manager directly
|
||||
// This would be a good addition in the future
|
||||
return nil
|
||||
return a.options.CloseFunc()
|
||||
}
|
||||
|
||||
// StartServer starts a gRPC server to share snapshots.
|
||||
|
Reference in New Issue
Block a user