store

package
v1.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateCreated   = "CREATED"
	StateUploaded  = "UPLOADED"
	StatePublished = "PUBLISHED"
	StateDecrypted = "DECRYPTED"
)

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")
	ErrFileNotInPublishedState    = errors.New("file state is not in state published")
	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")
)

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

func NewStore

func NewStore(collection mongo.MongoCollection, kafkaProducer kafka.IProducer, clk clock.Clock, cfg *config.Config) *Store

func (*Store) BatchSendKafkaMessages added in v1.2.0

func (store *Store) BatchSendKafkaMessages(
	ctx context.Context,
	cursor mongodriver.Cursor,
	wg *sync.WaitGroup,
	collectionID string,
	offset,
	batch_size,
	batch_num int,
)

func (*Store) GetFileMetadata

func (store *Store) GetFileMetadata(ctx context.Context, path string) (files.StoredRegisteredMetaData, error)

func (*Store) GetFilesMetadata

func (store *Store) GetFilesMetadata(ctx context.Context, collectionID string) ([]files.StoredRegisteredMetaData, error)

func (*Store) IsCollectionEmpty added in v1.2.0

func (store *Store) IsCollectionEmpty(ctx context.Context, collectionID string) (bool, error)

func (*Store) IsCollectionUploaded added in v1.2.0

func (store *Store) IsCollectionUploaded(ctx context.Context, collectionID string) (bool, error)

func (*Store) MarkCollectionPublished

func (store *Store) MarkCollectionPublished(ctx context.Context, collectionID string) error

func (*Store) MarkFileDecrypted

func (store *Store) MarkFileDecrypted(ctx context.Context, metaData files.FileEtagChange) error

func (*Store) MarkFilePublished

func (store *Store) MarkFilePublished(ctx context.Context, path string) error

func (*Store) MarkUploadComplete

func (store *Store) MarkUploadComplete(ctx context.Context, metaData files.FileEtagChange) error

func (*Store) NotifyCollectionPublished added in v1.2.0

func (store *Store) NotifyCollectionPublished(ctx context.Context, collectionID string)

func (*Store) RegisterFileUpload

func (store *Store) RegisterFileUpload(ctx context.Context, metaData files.StoredRegisteredMetaData) error

func (*Store) UpdateCollectionID

func (store *Store) UpdateCollectionID(ctx context.Context, path, collectionID string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL