Documentation
¶
Overview ¶
Package nudges tracks lightweight user-facing guidance and follow-up prompts.
Package nudges tracks recurring external nudges and acknowledgements.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Delivery ¶
type Delivery struct {
NudgeID string
CycleID string
Prompt string
DeliveredAt time.Time
ResponseID string
}
Delivery is one incoming nudge delivery.
type Observation ¶
type Observation struct {
Kind string `json:"kind"`
NudgeID string `json:"nudge_id"`
CycleID string `json:"cycle_id"`
Fingerprint string `json:"fingerprint"`
State State `json:"state"`
DeliveryCount int `json:"delivery_count"`
DeliveredAt time.Time `json:"delivered_at"`
AlreadyAcknowledged bool `json:"already_acknowledged"`
Acknowledged bool `json:"acknowledged"`
Stale bool `json:"stale"`
ResponseID string `json:"response_id,omitempty"`
Record Record `json:"record"`
}
Observation is returned after recording or acknowledging a delivery.
type Record ¶
type Record struct {
NudgeID string `json:"nudge_id"`
CycleID string `json:"cycle_id"`
Fingerprint string `json:"fingerprint"`
FirstDeliveredAt time.Time `json:"first_delivered_at"`
LastDeliveredAt time.Time `json:"last_delivered_at"`
DeliveryCount int `json:"delivery_count"`
LastPrompt string `json:"last_prompt,omitempty"`
Acknowledged bool `json:"acknowledged"`
AcknowledgedAt *time.Time `json:"acknowledged_at,omitempty"`
ResponseID string `json:"response_id,omitempty"`
LastState State `json:"last_state"`
}
Record is the persisted state for one nudge cycle.
type State ¶
type State string
State describes how the current delivery relates to prior nudge state.
type Store ¶
type Store struct {
Dir string
}
Store persists nudge cycle records under the Codog config home.
func (Store) Acknowledge ¶
func (s Store) Acknowledge(delivery Delivery) (Observation, error)
Acknowledge records that Codog handled a nudge cycle.
Click to show internal directories.
Click to hide internal directories.