Documentation
¶
Index ¶
- Variables
- type BoltStore
- func (s *BoltStore) Close() error
- func (s *BoltStore) DeleteSandbox(id string) error
- func (s *BoltStore) DeleteSnapshot(id string) error
- func (s *BoltStore) GetSandbox(id string) (*SandboxRecord, error)
- func (s *BoltStore) GetSnapshot(id string) (*SnapshotRecord, error)
- func (s *BoltStore) ListSandboxes() ([]*SandboxRecord, error)
- func (s *BoltStore) ListSnapshots(sandboxID string) ([]*SnapshotRecord, error)
- func (s *BoltStore) SaveSandbox(record *SandboxRecord) error
- func (s *BoltStore) SaveSnapshot(record *SnapshotRecord) error
- type SandboxRecord
- type SnapshotRecord
- type Store
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrNotFound = errors.New("not found")
)
Functions ¶
This section is empty.
Types ¶
type BoltStore ¶
type BoltStore struct {
// contains filtered or unexported fields
}
BoltStore implements Store using BoltDB.
func NewBoltStore ¶
NewBoltStore opens or creates a BoltDB database at the given path.
func (*BoltStore) DeleteSandbox ¶
func (*BoltStore) DeleteSnapshot ¶
func (*BoltStore) GetSandbox ¶
func (s *BoltStore) GetSandbox(id string) (*SandboxRecord, error)
func (*BoltStore) GetSnapshot ¶
func (s *BoltStore) GetSnapshot(id string) (*SnapshotRecord, error)
func (*BoltStore) ListSandboxes ¶
func (s *BoltStore) ListSandboxes() ([]*SandboxRecord, error)
func (*BoltStore) ListSnapshots ¶
func (s *BoltStore) ListSnapshots(sandboxID string) ([]*SnapshotRecord, error)
func (*BoltStore) SaveSandbox ¶
func (s *BoltStore) SaveSandbox(record *SandboxRecord) error
func (*BoltStore) SaveSnapshot ¶
func (s *BoltStore) SaveSnapshot(record *SnapshotRecord) error
type SandboxRecord ¶
type SandboxRecord struct {
ID string `json:"id"`
Image string `json:"image"`
Status string `json:"status"`
Config map[string]any `json:"config,omitempty"`
Labels map[string]string `json:"labels,omitempty"`
CreatedAt time.Time `json:"created_at"`
ExpiresAt time.Time `json:"expires_at,omitempty"`
}
SandboxRecord represents a persisted sandbox entry.
type SnapshotRecord ¶
type SnapshotRecord struct {
ID string `json:"id"`
SandboxID string `json:"sandbox_id"`
Name string `json:"name"`
ImageID string `json:"image_id"`
CreatedAt time.Time `json:"created_at"`
}
SnapshotRecord represents a persisted snapshot entry.
type Store ¶
type Store interface {
// Sandbox operations
SaveSandbox(record *SandboxRecord) error
GetSandbox(id string) (*SandboxRecord, error)
ListSandboxes() ([]*SandboxRecord, error)
DeleteSandbox(id string) error
// Snapshot operations
SaveSnapshot(record *SnapshotRecord) error
GetSnapshot(id string) (*SnapshotRecord, error)
ListSnapshots(sandboxID string) ([]*SnapshotRecord, error)
DeleteSnapshot(id string) error
// Close the store
Close() error
}
Store defines the interface for state persistence.
Click to show internal directories.
Click to hide internal directories.