Example #1
0
func GetImageDiffCache(s storage.Storage, imageID string) ([]byte, error) {
	path := storage.ImageDiffPath(imageID)
	if exists, _ := s.Exists(path); exists {
		return s.Get(storage.ImageDiffPath(imageID))
	}
	// that indicates miss/successful hit/cache error...
	// weird that we have no way of knowing that this is a cache miss outside of this function, but this is how
	// docker-registry does it so we'll follow...
	return nil, nil // nil error, because cache missed
}
Example #2
0
func SetImageDiffCache(s storage.Storage, imageID string, diffJson []byte) error {
	return s.Put(storage.ImageDiffPath(imageID), diffJson)
}