Documentation
¶
Overview ¶
Package sessionquery queries sessions and FTS5 search (S04), matching storage/session-query. It reads the S03 SQLite store through ListSessions, Load, and Search. Titles use the latest title event or the first user-message prefix. ListSummaries filters by title prefix, creation-time range, and limit, ordered by most recent update. Search unions FTS5 body/title hits with title-substring matches and returns summaries.
Session-reference URIs match context/session-reference: opaque session IDs round-trip through canonical omnix-session URIs and Markdown mentions.
Index ¶
Constants ¶
const Scheme = "omnix-session:"
Scheme is reserved for session snapshot references.
Variables ¶
var ErrInvalidURI = errors.New("sessionquery: invalid session reference URI")
ErrInvalidURI indicates an invalid or noncanonical session-reference URI.
Functions ¶
func FormatMention ¶
FormatMention renders a Markdown mention with a canonical URI; empty labels use the ID.
Types ¶
type ListRequest ¶
type ListRequest struct {
TitlePrefix string // Optional title-prefix filter.
CreatedFrom *time.Time // Optional inclusive lower creation-time bound.
CreatedTo *time.Time // Optional inclusive upper creation-time bound.
Limit int // Maximum results; nonpositive means unlimited.
}
ListRequest configures the three session-list filters.
type QueryService ¶
type QueryService struct {
// contains filtered or unexported fields
}
QueryService finds sessions by title, time, or keyword.
func New ¶
func New(store *sqlstore.Store) *QueryService
New binds a query service to the S03 SQLite session store.
func (*QueryService) ListSummaries ¶
func (q *QueryService) ListSummaries(ctx context.Context, req ListRequest) ([]SessionSummary, error)
ListSummaries filters by title prefix and creation range, ordered by latest update first.
func (*QueryService) Search ¶
func (q *QueryService) Search(ctx context.Context, req SearchRequest) ([]SessionSummary, error)
Search returns summaries for the union of FTS5 content hits and title-substring matches.
type SearchRequest ¶
type SearchRequest struct {
Keyword string // Nonempty search keyword.
Limit int // Maximum results.
}
SearchRequest configures full-text search.