Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoRollMiniStatus ¶
type AutoRollMiniStatus struct { // Revision of the current roll, if any. CurrentRollRev string `json:"currentRollRev"` // Revision of the last successful roll. LastRollRev string `json:"lastRollRev"` // The current mode of the roller. // Note: This duplicates what is stored in the modes DB but is more // convenient for users like status.skia.org. Mode string `json:"mode"` // The number of failed rolls since the last successful roll. NumFailedRolls int `json:"numFailed"` // The number of commits which have not been rolled. NumNotRolledCommits int `json:"numBehind"` // Timestamp is the time at which the roller last reported its status. Timestamp time.Time `json:"timestamp"` // LastSuccessfulRollTimestamp is the time at which the last successful roll // was performed. If there have not been any recent successful rolls, the // timestamp will be an empty time.Time{}. LastSuccessfulRollTimestamp time.Time `json:"lastRollTimestamp"` }
AutoRollMiniStatus is a struct which provides a minimal amount of status information about the AutoRoll Bot. TODO(borenet): Some of this duplicates things in AutoRollStatus. Revisit and either don't include AutoRollMiniStatus in AutoRollStatus or de-dupe the fields after revamping the UI.
type AutoRollStatus ¶
type AutoRollStatus struct { AutoRollMiniStatus ChildHead string `json:"childHead"` ChildName string `json:"childName"` CurrentRoll *autoroll.AutoRollIssue `json:"currentRoll"` Error string `json:"error"` FullHistoryUrl string `json:"fullHistoryUrl"` IssueUrlBase string `json:"issueUrlBase"` LastRoll *autoroll.AutoRollIssue `json:"lastRoll"` NotRolledRevisions []*revision.Revision `json:"notRolledRevs"` ParentName string `json:"parentName"` Recent []*autoroll.AutoRollIssue `json:"recent"` Status string `json:"status"` ThrottledUntil int64 `json:"throttledUntil"` ValidModes []string `json:"validModes"` ValidStrategies []string `json:"validStrategies"` }
AutoRollStatus is a struct which provides roll-up status information about the AutoRoll Bot.
func (*AutoRollStatus) Copy ¶
func (s *AutoRollStatus) Copy() *AutoRollStatus
type Cache ¶
type Cache struct { DB // contains filtered or unexported fields }
Cache stores the most recent AutoRollStatus.
func (*Cache) Get ¶
func (c *Cache) Get() *AutoRollStatus
Get returns the AutoRollStatus as of the last call to Update().
func (*Cache) GetMini ¶
func (c *Cache) GetMini() *AutoRollMiniStatus
GetMini returns the AutoRollMiniStatus as of the last call to Update().
type DB ¶
type DB interface { // Get the most recent AutoRollStatus for the given roller. Get(ctx context.Context, rollerName string) (*AutoRollStatus, error) // Set a new AutoRollStatus for the given roller. Set(ctx context.Context, rollerName string, st *AutoRollStatus) error // Close cleans up resources used by the DB. Close() error }
DB tracks the status of the autoroller.
type DatastoreDB ¶
type DatastoreDB struct{}
DatastoreDB is a DB which uses Datastore.
func NewDatastoreDB ¶
func NewDatastoreDB() *DatastoreDB
NewDatastoreDB returns a DatastoreDB instance.
func (*DatastoreDB) Get ¶
func (d *DatastoreDB) Get(ctx context.Context, rollerName string) (*AutoRollStatus, error)
Get the AutoRollStatus for the given roller from the datastore.
func (*DatastoreDB) Set ¶
func (d *DatastoreDB) Set(ctx context.Context, rollerName string, st *AutoRollStatus) error
Set the AutoRollStatus for the given roller in the datastore.
type DsStatusWrapper ¶
type DsStatusWrapper struct { Data []byte `datastore:"data,noindex"` Roller string `datastore:"roller"` }
DsStatusWrapper is a helper struct used for storing an AutoRollStatus in the datastore.
type FirestoreDB ¶
type FirestoreDB struct {
// contains filtered or unexported fields
}
FirestoreDB implements DB using Firestore.
func NewFirestoreDB ¶
NewFirestoreDB returns a FirestoreDB instance using the given Client.
func NewFirestoreDBWithParams ¶
func NewFirestoreDBWithParams(ctx context.Context, project, namespace, instance string, ts oauth2.TokenSource) (*FirestoreDB, error)
NewFirestoreDBWithParams returns a FirestoreDB instance using the given params.
func (*FirestoreDB) Get ¶
func (d *FirestoreDB) Get(ctx context.Context, rollerID string) (*AutoRollStatus, error)
Get implements DB.
func (*FirestoreDB) Set ¶
func (d *FirestoreDB) Set(ctx context.Context, rollerID string, st *AutoRollStatus) error
Set implements DB.