move driver and image metadata to libkpod

Signed-off-by: Ryan Cole <rcyoalne@gmail.com>
This commit is contained in:
Ryan Cole 2017-07-21 16:43:30 -04:00
parent a95bbe9608
commit 95e17b4a73
10 changed files with 81 additions and 903 deletions

24
libkpod/driver/driver.go Normal file
View file

@ -0,0 +1,24 @@
package driver
import cstorage "github.com/containers/storage"
type DriverData struct {
Name string
Data map[string]string
}
func GetDriverName(store cstorage.Store) (string, error) {
driver, err := store.GraphDriver()
if err != nil {
return "", err
}
return driver.String(), nil
}
func GetDriverMetadata(store cstorage.Store, layerID string) (map[string]string, error) {
driver, err := store.GraphDriver()
if err != nil {
return nil, err
}
return driver.Metadata(layerID)
}