Documentation
¶
Overview ¶
Package slackrows serves Slack units as read model rows: threads and DM segments with their extraction verdict and open items.
Index ¶
- Constants
- type LastHuman
- type Payload
- type Provider
- func (p *Provider) Derive(base readmodel.Base, in any, _ time.Time) (api.Row, error)
- func (p *Provider) Facets() []api.FacetSpec
- func (p *Provider) Listed(ctx context.Context) ([]unit.Unit, error)
- func (p *Provider) Load(ctx context.Context, units []unit.Unit) (map[unit.Unit]any, error)
- func (p *Provider) Provider() unit.ProviderID
- func (p *Provider) Situations() []api.SituationSpec
- func (p *Provider) Views() []api.ViewSpec
- type Source
Constants ¶
const ( KindNew api.Kind = "new" KindWaitsOnViewer api.Kind = "waits_on_viewer" KindWaitsOnOthers api.Kind = "waits_on_others" KindNeedsClosure api.Kind = "needs_closure" KindResolved api.Kind = "resolved" KindFYI api.Kind = "fyi" )
The kinds of a Slack row: the extraction verdict, KindNew before any.
const ActiveFor = 14 * 24 * time.Hour
ActiveFor is how long after its last message an unwatched unit without open items keeps its row.
const FacetChannel = "channel"
FacetChannel is a channel thread's channel name, without "#": the qualifier channel:<name>.
const FacetConversation = "conversation"
FacetConversation groups rows by channel or DM.
const FacetWaitsOn = "waits-on"
FacetWaitsOn is the core facet of whom a row waits on.
const TitleRunes = 80
TitleRunes is the longest title a row takes from a message.
const ViewSlack = "slack"
ViewSlack lists the Slack units not closed.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LastHuman ¶
type LastHuman struct {
Who items.Person `json:"who"`
What string `json:"what"`
At time.Time `json:"at"`
Link string `json:"link,omitempty"`
}
LastHuman is the newest message a human other than the viewer wrote.
type Payload ¶
type Payload struct {
Conversation string `json:"conversation"`
// Channel is the channel's name without "#"; "" for a DM.
Channel string `json:"channel,omitempty"`
DM bool `json:"dm,omitempty"`
// With are the other people of a DM, by name.
With []string `json:"with,omitempty"`
Topic string `json:"topic,omitempty"`
// Verdict is the last extraction's; "" before any.
Verdict string `json:"verdict,omitempty"`
StartedByViewer bool `json:"started_by_viewer,omitempty"`
ClosurePosted bool `json:"closure_posted,omitempty"`
Followed bool `json:"followed,omitempty"`
Replies int `json:"replies"`
LastActivity time.Time `json:"last_activity,omitzero"`
LastHuman *LastHuman `json:"last_human,omitempty"`
WaitsOn []items.Person `json:"waits_on,omitempty"`
Viewer string `json:"viewer,omitempty"`
}
Payload is a Slack row's provider part: what the card reads beyond the generic row.
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider is the Slack rows provider.
func (*Provider) Listed ¶
Listed are the threads and open DM segments of the objects watched or active within ActiveFor, and every Slack unit with an open item.
func (*Provider) Load ¶
Load reads each unit's conversation, object, messages, extraction state, items and the users they name. A unit with neither a message nor an extraction state has no row.
func (*Provider) Provider ¶
func (p *Provider) Provider() unit.ProviderID
func (*Provider) Situations ¶
func (p *Provider) Situations() []api.SituationSpec
type Source ¶
type Source struct {
DB *sqlite.DB
// Viewer is the logged-in team and user; an error is an unknown viewer.
Viewer func(ctx context.Context) (team, user string, err error)
// Now nil is time.Now.
Now func() time.Time
}
Source is what the rows read: the store and the viewer the plugin learned.