diff options
Diffstat (limited to 'libpod/driver')
-rw-r--r-- | libpod/driver/driver.go | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/libpod/driver/driver.go b/libpod/driver/driver.go index 4db55852c..8475810a8 100644 --- a/libpod/driver/driver.go +++ b/libpod/driver/driver.go @@ -4,8 +4,8 @@ import cstorage "github.com/containers/storage" // Data handles the data for a storage driver type Data struct { - Name string - Data map[string]string + Name string `json:"Name"` + Data map[string]string `json:"Data"` } // GetDriverName returns the name of the driver for the given store @@ -25,3 +25,19 @@ func GetDriverMetadata(store cstorage.Store, layerID string) (map[string]string, } return driver.Metadata(layerID) } + +// GetDriverData returns the Data struct with information of the driver used by the store +func GetDriverData(store cstorage.Store, layerID string) (*Data, error) { + name, err := GetDriverName(store) + if err != nil { + return nil, err + } + metaData, err := GetDriverMetadata(store, layerID) + if err != nil { + return nil, err + } + return &Data{ + Name: name, + Data: metaData, + }, nil +} |