Documentation ¶
Index ¶
- Constants
- Variables
- type Store
- func (store *Store) AreAllFilesPublished(ctx context.Context, collectionID string) (bool, error)
- func (store *Store) BatchSendKafkaMessages(ctx context.Context, cursor mongodriver.Cursor, wg *sync.WaitGroup, ...)
- func (store *Store) GetCollectionPublishedMetadata(ctx context.Context, id string) (files.StoredCollection, error)
- func (store *Store) GetFileMetadata(ctx context.Context, path string) (files.StoredRegisteredMetaData, error)
- func (store *Store) GetFilesMetadata(ctx context.Context, collectionID string) ([]files.StoredRegisteredMetaData, error)
- func (store *Store) IsCollectionEmpty(ctx context.Context, collectionID string) (bool, error)
- func (store *Store) IsCollectionPublished(ctx context.Context, collectionID string) (bool, error)
- func (store *Store) IsCollectionUploaded(ctx context.Context, collectionID string) (bool, error)
- func (store *Store) MarkCollectionPublished(ctx context.Context, collectionID string) error
- func (store *Store) MarkFileMoved(ctx context.Context, metaData files.FileEtagChange) error
- func (store *Store) MarkFilePublished(ctx context.Context, path string) error
- func (store *Store) MarkUploadComplete(ctx context.Context, metaData files.FileEtagChange) error
- func (store *Store) NotifyCollectionPublished(ctx context.Context, collectionID string)
- func (store *Store) PatchFilePublishMetadata(metadata *files.StoredRegisteredMetaData, collection *files.StoredCollection)
- func (store *Store) RegisterFileUpload(ctx context.Context, metaData files.StoredRegisteredMetaData) error
- func (store *Store) UpdateCollectionID(ctx context.Context, path, collectionID string) error
Constants ¶
View Source
const ( StateCreated = "CREATED" StateUploaded = "UPLOADED" StatePublished = "PUBLISHED" StateMoved = "MOVED" )
Variables ¶
View Source
var ( ErrDuplicateFile = errors.New("duplicate file path") ErrFileNotRegistered = errors.New("file not registered") ErrFileNotInCreatedState = errors.New("file state is not in state created") ErrFileNotInUploadedState = errors.New("file state is not in state uploaded") ErrFileStateMismatch = errors.New("file state mismatch") ErrFileIsNotPublishable = errors.New("file is not set as publishable") ErrNoFilesInCollection = errors.New("no files found in collection") ErrCollectionIDAlreadySet = errors.New("collection ID already set") ErrCollectionIDNotSet = errors.New("collection ID not set") ErrCollectionAlreadyPublished = errors.New("collection with the given id is already published") ErrCollectionMetadataNotRegistered = errors.New("collection metadata not registered") ErrEtagMismatchWhilePublishing = errors.New("etag mismatch") )
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func NewStore ¶
func NewStore(metadataCollection mongo.MongoCollection, collectionsCollection mongo.MongoCollection, kafkaProducer kafka.IProducer, clk clock.Clock, c aws.S3Clienter, cfg *config.Config) *Store
func (*Store) AreAllFilesPublished ¶ added in v1.3.0
func (*Store) BatchSendKafkaMessages ¶ added in v1.2.0
func (*Store) GetCollectionPublishedMetadata ¶ added in v1.3.0
func (*Store) GetFileMetadata ¶
func (*Store) GetFilesMetadata ¶
func (*Store) IsCollectionEmpty ¶ added in v1.2.0
func (*Store) IsCollectionPublished ¶ added in v1.3.0
func (*Store) IsCollectionUploaded ¶ added in v1.2.0
func (*Store) MarkCollectionPublished ¶
func (*Store) MarkFileMoved ¶ added in v1.3.0
func (*Store) MarkFilePublished ¶
func (*Store) MarkUploadComplete ¶
func (*Store) NotifyCollectionPublished ¶ added in v1.2.0
func (*Store) PatchFilePublishMetadata ¶ added in v1.3.0
func (store *Store) PatchFilePublishMetadata(metadata *files.StoredRegisteredMetaData, collection *files.StoredCollection)
For the optimisation purposes, we store the Florence collection publishing information in a separate DB collection. This makes the collection publishing instantaneous by removing a need to update the publish state of all the files in the collection, which takes a very long time for large collections. Because of this, we need to patch the file metadata in a specific case documented below.
func (*Store) RegisterFileUpload ¶
Click to show internal directories.
Click to hide internal directories.