mirror of
https://github.com/aljazceru/kata-containers.git
synced 2025-12-26 18:44:47 +01:00
Fixes #803 Simplify new store API to make the code easier to understand and use. Signed-off-by: Wei Zhang <zhangwei555@huawei.com>
18 lines
611 B
Go
18 lines
611 B
Go
// Copyright (c) 2019 Huawei Corporation
|
|
//
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
//
|
|
|
|
package persistapi
|
|
|
|
// PersistDriver is interface describing operations to save/restore persist data
|
|
type PersistDriver interface {
|
|
// ToDisk flushes data to disk(or other storage media such as a remote db)
|
|
ToDisk(SandboxState, map[string]ContainerState) error
|
|
// FromDisk will restore all data for sandbox with `sid` from storage.
|
|
// We only support get data for one whole sandbox
|
|
FromDisk(sid string) (SandboxState, map[string]ContainerState, error)
|
|
// Destroy will remove everything from storage
|
|
Destroy() error
|
|
}
|