chatsearch

package
v0.39.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package chatsearch is the output half shared by `team chat search` and `channel search` (hadron-cli#1327): one page of references into a chat's history. The two commands differ only in how they address the chat.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextFlags

func ContextFlags(f *cmdutil.Factory, withApp bool) string

ContextFlags returns the persistent flags that selected this search, quoted for the shell, so a printed read hint reads the SAME server (and, with withApp, the same team App) rather than whatever the environment resolves.

func MapError

func MapError(err error) error

MapError is api.MapError plus the BAD_USER_INPUT code for `--limit` below 1, which the issue lists among the typed refusals a search passes through. It is scoped to these commands: BAD_USER_INPUT is the server's generic validation code, so no other command's error envelope changes.

func Render

func Render(f *cmdutil.Factory, page PageDTO, readHint func(seq int) string) error

Render writes the page. readHint returns the command that reads one hit by its seq; the text view prints it once, for the newest hit, because a search returns references only and the caller reads the message to see it.

Types

type MatchDTO

type MatchDTO struct {
	Seq                int     `json:"seq"`
	URN                *string `json:"urn"`
	NodeID             string  `json:"nodeId"`
	ChannelID          string  `json:"channelId"`
	ChannelIncarnation int     `json:"channelIncarnation"`
}

MatchDTO is one hit: a reference, never a body or snippet.

type PageDTO

type PageDTO struct {
	ChannelID          *string    `json:"channelId"`
	ChannelIncarnation *int       `json:"channelIncarnation"`
	Complete           bool       `json:"complete"`
	Cursor             *string    `json:"cursor"`
	Items              []MatchDTO `json:"items"`
}

PageDTO is the stable --json shape of TeamChatSearchPage. Complete and Cursor are passed through untouched: complete is true only when the search reached the start of the history, and an empty page with complete=false means the server's scan bound fired and the search may continue with the cursor.

func FromGen

func FromGen(p gen.ChatSearchPageFields) PageDTO

FromGen projects the generated page onto the DTO, so --json does not move when the client is regenerated.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL