Files
kopia/repo/content/content_reader.go
Jarek Kowalski 524ffaf4b8 refactor(repository): added context to potentially blocking repository methods (#3654)
Primarily for wiring a context.Context to a call to content.Manager.refresh,
which was using a detached context.
2024-02-20 14:48:23 -08:00

21 lines
719 B
Go

package content
import (
"context"
"github.com/kopia/kopia/internal/epoch"
"github.com/kopia/kopia/repo/format"
)
// Reader defines content read API.
type Reader interface {
SupportsContentCompression(ctx context.Context) (bool, error)
ContentFormat() format.Provider
GetContent(ctx context.Context, id ID) ([]byte, error)
ContentInfo(ctx context.Context, id ID) (Info, error)
IterateContents(ctx context.Context, opts IterateOptions, callback IterateCallback) error
IteratePacks(ctx context.Context, opts IteratePackOptions, callback IteratePacksCallback) error
ListActiveSessions(ctx context.Context) (map[SessionID]*SessionInfo, error)
EpochManager(ctx context.Context) (*epoch.Manager, bool, error)
}