Documentation
¶
Index ¶
Constants ¶
const ( MaxInboxes = 20 MaxNameLength = 40 MaxOwners = 50 MaxRepositories = 50 MaxQueryLength = 500 )
Limits and the allowed values of the enumerated fields.
const ( CodeInvalidRequest = "invalid_request" CodeInvalidInbox = "invalid_inbox" CodeTooMany = "too_many_inboxes" CodeLastInbox = "last_inbox" CodeDuplicateName = "duplicate_name" CodeDuplicateID = "duplicate_id" CodeStale = "stale_revision" CodeUnreadable = "inboxes_unreadable" )
Error codes of the API.
const DefaultName = "Default"
DefaultName is the name of the inbox every installation starts with.
const DefaultQuery = "author=@me OR assignee=@me OR review-requested=@me"
DefaultQuery is the query of the default inbox: the pull requests the person wrote, is assigned or was asked to review.
const QueueScope = "waiting!=other"
QueueScope is the app's filter for "not someone else's pull request that waits on nothing from the person". It is the shorter form of DefaultQuery that upgrades use when the combined query would be too long.
Variables ¶
This section is empty.
Functions ¶
func ValidQuery ¶
ValidQuery reports whether a filter query is one line of valid UTF-8 text of at most MaxQueryLength characters. The daemon never parses it: the app does.
Types ¶
type API ¶
type API struct {
Store *Store
// Changed is called after every successful save.
Changed func()
}
API serves /api/inboxes. It has no authentication; the daemon mounts it behind its authenticated host.
type Inbox ¶
type Inbox struct {
ID string `json:"id"`
Name string `json:"name"`
Color string `json:"color"`
What string `json:"what"`
Owners []string `json:"owners"`
Risk string `json:"risk"`
Repositories []string `json:"repositories"`
Query string `json:"query"`
NoBots bool `json:"no_bots"`
Badge bool `json:"badge"`
}
Inbox is a saved filter over the app's Up next queue. This package stores it; internal/inboxqueue matches it.
type InvalidError ¶
InvalidError is a refused request: a stable code and a message for a person.
func (*InvalidError) Error ¶
func (e *InvalidError) Error() string
type StaleError ¶
type StaleError struct{ Current State }
StaleError is a replace based on an older revision than the stored one.
func (*StaleError) Error ¶
func (*StaleError) Error() string
type State ¶
type State struct {
Revision int `json:"revision"`
Inboxes []Inbox `json:"inboxes"`
// Initialized is set once the default inbox has been created, so that
// deleting it later is not undone.
Initialized bool `json:"initialized"`
}
State is the stored list and the revision it is at.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store keeps inbox definitions in the application database.
type UnreadableError ¶
type UnreadableError struct{ Err error }
UnreadableError reports stored state that cannot be read. It is never overwritten, so what it holds is not lost silently.
func (*UnreadableError) Error ¶
func (e *UnreadableError) Error() string
func (*UnreadableError) Unwrap ¶
func (e *UnreadableError) Unwrap() error