Files
kata-containers/virtcontainers/persist/api/interface.go
Wei Zhang 341a988e06 persist: simplify persist api
Fixes #803

Simplify new store API to make the code easier to understand and use.

Signed-off-by: Wei Zhang <zhangwei555@huawei.com>
2019-04-30 11:54:42 +08:00

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
}