Documentation
¶
Overview ¶
Package service makes every request the Go doit sends to doit's service. It is written by hand against the wire contract that the Python client keeps.
A route's call is a method on Client that names its path and the Go type of its answer. The verb needs every field that type declares without omitempty. A Go release can reach a desk before the cluster rolls the matching service. So Get refuses an answer that lacks such a field, rather than drawing it empty, and names the field and the service's version.
Index ¶
- Constants
- func ExitCode(err error) int
- func LaterSendCanStore(err error) bool
- func NewWriteID(now time.Time) string
- type BalancesReset
- type Block
- type Client
- func (c *Client) CheckLog(ctx context.Context, asked LogAsked) (LogCheck, error)
- func (c *Client) CompleteReview(ctx context.Context, id, day string) (ReviewDone, error)
- func (c *Client) Dashboard(ctx context.Context, lanes []string) (json.RawMessage, Dashboard, error)
- func (c *Client) Delete(ctx context.Context, path string, answer any) error
- func (c *Client) Document(ctx context.Context, name string) (Document, error)
- func (c *Client) DocumentTemplate(ctx context.Context, name string) (Document, error)
- func (c *Client) Dormant(ctx context.Context) (json.RawMessage, Dormant, error)
- func (c *Client) Drift(ctx context.Context, since, until string) (json.RawMessage, Drift, error)
- func (c *Client) DropIngestionItem(ctx context.Context, decided IngestionDecided) (json.RawMessage, IngestionDecisions, error)
- func (c *Client) Evidence(ctx context.Context) (json.RawMessage, Evidence, error)
- func (c *Client) Forecast(ctx context.Context, handle string) (json.RawMessage, Reading, error)
- func (c *Client) Forecasts(ctx context.Context) (json.RawMessage, []Reading, error)
- func (c *Client) Get(ctx context.Context, path string, query url.Values, answer any) (json.RawMessage, error)
- func (c *Client) Happened(ctx context.Context, since, until string) (json.RawMessage, Happened, error)
- func (c *Client) Log(ctx context.Context, body map[string]any) (Logged, error)
- func (c *Client) Next(ctx context.Context, machine string, reroll bool) (json.RawMessage, Next, error)
- func (c *Client) Nudge(ctx context.Context) (Nudge, error)
- func (c *Client) Offers(ctx context.Context) (Offers, error)
- func (c *Client) PlaceIngestionItem(ctx context.Context, decided IngestionDecided) (json.RawMessage, IngestionDecisions, error)
- func (c *Client) Post(ctx context.Context, path string, body any, repeatable bool, answer any) error
- func (c *Client) PursuitList(ctx context.Context) (json.RawMessage, PursuitList, error)
- func (c *Client) Put(ctx context.Context, path string, body, answer any) error
- func (c *Client) Register(ctx context.Context) (Register, error)
- func (c *Client) ResetBalances(ctx context.Context, body map[string]any) (BalancesReset, error)
- func (c *Client) Resume(ctx context.Context, body map[string]any) (Resumed, error)
- func (c *Client) Review(ctx context.Context) (json.RawMessage, Review, error)
- func (c *Client) ReviewCompletions(ctx context.Context, id string) ([]ReviewCompletion, error)
- func (c *Client) SaveDocument(ctx context.Context, name, text string) error
- func (c *Client) SetNudge(ctx context.Context, body map[string]string) (NudgeHeld, error)
- func (c *Client) Skip(ctx context.Context, body map[string]any) (Skipped, error)
- func (c *Client) Sources(ctx context.Context) (json.RawMessage, Sources, error)
- func (c *Client) SourcesContract(ctx context.Context) (json.RawMessage, error)
- func (c *Client) TakeForecast(ctx context.Context, budget *int) (json.RawMessage, Reading, error)
- func (c *Client) Today(ctx context.Context) (json.RawMessage, Today, error)
- func (c *Client) Trend(ctx context.Context, days *int) (json.RawMessage, Trend, error)
- func (c *Client) UndoReviewCompletion(ctx context.Context, id, day string) (ReviewDone, error)
- func (c *Client) Version(ctx context.Context) (string, error)
- type Dashboard
- type DashboardLane
- type Document
- type Dormant
- type DormantRow
- type Drift
- type DriftAmount
- type DriftRow
- type DueLane
- type Evidence
- type EvidenceRow
- type ExplainRow
- type GridCell
- type Happened
- type IngestionDecided
- type IngestionDecision
- type IngestionDecisions
- type Lane
- type LaneRow
- type LogAsked
- type LogCheck
- type LogChoice
- type Logged
- type MissingField
- type Next
- type NoAnswer
- type Nudge
- type NudgeHeld
- type OfferRow
- type Offers
- type PromptRow
- type PursuitList
- type PursuitRow
- type PursuitStanding
- type Quota
- type QuotaCatchUp
- type QuotaChecklist
- type QuotaUnit
- type Reading
- type ReadingRow
- type Refused
- type Register
- type RegisterEntry
- type Resumed
- type Review
- type ReviewCompletion
- type ReviewDone
- type ReviewEntry
- type ReviewStatus
- type Skipped
- type SourceAnswer
- type Sources
- type Today
- type Trend
- type TrendRow
Constants ¶
const NoAnswerExit = 4
NoAnswerExit is what a command exits with where no answer came, the one failure that the same command run later can outlast.
const Prefix = "/api/v1"
Prefix is where every route sits, the OpenAPI document among them. deploy/api.yaml names the paths the cluster routes to the service.
Variables ¶
This section is empty.
Functions ¶
func ExitCode ¶
ExitCode is what a command exits with for err: NoAnswerExit where no answer came, else 1.
func LaterSendCanStore ¶ added in v0.3.0
LaterSendCanStore is whether the same write sent later could be stored: no answer came, the login was refused, or the service broke. A refusal of the write itself is refused again however often it is sent, and an answer lacking a field came after the write was stored.
func NewWriteID ¶ added in v0.9.0
NewWriteID is the key a write is stored once by: a UUIDv7, a 48-bit millisecond timestamp then randomness, so keys sort into the order things happened.
Types ¶
type BalancesReset ¶ added in v0.9.0
type BalancesReset struct {
Reset []string `json:"reset"`
}
BalancesReset is POST /journal/reset's answer: every pursuit whose balance starts again from now.
type Block ¶ added in v0.9.0
Block is one of the register's blocks, in the order the browse views print them.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is one authenticated client of the service at base.
func New ¶
func New(base string, source oauth2.TokenSource, chosenBy, repair string) *Client
New is a client of the service at base, sending source's token. chosenBy says where base came from, and repair what fixes a refused token.
func (*Client) CheckLog ¶ added in v0.9.0
CheckLog asks whether a log would be taken, writing nothing. A name that means no one pursuit is refused with 404, minutes, a span or an item that do not fit with 422, and an item of an app that could not be read with 409.
func (*Client) CompleteReview ¶ added in v0.9.0
CompleteReview records the entry called id done on day, the desk's own day. The service keeps one completion a day for an entry, so a resend records nothing twice. An id the register does not hold is refused with 404.
func (*Client) Dashboard ¶ added in v0.8.0
Dashboard reads every lane, or only those named in lanes, each then listing more of its rows. It answers the body it came in too.
func (*Client) Delete ¶ added in v0.9.0
Delete removes what the route at path names and reads the answer into answer. A route that names what it removes removes nothing more when it is sent again.
func (*Client) Document ¶ added in v0.9.0
Document reads the document called name. One never written is refused with 404.
func (*Client) DocumentTemplate ¶ added in v0.9.0
DocumentTemplate reads the annotated example that the document called name starts from.
func (*Client) Drift ¶ added in v0.9.0
Drift reads drift over the window since and until name, each "" where not given.
func (*Client) DropIngestionItem ¶ added in v0.10.0
func (c *Client) DropIngestionItem(ctx context.Context, decided IngestionDecided) (json.RawMessage, IngestionDecisions, error)
DropIngestionItem drops the item as this login's decision. decided names no destination.
func (*Client) Forecast ¶ added in v0.8.0
Forecast reads the reading handle names, or the newest where it is "", and answers the body it came in too.
func (*Client) Forecasts ¶ added in v0.8.0
Forecasts reads every stored reading, oldest first, and answers the body it came in too.
func (*Client) Get ¶
func (c *Client) Get(ctx context.Context, path string, query url.Values, answer any) (json.RawMessage, error)
Get reads the route at path into answer, refusing an answer that lacks a field answer's type declares without omitempty. It also answers the body as it came, for a --json that prints it whole, fields this doit does not read included.
func (*Client) Happened ¶ added in v0.8.0
func (c *Client) Happened(ctx context.Context, since, until string) (json.RawMessage, Happened, error)
Happened reads the window that since and until bound, and answers the body it came in too. Either end may be "", and the service picks the start of a window given neither end.
func (*Client) Log ¶ added in v0.9.0
Log stores the journal entry in body. The service keeps an entry by its id, so a resend is stored once.
func (*Client) Next ¶ added in v0.7.0
func (c *Client) Next(ctx context.Context, machine string, reroll bool) (json.RawMessage, Next, error)
Next reads the draw. machine is the desk it is offered to, and reroll asks for a fresh draw though one stands. It answers the body it came in too.
func (*Client) PlaceIngestionItem ¶ added in v0.10.0
func (c *Client) PlaceIngestionItem(ctx context.Context, decided IngestionDecided) (json.RawMessage, IngestionDecisions, error)
PlaceIngestionItem places the item on decided.Destination as this login's decision. An item ingestion does not hold is refused with 404, and a destination it does not declare or a cause it cannot read with 422.
func (*Client) Post ¶ added in v0.3.0
func (c *Client) Post(ctx context.Context, path string, body any, repeatable bool, answer any) error
Post sends body to the route at path and reads the answer into answer, which may be nil. The service stores a repeatable write once by the key in its body, so it is sent again after a timeout, a reset or a busy answer. Any other write is sent again only where it never reached the service.
func (*Client) PursuitList ¶ added in v0.9.0
func (c *Client) PursuitList(ctx context.Context) (json.RawMessage, PursuitList, error)
PursuitList reads every pursuit, and answers the body it came in too.
func (*Client) Put ¶ added in v0.9.0
Put replaces what the route at path holds with body and reads the answer into answer, which may be nil. A put states the whole of what it sets, so it is sent again after a timeout, a reset or a busy answer.
func (*Client) ResetBalances ¶ added in v0.9.0
ResetBalances starts the balance of each pursuit body names again from now, or of every one.
func (*Client) Resume ¶ added in v0.9.0
Resume ends the standing skip of the pursuit body names, or of every one.
func (*Client) ReviewCompletions ¶ added in v0.9.0
ReviewCompletions reads every completion the entry called id holds, oldest day first.
func (*Client) SaveDocument ¶ added in v0.9.0
SaveDocument replaces the document called name with text. The service validates the whole text and refuses it with 422, naming the first fault.
func (*Client) SetNudge ¶ added in v0.9.0
SetNudge sets what body names of the shell nudge: `every`, or `last_nudged_at`.
func (*Client) Skip ¶ added in v0.9.0
Skip passes on the pursuit body names. The service keeps a pass by its id, so a resend is stored once.
func (*Client) Sources ¶ added in v0.9.0
Sources reads every configured source, and answers its answers as they came too.
func (*Client) SourcesContract ¶ added in v0.9.0
SourcesContract reads the shape of a lane, as an annotated example. Every source's read is shaped into it.
func (*Client) TakeForecast ¶ added in v0.8.0
TakeForecast takes a forecast at budget minutes a day, or at the register's budget where budget is nil, and stores it. It answers the reading as the service sent it, for a --json that prints it whole, beside the reading read. Where the answer cannot be read, the reading is still stored, so the body comes back beside the error, and the error says so.
func (*Client) Trend ¶ added in v0.8.0
Trend grades the readings whose days-long window has closed, at the service's own horizon where days is nil, and answers the body it came in too.
func (*Client) UndoReviewCompletion ¶ added in v0.9.0
UndoReviewCompletion takes back the entry's completion on day. Naming the day means a resend after a lost answer cannot take back the one before it.
type Dashboard ¶ added in v0.8.0
type Dashboard struct {
GeneratedAt string `json:"generated_at"`
Lanes []DashboardLane `json:"lanes"`
// LaneNames names every lane the round built, before a lane query narrowed it.
LaneNames []string `json:"lane_names"`
Problems []string `json:"problems"`
// Configured counts the sources declared in the sources document.
Configured int `json:"configured"`
// PursuitStanding is the line naming the pursuits behind, or null where none is.
PursuitStanding *PursuitStanding `json:"pursuit_standing"`
}
Dashboard is GET /dashboard: one lane for each answer of a configured source, alert lanes first, then in the sources document's order, with doit's own maintenance lane last.
type DashboardLane ¶ added in v0.8.0
type DashboardLane struct {
Lane
RowCap int `json:"row_cap"`
// Quiet is a lane that answered with nothing open and asks not to be drawn then.
Quiet bool `json:"quiet"`
}
DashboardLane is a lane with how many of its rows the screen lists, and whether the screen leaves it out.
type Document ¶ added in v0.9.0
type Document struct {
Text string `json:"text"`
}
Document is one of the service's documents, as its whole text.
type Dormant ¶ added in v0.9.0
type Dormant struct {
Dormant []DormantRow `json:"dormant"`
}
Dormant is GET /pursuits/dormant, as schemas/pursuits-dormant.schema.json describes it.
type DormantRow ¶ added in v0.9.0
type DormantRow struct {
Pursuit string `json:"pursuit"`
Goal string `json:"goal"`
Last string `json:"last"`
Reason *string `json:"reason"`
}
DormantRow is one pursuit gone quiet.
type Drift ¶ added in v0.9.0
type Drift struct {
Since *string `json:"since"`
Until string `json:"until"`
PrintedRows []DriftRow `json:"printed_rows"`
// Rows are the same rows as numbers, which say whether anything was done.
Rows []DriftAmount `json:"rows"`
}
Drift is GET /pursuits/drift: what each goal asked for over a window, and what got done, each row also as it prints.
type DriftAmount ¶ added in v0.9.0
type DriftAmount struct {
Done float64 `json:"done"`
}
DriftAmount is how much of a pursuit got done over the window, in its own unit.
type DriftRow ¶ added in v0.9.0
type DriftRow struct {
Pursuit string `json:"pursuit"`
Goal string `json:"goal"`
Since string `json:"since"`
Asked string `json:"asked"`
Done string `json:"done"`
Due string `json:"due"`
Offered string `json:"offered"`
Passed string `json:"passed"`
Reason string `json:"reason"`
}
DriftRow is one pursuit's row on `doit pursuits drift`, each cell as it prints.
type DueLane ¶ added in v0.7.0
DueLane is a group of the due list, with how many of its rows the screen lists.
type Evidence ¶ added in v0.9.0
type Evidence struct {
Rows []EvidenceRow `json:"rows"`
}
Evidence is GET /pursuits/evidence: what each app says was last done, asked now.
type EvidenceRow ¶ added in v0.9.0
type EvidenceRow struct {
Pursuit string `json:"pursuit"`
// Kind is why the row reads as it does: undeclared, failed, observed or unseen.
Kind string `json:"kind"`
Text string `json:"text"`
// At is when an observed pursuit was last done, which Text counts from.
At *string `json:"at"`
}
EvidenceRow is one watched pursuit's row on `doit pursuits evidence`.
type ExplainRow ¶ added in v0.7.0
type ExplainRow struct {
Name string `json:"name"`
Offered bool `json:"offered"`
Skipped bool `json:"skipped"`
Weight string `json:"weight"`
Goal string `json:"goal"`
Last string `json:"last"`
Due string `json:"due"`
Pick string `json:"pick"`
// Reason is the register's reason for the pursuit, or "".
Reason string `json:"reason"`
}
ExplainRow is one pursuit's row on `doit next --explain`, each cell as it prints.
type GridCell ¶ added in v0.7.0
type GridCell struct {
Text string `json:"text"`
Done bool `json:"done"`
// Handle is what to type to act on a cell not yet done, or "".
Handle string `json:"handle"`
// DoneAt is the instant it was done, or "" where its record kept only the day.
DoneAt string `json:"done_at"`
// DoneOn is the day it was done, or "" where its record kept none.
DoneOn string `json:"done_on"`
// ActorKind is the kind of actor the service names for the cell, as
// printed, or "" where its record names nobody.
ActorKind string `json:"actor_kind"`
}
GridCell is one member of a whole set, or one thing done.
type Happened ¶ added in v0.8.0
type Happened struct {
// Since and Until are the window's ends, with the service's offset. A
// window asked with no start begins at the Unix epoch.
Since string `json:"since"`
Until string `json:"until"`
// Days is how many of the service's local days the window touches.
Days int `json:"days"`
// Asked names every group, Unavailable each that could not be read, and
// Partial each read in part.
Asked []string `json:"asked"`
Partial []string `json:"partial"`
// RecordedBy names each group whose record wrote who did each entry.
RecordedBy []string `json:"recorded_by"`
// UnknownActors counts the entries whose actor the service does not recognize.
UnknownActors int `json:"unknown_actors"`
Groups []Lane `json:"groups"`
Problems []string `json:"problems"`
}
Happened is GET /happened: what every record says happened over a window, one group per record asked.
type IngestionDecided ¶ added in v0.10.0
type IngestionDecided struct {
Key string `json:"key"`
Destination string `json:"destination,omitempty"`
Cause *string `json:"cause,omitempty"`
Note *string `json:"note,omitempty"`
}
IngestionDecided is a placement or a drop of one item, as sent.
type IngestionDecision ¶ added in v0.10.0
type IngestionDecision struct {
Gate string `json:"gate"`
Verdict string `json:"verdict"`
Destination *string `json:"destination,omitempty"`
Lens *string `json:"lens,omitempty"`
}
IngestionDecision is one decision ingestion recorded as the caller's.
type IngestionDecisions ¶ added in v0.10.0
type IngestionDecisions struct {
Key string `json:"key"`
Decisions []IngestionDecision `json:"decisions"`
}
IngestionDecisions is what POST /ingestion/items/place and /drop answer: ingestion's own answer, which its schemas/review-placement.schema.json holds.
type Lane ¶ added in v0.7.0
type Lane struct {
Name string `json:"name"`
Title string `json:"title"`
// Meta is what the heading says beside the title, such as a count, or "".
Meta string `json:"meta"`
// Status is "unavailable" where the lane could not be read, and Reason says why.
Status string `json:"status"`
// Alert is a lane that carries problems rather than work.
Alert bool `json:"alert"`
// Reason is null where the lane read whole, and says what it could not
// read where it read in part.
Reason string `json:"reason"`
Rows []LaneRow `json:"rows"`
Grid []GridCell `json:"grid"`
// Total is how many rows the lane holds before any cut.
Total int `json:"total"`
// Hints are the commands that list the rest.
Hints []string `json:"hints"`
}
Lane is one lane of the lane contract: ranked rows, or a grid of cells.
type LaneRow ¶ added in v0.7.0
type LaneRow struct {
Label string `json:"label"`
Text string `json:"text"`
Note string `json:"note"`
// Urgency is none, due or overdue, and colors the note.
Urgency string `json:"urgency"`
// Handle is the command that acts on the row.
Handle string `json:"handle"`
}
LaneRow is one thing to act on.
type LogAsked ¶ added in v0.9.0
type LogAsked struct {
Pursuit string `json:"pursuit"`
Minutes *int `json:"duration_minutes"`
ItemID *string `json:"item_id,omitempty"`
// Ago is a span back from now, such as 90m, which the service resolves to the instant the log records.
Ago string `json:"ago,omitempty"`
}
LogAsked is what a check asks about a log, as it was typed.
type LogCheck ¶ added in v0.9.0
type LogCheck struct {
// Pursuit is the one pursuit that the typed name matched.
Pursuit string `json:"pursuit"`
// OccurredAt is the instant the log records, which the service resolved from what was typed.
OccurredAt string `json:"occurred_at"`
// OnLog is the template that completes the choice in its app, or nil.
OnLog *string `json:"on_log"`
// MinutesRefusal is why the log still needs minutes, where it does.
MinutesRefusal *string `json:"minutes_refusal"`
// Choices are the pursuit's current choices, each with its line and the item a log records.
Choices []LogChoice `json:"choices"`
// Chosen is the choice that the log is about, flattened as a log records it, or nil.
Chosen map[string]any `json:"chosen"`
// Ask is several choices, none named, where only the person logging can say which.
Ask bool `json:"ask"`
// NamesChosen is whether the log names its choice whatever on_log does.
NamesChosen bool `json:"names_chosen"`
}
LogCheck is POST /journal/done's answer to a check, which writes nothing.
type Logged ¶ added in v0.9.0
type Logged struct {
DueInDays *float64 `json:"due_in_days"`
// Due is when the pursuit next comes due, as a person reads it, or nil without a schedule.
Due *string `json:"due"`
}
Logged is POST /journal/done's answer once it stores an entry.
type MissingField ¶
type MissingField struct {
Where string
// Method is the request's, GET where it is "".
Method string
Route string
Field string
Version string
// VersionUnread is why the service's version could not be read, where it could not.
VersionUnread error
}
MissingField is an answer that lacks a field which the verb needs.
func (*MissingField) Error ¶
func (m *MissingField) Error() string
type Next ¶ added in v0.7.0
type Next struct {
DrawID string `json:"draw_id"`
// OfferRows are the offered pursuits in the draw's order, then each other
// active one, owed first.
OfferRows []OfferRow `json:"offer_rows"`
// ExplainRows are every active pursuit, owed first.
ExplainRows []ExplainRow `json:"explain_rows"`
// DrawSize is how many rows a draw fills, owed rows aside.
DrawSize int `json:"draw_size"`
// Context is today's events and near countdowns, one line each.
Context []string `json:"context"`
// ContextError is why the events could not be read, or null.
ContextError string `json:"context_error"`
// Pursuits is the register, which the names cache lists.
Pursuits map[string]RegisterEntry `json:"pursuits"`
}
Next is GET /next: the draw standing for this window, or a fresh one, with each row its screens print. The service orders and prices every row, so the screens only lay them out.
type NoAnswer ¶
type NoAnswer struct {
Message string
}
NoAnswer is no answer coming: the service was never reached, timed out, or was busy on every attempt. Run unchanged later, the same command can work.
type Nudge ¶ added in v0.9.0
type Nudge struct {
IntervalMinutes int `json:"interval_minutes"`
Show bool `json:"show"`
Due []ReviewEntry `json:"due"`
DueTotal int `json:"due_total"`
}
Nudge is GET /review/nudge: whether the shell nudge shows now, and what it shows.
type NudgeHeld ¶ added in v0.9.0
type NudgeHeld struct {
IntervalMinutes int `json:"interval_minutes"`
}
NudgeHeld is PUT /review/nudge's answer: the interval, as the service holds it.
type OfferRow ¶ added in v0.7.0
type OfferRow struct {
Name string `json:"name"`
Offered bool `json:"offered"`
Weight string `json:"weight"`
Goal string `json:"goal"`
Tally string `json:"tally"`
Due string `json:"due"`
// Late is a pursuit past its due date by a day or more.
Late bool `json:"late"`
// Choices are what an offered pursuit could be, a line each.
Choices []string `json:"choices"`
// Failed is a resolve that failed or matched nothing, which its choice says.
Failed bool `json:"failed"`
}
OfferRow is one pursuit's row on `doit next`, each cell as it prints.
type Offers ¶ added in v0.9.0
type Offers struct {
// Recent is each machine's counts over Window, by pursuit.
Recent map[string]map[string]int `json:"recent"`
Stranded []string `json:"stranded"`
// Window is how far back Recent reaches, such as `90d`.
Window string `json:"window"`
}
Offers is GET /pursuits/offers: how often each pursuit was offered, and the recent counts of a pursuit that the register does not hold.
type PursuitList ¶ added in v0.9.0
type PursuitList struct {
Pursuits map[string]RegisterEntry `json:"pursuits"`
Rows []PursuitRow `json:"rows"`
}
PursuitList is GET /pursuits: every pursuit and the state behind it, with each row that `doit pursuits list` prints.
type PursuitRow ¶ added in v0.9.0
type PursuitRow struct {
Name string `json:"name"`
// Paced is a pursuit that declares a pace. One that does not is tracked, and has no weight or due date.
Paced bool `json:"paced"`
Weight string `json:"weight"`
Goal string `json:"goal"`
Last string `json:"last"`
Due string `json:"due"`
// Late is a pursuit past its due date by a day or more.
Late bool `json:"late"`
// Standing is why the pursuit sits out of the draw, such as `paused`, or "".
Standing string `json:"standing"`
Reason string `json:"reason"`
}
PursuitRow is one pursuit's row on `doit pursuits list`, heaviest first, each cell as it prints.
type PursuitStanding ¶ added in v0.8.0
PursuitStanding is the dashboard's last line.
type Quota ¶ added in v0.7.0
type Quota struct {
// Minutes and Checkoffs are null where no pursuits were read.
Minutes *QuotaUnit `json:"minutes"`
Checkoffs *QuotaUnit `json:"checkoffs"`
CatchUp []QuotaCatchUp `json:"catch_up"`
Checklists []QuotaChecklist `json:"checklists"`
Unavailable string `json:"unavailable"`
}
Quota is the figures above both lists.
type QuotaCatchUp ¶ added in v0.7.0
type QuotaCatchUp struct {
Label string `json:"label"`
MinutesPerDay float64 `json:"minutes_per_day"`
CheckoffsPerDay float64 `json:"checkoffs_per_day"`
Shown bool `json:"shown"`
}
QuotaCatchUp is what more a day would clear the backlog over one timescale.
type QuotaChecklist ¶ added in v0.7.0
type QuotaChecklist struct {
Name string `json:"name"`
Done int `json:"done"`
Total int `json:"total"`
}
QuotaChecklist is a checklist beside the figures, or why it could not be read.
type QuotaUnit ¶ added in v0.7.0
type QuotaUnit struct {
Need float64 `json:"need"`
Done float64 `json:"done"`
Behind float64 `json:"behind"`
AskedOf int `json:"asked_of"`
}
QuotaUnit is the pursuits counted in one unit, summed.
type Reading ¶ added in v0.8.0
type Reading struct {
// Generated is when it was taken, as an ISO 8601 instant.
Generated string `json:"generated"`
Machine string `json:"machine"`
BudgetMinutes int `json:"budget_minutes"`
Replicates int `json:"replicates"`
UnspentMinutesPerDay float64 `json:"unspent_minutes_per_day"`
// Rows are each pursuit's, doing most over the month first.
Rows []ReadingRow `json:"rows"`
// Estimates says how many durations were measured and how many assumed.
Estimates string `json:"estimates"`
}
Reading is one forecast as the service answers it, with the rows its screen prints.
type ReadingRow ¶ added in v0.8.0
type ReadingRow struct {
Name string `json:"name"`
Week string `json:"week"`
Month string `json:"month"`
Hours string `json:"hours"`
// Goal is null for a reading taken before goals were recorded.
Goal *string `json:"goal"`
OfGoal string `json:"of_goal"`
// ShortOfGoal is the service judging the month short of its goal.
ShortOfGoal bool `json:"short_of_goal"`
Estimate string `json:"estimate"`
}
ReadingRow is one pursuit's row of a reading, each cell as it prints.
type Register ¶ added in v0.9.0
type Register struct {
Pursuits map[string]RegisterEntry `json:"pursuits"`
// Active are the pursuits in the draw.
Active []string `json:"active"`
Offered []string `json:"offered"`
// PromptRows are each pursuit as a prompt lists it, heaviest first.
PromptRows []PromptRow `json:"prompt_rows"`
}
Register is GET /pursuits/register: the pursuits as declared and what the standing draw offers, read with no app asked.
type RegisterEntry ¶ added in v0.7.0
type RegisterEntry struct {
Description any `json:"description,omitempty"`
}
RegisterEntry is one pursuit as the register declares it, as far as the names cache reads it.
type Resumed ¶ added in v0.9.0
type Resumed struct {
Resumed []string `json:"resumed"`
}
Resumed is POST /journal/resume's answer: every pursuit whose skip it ended.
type Review ¶ added in v0.9.0
type Review struct {
Entries []ReviewEntry `json:"entries"`
// Stranded are entries with recorded done dates that the register does not hold.
Stranded []string `json:"stranded"`
Blocks []Block `json:"blocks"`
}
Review is GET /review: every register entry with its derived status, most urgent first, and each block's heading.
type ReviewCompletion ¶ added in v0.9.0
type ReviewCompletion struct {
DoneOn string `json:"done_on"`
}
ReviewCompletion is one day an entry was done.
type ReviewDone ¶ added in v0.9.0
type ReviewDone struct {
DoneOn string `json:"done_on"`
Status *ReviewStatus `json:"status"`
}
ReviewDone is the answer to a completion or to one taken back.
func (ReviewDone) DueAgain ¶ added in v0.9.0
func (d ReviewDone) DueAgain() string
DueAgain is how many days until the entry comes due again, as `7d`, or "" where it has no cadence.
type ReviewEntry ¶ added in v0.9.0
type ReviewEntry struct {
ID string `json:"id"`
Block string `json:"block"`
Cadence string `json:"cadence"`
Desc string `json:"desc"`
Command string `json:"command"`
Show string `json:"show"`
Last *string `json:"last"`
// Due is never done, or on or past its due date.
Due bool `json:"due"`
// Status is the label every screen prints, such as `overdue 3d`.
Status string `json:"status"`
}
ReviewEntry is one register entry.
type ReviewStatus ¶ added in v0.9.0
type ReviewStatus struct {
CadenceDays *float64 `json:"cadence_days"`
Last *string `json:"last"`
// Label is the status as every screen prints it, such as `overdue 3d`.
Label string `json:"status"`
}
ReviewStatus is an entry's derived status, as the service answers it.
type Skipped ¶ added in v0.9.0
type Skipped struct {
Days int `json:"days"`
Until string `json:"until"`
Entry struct {
Pursuit string `json:"pursuit"`
} `json:"entry"`
}
Skipped is POST /journal/skip's answer: how long the pass runs, and the pursuit it matched.
type SourceAnswer ¶ added in v0.9.0
type SourceAnswer struct {
ID string `json:"id"`
// Block is outstanding or happened.
Block string `json:"block"`
Answered bool `json:"answered"`
Reason string `json:"reason"`
Lanes int `json:"lanes"`
Via string `json:"via"`
}
SourceAnswer is one source's read.
type Sources ¶ added in v0.9.0
type Sources struct {
Answers []SourceAnswer `json:"answers"`
// Problems are what the sources document says that the service could not read.
Problems []string `json:"problems"`
}
Sources is GET /sources: every configured source and whether its read answers.
type Today ¶ added in v0.7.0
type Today struct {
// GeneratedAt is when the service read the day, with its offset. The
// screen's date is the date there.
GeneratedAt string `json:"generated_at"`
Done []Lane `json:"done"`
Due []DueLane `json:"due"`
// Quota is null where the service drew no figures.
Quota *Quota `json:"quota"`
Problems []string `json:"problems"`
}
Today is GET /today: what the day still owes, above what it has had, in the lane contract's shape. The screens read every field it declares.
type Trend ¶ added in v0.8.0
type Trend struct {
Days int `json:"days"`
// Readings is how many readings were old enough to grade.
Readings int `json:"readings"`
// Rows are each pursuit's verdict, furthest off first.
Rows []TrendRow `json:"rows"`
}
Trend is GET /forecasts/trend: the matured readings graded at one horizon.
type TrendRow ¶ added in v0.8.0
type TrendRow struct {
Pursuit string `json:"pursuit"`
Said string `json:"said"`
Did string `json:"did"`
Error string `json:"error"`
// Missed is a prediction off by a whole occasion or more.
Missed bool `json:"missed"`
}
TrendRow is one verdict's row, each cell as it prints.