Documentation
¶
Index ¶
- type Service
- func (s *Service) GetMetadata(ctx context.Context, path string) (objectstore.Metadata, error)
- func (s *Service) GetMetadataBySHA256(ctx context.Context, sha256 string) (objectstore.Metadata, error)
- func (s *Service) GetMetadataBySHA256Prefix(ctx context.Context, sha256Prefix string) (objectstore.Metadata, error)
- func (s *Service) ListMetadata(ctx context.Context) ([]objectstore.Metadata, error)
- func (s *Service) PutMetadata(ctx context.Context, metadata objectstore.Metadata) (objectstore.UUID, error)
- func (s *Service) RemoveMetadata(ctx context.Context, path string) error
- type State
- type WatchableService
- type WatcherFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service provides the API for working with the objectstore.
func NewService ¶
NewService returns a new service reference wrapping the input state.
func (*Service) GetMetadata ¶
GetMetadata returns the persistence metadata for the specified path.
func (*Service) GetMetadataBySHA256 ¶
func (s *Service) GetMetadataBySHA256(ctx context.Context, sha256 string) (objectstore.Metadata, error)
GetMetadataBySHA256 returns the persistence metadata for the object with SHA256 starting with the provided prefix.
func (*Service) GetMetadataBySHA256Prefix ¶
func (s *Service) GetMetadataBySHA256Prefix(ctx context.Context, sha256Prefix string) (objectstore.Metadata, error)
GetMetadataBySHA256Prefix returns the persistence metadata for the object with SHA256 starting with the provided prefix.
func (*Service) ListMetadata ¶
ListMetadata returns the persistence metadata for all paths.
func (*Service) PutMetadata ¶
func (s *Service) PutMetadata(ctx context.Context, metadata objectstore.Metadata) (objectstore.UUID, error)
PutMetadata adds a new specified path for the persistence metadata. If any hash is missing, a objectstoreerrors.ErrMissingHash error is returned. It is expected that the caller supplies both hashes or none and they should be consistent with the object. That's the caller's responsibility.
type State ¶
type State interface { // GetMetadata returns the persistence metadata for the specified path. GetMetadata(ctx context.Context, path string) (objectstore.Metadata, error) // GetMetadataBySHA256 returns the persistence metadata for the object // with SHA256. GetMetadataBySHA256(ctx context.Context, sha256 string) (objectstore.Metadata, error) // GetMetadataBySHA256Prefix returns the persistence metadata for the object // with SHA256 starting with the provided prefix. GetMetadataBySHA256Prefix(ctx context.Context, sha256 string) (objectstore.Metadata, error) // PutMetadata adds a new specified path for the persistence metadata. PutMetadata(ctx context.Context, metadata objectstore.Metadata) (objectstore.UUID, error) // ListMetadata returns the persistence metadata for all paths. ListMetadata(ctx context.Context) ([]objectstore.Metadata, error) // RemoveMetadata removes the specified path for the persistence metadata. RemoveMetadata(ctx context.Context, path string) error // InitialWatchStatement returns the table and the initial watch statement // for the persistence metadata. InitialWatchStatement() (string, string) }
State describes retrieval and persistence methods for the objectstore.
type WatchableService ¶
type WatchableService struct { Service // contains filtered or unexported fields }
WatchableService provides the API for working with the objectstore and the ability to create watchers.
func NewWatchableService ¶
func NewWatchableService(st State, watcherFactory WatcherFactory) *WatchableService
NewWatchableService returns a new service reference wrapping the input state.
func (*WatchableService) Watch ¶
func (s *WatchableService) Watch() (watcher.StringsWatcher, error)
Watch returns a watcher that emits the path changes that either have been added or removed.
type WatcherFactory ¶
type WatcherFactory interface { // NewNamespaceWatcher returns a new namespace watcher // for events based on the input change mask. NewNamespaceWatcher(string, changestream.ChangeType, eventsource.NamespaceQuery) (watcher.StringsWatcher, error) }
WatcherFactory describes methods for creating watchers.