Skip to content

Commit

Permalink
removed the RS variable name
Browse files Browse the repository at this point in the history
Signed-off-by: Xiaoxuan Wang <[email protected]>
  • Loading branch information
wangxiaoxuan273 committed Sep 4, 2023
1 parent b74100d commit 8e6b07a
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions content/oci/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ var bufPool = sync.Pool{
// Storage is a CAS based on file system with the OCI-Image layout.
// Reference: https://github.com/opencontainers/image-spec/blob/v1.1.0-rc4/image-layout.md
type Storage struct {
rs *ReadOnlyStorage
*ReadOnlyStorage
// root is the root directory of the OCI layout.
root string
// ingestRoot is the root directory of the temporary ingest files.
Expand All @@ -59,20 +59,12 @@ func NewStorage(root string) (*Storage, error) {
}

return &Storage{
rs: NewStorageFromFS(os.DirFS(rootAbs)),
root: rootAbs,
ingestRoot: filepath.Join(rootAbs, "ingest"),
ReadOnlyStorage: NewStorageFromFS(os.DirFS(rootAbs)),
root: rootAbs,
ingestRoot: filepath.Join(rootAbs, "ingest"),
}, nil
}

func (s *Storage) Fetch(ctx context.Context, target ocispec.Descriptor) (io.ReadCloser, error) {
return s.rs.Fetch(ctx, target)
}

func (s *Storage) Exists(ctx context.Context, target ocispec.Descriptor) (bool, error) {
return s.rs.Exists(ctx, target)
}

// Push pushes the content, matching the expected descriptor.
func (s *Storage) Push(_ context.Context, expected ocispec.Descriptor, content io.Reader) error {
path, err := blobPath(expected.Digest)
Expand Down

0 comments on commit 8e6b07a

Please sign in to comment.