Files
kata-containers/virtcontainers/persist/api/interface.go
Wei Zhang 989b3737c7 docs: fix lisence header to 2019
Modify lisense header from 2018 to 2019.

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

24 lines
912 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() error
// FromDisk will restore all data for sandbox with `sid` from storage.
// We only support get data for one whole sandbox
FromDisk(sid string) error
// AddSaveCallback addes callback function named `name` to driver storage list
// The callback functions will be invoked when calling `ToDisk()`, notice that
// callback functions are not order guaranteed,
AddSaveCallback(name string, f SetFunc)
// Destroy will remove everything from storage
Destroy() error
// GetStates will return SandboxState and ContainerState(s) directly
GetStates() (*SandboxState, map[string]ContainerState, error)
}