Documentation
¶
Overview ¶
Package retrieval implements bounded, deterministic read selection.
Index ¶
- Constants
- Variables
- type Boundary
- type ChannelHistoryOptions
- type ChannelHistoryResult
- type Completeness
- type DMHistoryOptions
- type DMHistoryResult
- type GroupDMHistoryOptions
- type GroupDMHistoryResult
- type HydrationResult
- type MentionsOptions
- type MentionsResult
- type SearchOptions
- type SearchResult
- type ThreadResult
- type UnreadEntry
- type UnreadOptions
- type UnreadResult
- type VisibleThreadsMetadata
- type VisibleThreadsStatus
Constants ¶
const ( MaxMentionAliases = 64 MaxMentionTermBytes = 256 )
const ( MaxUnreadMembershipFallbacks = 100 MaxUnreadPeekRequests = 100 MaxUnreadPeekConcurrency = 8 )
const (
MaxChannelHistoryPages = 100
)
const MaxDMHistoryRequests = 100
const MaxSearchPages = 100
const MaxThreadPages = 100
Variables ¶
var ( ErrInvalidUnreadRequest = errors.New("invalid unread request") ErrIncompleteUnreadResult = errors.New("Mattermost did not provide a complete unread result") )
var ErrInvalidChannelHistoryRequest = errors.New("invalid channel history request")
var ErrInvalidDMHistoryRequest = errors.New("invalid direct-message history request")
var ErrInvalidMentionsRequest = errors.New("invalid mentions request")
var ErrInvalidSearchRequest = errors.New("invalid search request")
Functions ¶
This section is empty.
Types ¶
type ChannelHistoryOptions ¶
type ChannelHistoryResult ¶
type ChannelHistoryResult struct {
Posts []mattermost.Post
Completeness Completeness
SafeBeforeValid bool
}
func ChannelHistory ¶
func ChannelHistory(ctx context.Context, source channelPageSource, channelID string, options ChannelHistoryOptions) (ChannelHistoryResult, error)
type Completeness ¶
type Completeness uint8
const ( CompletenessUnknown Completeness = iota CompletenessComplete CompletenessTruncated )
type DMHistoryOptions ¶
type DMHistoryResult ¶
type DMHistoryResult struct {
Posts []mattermost.Post
Completeness Completeness
SafeBeforeValid bool
}
func DMHistory ¶
func DMHistory(ctx context.Context, source channelPageSource, channelIDs []string, options DMHistoryOptions) (DMHistoryResult, error)
DMHistory retrieves each selected direct channel independently, then caps the merged known candidates. Completeness is unknown if any channel could not be queried completely, because a global top-N cannot then be proven.
type GroupDMHistoryOptions ¶
type GroupDMHistoryOptions = DMHistoryOptions
GroupDMHistoryOptions intentionally shares the conversation-history contract with DMs: one command-wide request budget and one global seed cap.
type GroupDMHistoryResult ¶
type GroupDMHistoryResult = DMHistoryResult
func GroupDMHistory ¶
func GroupDMHistory(ctx context.Context, source channelPageSource, channelIDs []string, options GroupDMHistoryOptions) (GroupDMHistoryResult, error)
type HydrationResult ¶
type HydrationResult struct {
Posts []mattermost.Post
VisibleThreads VisibleThreadsMetadata
}
func HydrateVisibleThreads ¶
func HydrateVisibleThreads(ctx context.Context, source threadPageSource, seeds []mattermost.Post, requested bool) (HydrationResult, error)
type MentionsOptions ¶
type MentionsResult ¶
type MentionsResult struct {
Posts []mattermost.Post
Completeness Completeness
}
func Mentions ¶
func Mentions(ctx context.Context, source searchPageSource, teamID string, options MentionsOptions) (MentionsResult, error)
Mentions performs one bounded Search per distinct mention term, then applies the exact local predicate that the remote search endpoint cannot express.
type SearchOptions ¶
type SearchOptions struct {
Limit int
Accept func(mattermost.Post) bool
}
type SearchResult ¶
type SearchResult struct {
Posts []mattermost.Post
Matches map[string][]string
Completeness Completeness
}
func Search ¶
func Search(ctx context.Context, source searchPageSource, teamID, terms string, options SearchOptions) (SearchResult, error)
type ThreadResult ¶
type ThreadResult struct {
Posts []mattermost.Post
Completeness Completeness
}
type UnreadEntry ¶
type UnreadEntry struct {
Channel mattermost.Channel
UnreadCount int64
MentionCount int64
LastViewedAt int64
Peek []mattermost.Post
PeekState Completeness
}
type UnreadOptions ¶
type UnreadResult ¶
type UnreadResult struct {
User mattermost.User
Team mattermost.Team
Entries []UnreadEntry
}
func Unread ¶
func Unread( ctx context.Context, users currentUserSource, teams teamResolveSource, channels unreadChannelSource, posts channelPageSource, options UnreadOptions, ) (UnreadResult, error)
Unread builds one complete unread snapshot. Team membership metrics are the primary bounded source; only D/G channels absent from that team-scoped snapshot use exact per-channel membership reads.
type VisibleThreadsMetadata ¶
type VisibleThreadsMetadata struct {
Status VisibleThreadsStatus
HydratedRootCount int
FailedRootIDs []string
}
type VisibleThreadsStatus ¶
type VisibleThreadsStatus uint8
const ( VisibleThreadsNotRequested VisibleThreadsStatus = iota VisibleThreadsComplete VisibleThreadsPartial )