Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type CleanupRequest ¶
type CleanupRequest struct { RollerID string NeedsCleanup bool User string Timestamp time.Time Justification string }
CleanupRequest describes a request to clean up a roller.
func (*CleanupRequest) Validate ¶
func (req *CleanupRequest) Validate() error
Validate returns an error if the CleanupRequest is invalid.
type DB ¶
type DB interface { // RequestCleanup requests or cancels an existing request for cleanup. RequestCleanup(ctx context.Context, req *CleanupRequest) error // History returns the requests for cleanup for a given roller, sorted most- // recent first. If greater than zero, `limit` controls the number of // results. History(ctx context.Context, rollerID string, limit int) ([]*CleanupRequest, error) }
DB provides a mechanism for users (or the roller itself) to request cleanup (ie. deleting local data) of a roller.
func NewDBWithParams ¶
func NewDBWithParams(ctx context.Context, project, instance string, ts oauth2.TokenSource) (DB, error)
NewDB returns a DB instance backed by Firestore, using the given params.
type FirestoreDB ¶
type FirestoreDB struct {
// contains filtered or unexported fields
}
FirestoreDB implements DB using Firestore.
func (*FirestoreDB) History ¶
func (c *FirestoreDB) History(ctx context.Context, rollerID string, limit int) ([]*CleanupRequest, error)
History implements DB.
func (*FirestoreDB) RequestCleanup ¶
func (c *FirestoreDB) RequestCleanup(ctx context.Context, req *CleanupRequest) error
RequestCleanup implements DB.
Click to show internal directories.
Click to hide internal directories.