VolumeDBContentTypeToContentType converts internal content type DB code to driver representation.
(volDBType int)
| 167 | |
| 168 | // VolumeDBContentTypeToContentType converts internal content type DB code to driver representation. |
| 169 | func VolumeDBContentTypeToContentType(volDBType int) (drivers.ContentType, error) { |
| 170 | switch volDBType { |
| 171 | case db.StoragePoolVolumeContentTypeBlock: |
| 172 | return drivers.ContentTypeBlock, nil |
| 173 | case db.StoragePoolVolumeContentTypeFS: |
| 174 | return drivers.ContentTypeFS, nil |
| 175 | case db.StoragePoolVolumeContentTypeISO: |
| 176 | return drivers.ContentTypeISO, nil |
| 177 | } |
| 178 | |
| 179 | return "", errors.New("Invalid volume content type") |
| 180 | } |
| 181 | |
| 182 | // VolumeContentTypeNameToContentType converts volume content type string internal code. |
| 183 | func VolumeContentTypeNameToContentType(contentTypeName string) (int, error) { |
no outgoing calls
no test coverage detected
searching dependent graphs…