Documentation ¶
Index ¶
- type ChangesCol
- type DB
- type FirestoreDB
- func (f *FirestoreDB) GetChangeAttempts(ctx context.Context, changeID, patchsetID int64, changesCol ChangesCol) (*types.ChangeAttempts, error)
- func (f *FirestoreDB) GetCurrentChanges(ctx context.Context) (map[string]*types.CurrentlyProcessingChange, error)
- func (f *FirestoreDB) PutChangeAttempt(ctx context.Context, newChangeAttempt *types.ChangeAttempt, ...) error
- func (f *FirestoreDB) PutCurrentChanges(ctx context.Context, currentChangesCache interface{}) error
- func (f *FirestoreDB) UpdateChangeAttemptAsAbandoned(ctx context.Context, changeID, patchsetID int64, changesCol ChangesCol, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ChangesCol ¶
type ChangesCol string
func GetChangesCol ¶
func GetChangesCol(internal bool) ChangesCol
Utility function to return which changes col name to use based on if the change is internal or not.
type DB ¶
type DB interface { // GetCurrentChanges returns the changes that were processed by the last // iteration. If none is found in DB then an empty map is returned. GetCurrentChanges(ctx context.Context) (map[string]*types.CurrentlyProcessingChange, error) // PutCurrentChanges returns the changes that were processed by the last // iteration. PutCurrentChanges(ctx context.Context, currentChangesCache interface{}) error // GetChangeAttempts returns all ChangeAttempts in the DB for this // change+patchset. GetChangeAttempts(ctx context.Context, changeID, patchsetID int64, changesCol ChangesCol) (*types.ChangeAttempts, error) // UpdateChangeAttemptAsAbandoned marks the specified change attempt as // abandoned. UpdateChangeAttemptAsAbandoned(ctx context.Context, changeID, patchsetID int64, changesCol ChangesCol, patchStart int64) error // PutChangeAttempts adds the specified change attempt to the DB. PutChangeAttempt(ctx context.Context, newChangeAttempt *types.ChangeAttempt, changesCol ChangesCol) error }
type FirestoreDB ¶
type FirestoreDB struct {
// contains filtered or unexported fields
}
FirestoreDB uses Cloud Firestore for storage and implements the DB interface.
func (*FirestoreDB) GetChangeAttempts ¶
func (f *FirestoreDB) GetChangeAttempts(ctx context.Context, changeID, patchsetID int64, changesCol ChangesCol) (*types.ChangeAttempts, error)
GetChangeAttempts implements the DB interface.
func (*FirestoreDB) GetCurrentChanges ¶
func (f *FirestoreDB) GetCurrentChanges(ctx context.Context) (map[string]*types.CurrentlyProcessingChange, error)
GetCurrentChanges implements the DB interface.
func (*FirestoreDB) PutChangeAttempt ¶
func (f *FirestoreDB) PutChangeAttempt(ctx context.Context, newChangeAttempt *types.ChangeAttempt, changesCol ChangesCol) error
PutChangeAttempt implements the DB interface.
func (*FirestoreDB) PutCurrentChanges ¶
func (f *FirestoreDB) PutCurrentChanges(ctx context.Context, currentChangesCache interface{}) error
PutCurrentChanges implements the DB interface.
func (*FirestoreDB) UpdateChangeAttemptAsAbandoned ¶
func (f *FirestoreDB) UpdateChangeAttemptAsAbandoned(ctx context.Context, changeID, patchsetID int64, changesCol ChangesCol, patchStart int64) error
UpdateChangeAttemptAsAbandoned implements the DB interface.
Click to show internal directories.
Click to hide internal directories.