Documentation
¶
Overview ¶
Package mentionhttp serves the people surfaces of the portal API: the known-users directory behind the share picker (#614), the audience-scoped candidate list behind the @-mention picker, and the caller's mentions inbox (#627).
It lives beside pkg/portal rather than inside it, like the prompt version REST surface, so the portal package stays within its size budget (#594). The composition root mounts these routes on the top-level mux wrapped in the portal's own authentication middleware and injects the identity accessor, so this package never imports pkg/portal.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AudienceReader ¶
type AudienceReader interface {
List(ctx context.Context, t mention.Target, opts mention.ListOptions) ([]mention.Person, error)
Eligible(ctx context.Context, t mention.Target, emails []string) ([]string, error)
}
AudienceReader answers who may be mentioned on a thread target: the page the picker shows, and whether one person belongs to it. pkg/portal/mention.Audience implements it.
type Deps ¶
type Deps struct {
// Directory is the known-users store behind the share picker.
Directory DirectoryReader
// Audience answers who may be mentioned on a thread target.
Audience AudienceReader
// Threads reads the caller's mentions inbox.
Threads threads.ThreadStore
// Caller resolves the authenticated portal user, returning nil when the
// request carries none.
Caller func(*http.Request) *Identity
}
Deps carries the collaborators the handlers need. Each is optional: a deployment without a database leaves them nil and the routes they back are not registered.
type DirectoryReader ¶
type DirectoryReader interface {
List(ctx context.Context, filter userdir.Filter) ([]userdir.User, int, error)
}
DirectoryReader lists the known-users directory. The picker only reads it, so this is the whole surface it takes; pkg/user.Store implements it.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler serves the people and mention routes.