Skip to content

Commit

Permalink
chore(storage/fs/oci): remove unnecessary error and add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
GeorgeMac committed Nov 3, 2023
1 parent 9405832 commit 9ea2d76
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions internal/storage/fs/oci/source.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package oci

import (
"context"
"errors"
"time"

"github.com/opencontainers/go-digest"
Expand All @@ -12,8 +11,8 @@ import (
"go.uber.org/zap"
)

var ErrDigestSeen = errors.New("digest already seen")

// Source is an implementation fs.SnapshotSource backed by OCI repositories
// It fetches instances of OCI manifests and uses them to build snapshots from their contents
type Source struct {
logger *zap.Logger
interval time.Duration
Expand All @@ -25,7 +24,7 @@ type Source struct {

// NewSource constructs and configures a Source.
// The source uses the connection and credential details provided to build
// fs.FS implementations around a target git repository.
// *storagefs.StoreSnapshot implementations around a target git repository.
func NewSource(logger *zap.Logger, store *oci.Store, opts ...containers.Option[Source]) (_ *Source, err error) {
src := &Source{
logger: logger,
Expand Down Expand Up @@ -69,7 +68,7 @@ func (s *Source) Get(context.Context) (*storagefs.StoreSnapshot, error) {
return s.curSnap, nil
}

// Subscribe feeds implementations of fs.FS onto the provided channel.
// Subscribe feeds implementations of *storagefs.StoreSnapshot onto the provided channel.
// It should block until the provided context is cancelled (it will be called in a goroutine).
// It should close the provided channel before it returns.
func (s *Source) Subscribe(ctx context.Context, ch chan<- *storagefs.StoreSnapshot) {
Expand Down

0 comments on commit 9ea2d76

Please sign in to comment.