Documentation
¶
Index ¶
Constants ¶
const ProjectName = "search"
ProjectName is the name of this project, used for CLI client detection
Variables ¶
This section is empty.
Functions ¶
func GetPreferredFormat ¶
GetPreferredFormat returns the preferred response format based on client type Per AI.md PART 14: Content Negotiation Priority
func IsBrowser ¶
IsBrowser detects if the request is from a regular browser Regular browsers get full HTML with JavaScript Per AI.md PART 14: Client Type Detection & Response
func IsHttpTool ¶
IsHttpTool detects HTTP tools (curl, wget, httpie, etc.) HTTP tools are NON-INTERACTIVE - they just dump output Per AI.md PART 14: Client Type Detection & Response
func IsNonInteractiveClient ¶
IsNonInteractiveClient detects non-interactive clients (HTTP tools) These clients just dump output and don't interact with forms Per AI.md PART 14: Non-interactive tools get pre-formatted text
func IsOurCliClient ¶
isOurCliClient detects our own CLI client Our CLI is INTERACTIVE (TUI/GUI) - receives JSON, renders itself Per AI.md PART 14: Client Type Detection & Response
func IsTextBrowser ¶
IsTextBrowser detects text-mode browsers (lynx, w3m, links, etc.) Text browsers are INTERACTIVE but do NOT support JavaScript They receive no-JS HTML alternative (server-rendered, standard form POST) Per AI.md PART 14: Client Type Detection & Response
Types ¶
type ClientType ¶
type ClientType int
DetectClientType returns the type of client making the request Per AI.md PART 14: Client Type Detection & Response
const ( ClientTypeUnknown ClientType = iota ClientTypeBrowser // Regular browser - gets full HTML with JS ClientTypeTextBrowser // Text browser (lynx, w3m) - gets HTML without JS ClientTypeHttpTool // HTTP tool (curl, wget) - gets formatted text ClientTypeOurCLI // Our CLI client - gets JSON ClientTypeAPI // API client - gets JSON )
func DetectClientType ¶
func DetectClientType(r *http.Request) ClientType
DetectClientType determines the type of client from the request Per AI.md PART 14: Client Type Detection & Response
func (ClientType) String ¶
func (c ClientType) String() string
String returns the string representation of ClientType