Documentation ¶
Index ¶
- Variables
- type Store
- func (s *Store) Close() error
- func (s *Store) CreateUnpreparedBatch(ctx context.Context, sdID broker.BatchID, dataCid cid.Cid) error
- func (s *Store) GetNextPending(ctx context.Context) (UnpreparedBatch, bool, error)
- func (s *Store) MoveToStatus(ctx context.Context, sdID broker.BatchID, delay time.Duration, ...) error
- type UnpreparedBatch
- type UnpreparedBatchStatus
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrBatchExists if the provided batch id already exists. ErrBatchExists = errors.New("batch-id already exists") )
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a store for unprepared batches.
func (*Store) CreateUnpreparedBatch ¶
func (s *Store) CreateUnpreparedBatch(ctx context.Context, sdID broker.BatchID, dataCid cid.Cid) error
CreateUnpreparedBatch creates a new pending unprepared batch to be prepared.
func (*Store) GetNextPending ¶
GetNextPending returns the next pending batch to process and set the status to Executing. The caller is responsible for updating the status later to Pending on error, or Done on success.
type UnpreparedBatch ¶
type UnpreparedBatch struct { BatchID broker.BatchID DataCid cid.Cid ReadyAt time.Time CreatedAt time.Time UpdatedAt time.Time }
UnpreparedBatch is a batch that is ready to be prepared.
type UnpreparedBatchStatus ¶
type UnpreparedBatchStatus int
UnpreparedBatchStatus is the status of an unprepared batch.
const ( // StatusPending is an unprepared batch ready to prepared. StatusPending UnpreparedBatchStatus = iota // StatusExecuting is an unprepared batch being prepared. StatusExecuting // StatusDone is an unprepared batch already prepared. StatusDone )
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
Package migrations generated by go-bindata.// sources: migrations/001_init.down.sql migrations/001_init.up.sql
|
Package migrations generated by go-bindata.// sources: migrations/001_init.down.sql migrations/001_init.up.sql |
Click to show internal directories.
Click to hide internal directories.