Documentation
¶
Overview ¶
Package slackrows serves Slack units as read model rows: threads and DM segments with their extraction verdict and open items.
Index ¶
Constants ¶
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 Input ¶
type Input struct {
// contains filtered or unexported fields
}
Input is what one unit's row derives from.
func (*Input) Conversation ¶
func (in *Input) Conversation() store.ConversationRow
Conversation is the unit's conversation as stored.
func (*Input) Messages ¶
func (in *Input) Messages() []store.MessageRow
Messages are the unit's stored messages, ascending.
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.
type Row ¶
type Row struct {
Unit unit.Unit
Link string
Label string
Title string
Kind Kind
Views []string
Facets map[string][]string
Summary Summary
Items []RowItem
Payload json.RawMessage
}
Row is what a Slack unit shows: its situation, its open items and its payload, which the plugin reports as the unit's snapshot.
type Source ¶
type Source struct {
DB *store.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
// Items are the host ledger's items of units.
Items func(ctx context.Context, units []unit.Unit) (map[unit.Unit][]items.Item, error)
// Open are the host ledger's open items of every Slack unit.
Open func(ctx context.Context) (map[unit.Unit][]items.Item, error)
}
Source is what the rows read: the store, the viewer the plugin learned and the host's items.