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" CodeDuplicateName = "duplicate_name" CodeDuplicateID = "duplicate_id" CodeStale = "stale_revision" CodeUnreadable = "inboxes_unreadable" )
Error codes of the API.
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. The daemon stores it and never evaluates 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 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