direct

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: Apache-2.0, BSD-3-Clause, MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

CacheDurations defines how long to cache each answer type Per IDEA.md Direct Answer Caching rules

Functions

This section is empty.

Types

type ASCIIHandler

type ASCIIHandler struct{}

ASCIIHandler handles ascii:{text} queries (ASCII art generator)

func NewASCIIHandler

func NewASCIIHandler() *ASCIIHandler

NewASCIIHandler creates a new ASCII art handler

func (*ASCIIHandler) Handle

func (h *ASCIIHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*ASCIIHandler) Type

func (h *ASCIIHandler) Type() AnswerType

type ASNHandler

type ASNHandler struct {
	// contains filtered or unexported fields
}

ASNHandler handles asn:{number} queries

func NewASNHandler

func NewASNHandler() *ASNHandler

NewASNHandler creates a new ASN handler

func (*ASNHandler) Handle

func (h *ASNHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*ASNHandler) Type

func (h *ASNHandler) Type() AnswerType

type Answer

type Answer struct {
	Type        AnswerType             `json:"type"`
	Term        string                 `json:"term"`
	Title       string                 `json:"title"`
	Description string                 `json:"description,omitempty"`
	Content     string                 `json:"content"`
	Data        map[string]interface{} `json:"data,omitempty"`
	Source      string                 `json:"source,omitempty"`
	SourceURL   string                 `json:"source_url,omitempty"`
	CacheTTL    time.Duration          `json:"cache_ttl,omitempty"`
	Error       string                 `json:"error,omitempty"`
	Timestamp   time.Time              `json:"timestamp"`
}

Answer represents a direct answer result (full page)

type AnswerType

type AnswerType string

AnswerType represents the type of direct answer

const (
	// Command reference
	AnswerTypeTLDR  AnswerType = "tldr"
	AnswerTypeMan   AnswerType = "man"
	AnswerTypeCheat AnswerType = "cheat"

	// Network
	AnswerTypeDNS     AnswerType = "dns"
	AnswerTypeWhois   AnswerType = "whois"
	AnswerTypeResolve AnswerType = "resolve"
	AnswerTypeCert    AnswerType = "cert"
	AnswerTypeHeaders AnswerType = "headers"
	AnswerTypeASN     AnswerType = "asn"
	AnswerTypeSubnet  AnswerType = "subnet"

	// Content lookup
	AnswerTypeWiki      AnswerType = "wiki"
	AnswerTypeDict      AnswerType = "dict"
	AnswerTypeThesaurus AnswerType = "thesaurus"
	AnswerTypePkg       AnswerType = "pkg"
	AnswerTypeCVE       AnswerType = "cve"
	AnswerTypeRFC       AnswerType = "rfc"

	// Directory search
	AnswerTypeDirectory AnswerType = "directory"

	// Encoding/formatting
	AnswerTypeHTML    AnswerType = "html"
	AnswerTypeUnicode AnswerType = "unicode"
	AnswerTypeEmoji   AnswerType = "emoji"
	AnswerTypeEscape  AnswerType = "escape"
	AnswerTypeJSON    AnswerType = "json"
	AnswerTypeYAML    AnswerType = "yaml"

	// Utilities
	AnswerTypeHTTP      AnswerType = "http"
	AnswerTypePort      AnswerType = "port"
	AnswerTypeCron      AnswerType = "cron"
	AnswerTypeChmod     AnswerType = "chmod"
	AnswerTypeRegex     AnswerType = "regex"
	AnswerTypeJWT       AnswerType = "jwt"
	AnswerTypeTimestamp AnswerType = "timestamp"

	// URL tools
	AnswerTypeRobots  AnswerType = "robots"
	AnswerTypeSitemap AnswerType = "sitemap"
	AnswerTypeTech    AnswerType = "tech"
	AnswerTypeFeed    AnswerType = "feed"
	AnswerTypeExpand  AnswerType = "expand"
	AnswerTypeSafe    AnswerType = "safe"
	AnswerTypeCache   AnswerType = "cache"

	// Text tools
	AnswerTypeCase     AnswerType = "case"
	AnswerTypeSlug     AnswerType = "slug"
	AnswerTypeLorem    AnswerType = "lorem"
	AnswerTypeWord     AnswerType = "word"
	AnswerTypeBeautify AnswerType = "beautify"
	AnswerTypeDiff     AnswerType = "diff"

	// Reference
	AnswerTypeUserAgent AnswerType = "useragent"
	AnswerTypeMIME      AnswerType = "mime"
	AnswerTypeLicense   AnswerType = "license"
	AnswerTypeCountry   AnswerType = "country"
	AnswerTypeSlang     AnswerType = "slang"
	AnswerTypeRules     AnswerType = "rules"

	// Generators
	AnswerTypeASCII AnswerType = "ascii"
	AnswerTypeQR    AnswerType = "qr"
)

Direct answer types - these are full-page results, not widgets

type BeautifyHandler

type BeautifyHandler struct{}

BeautifyHandler handles beautify:{code} queries

func NewBeautifyHandler

func NewBeautifyHandler() *BeautifyHandler

NewBeautifyHandler creates a new code beautifier handler

func (*BeautifyHandler) Handle

func (h *BeautifyHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*BeautifyHandler) Type

func (h *BeautifyHandler) Type() AnswerType

type CVEHandler

type CVEHandler struct {
	// contains filtered or unexported fields
}

CVEHandler handles cve:{id} queries

func NewCVEHandler

func NewCVEHandler() *CVEHandler

NewCVEHandler creates a new CVE handler

func (*CVEHandler) Handle

func (h *CVEHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*CVEHandler) Type

func (h *CVEHandler) Type() AnswerType

type CacheHandler

type CacheHandler struct {
	// contains filtered or unexported fields
}

CacheHandler handles cache:{url} queries (web archive lookup)

func NewCacheHandler

func NewCacheHandler() *CacheHandler

NewCacheHandler creates a new web cache/archive handler

func (*CacheHandler) Handle

func (h *CacheHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*CacheHandler) Type

func (h *CacheHandler) Type() AnswerType

type CaseHandler

type CaseHandler struct{}

CaseHandler handles case:{text} queries

func NewCaseHandler

func NewCaseHandler() *CaseHandler

NewCaseHandler creates a new case converter handler

func (*CaseHandler) Handle

func (h *CaseHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*CaseHandler) Type

func (h *CaseHandler) Type() AnswerType

type CertHandler

type CertHandler struct {
	// contains filtered or unexported fields
}

CertHandler handles cert:{domain} queries

func NewCertHandler

func NewCertHandler() *CertHandler

NewCertHandler creates a new certificate handler

func (*CertHandler) Handle

func (h *CertHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*CertHandler) Type

func (h *CertHandler) Type() AnswerType

type CheatHandler

type CheatHandler struct {
	// contains filtered or unexported fields
}

CheatHandler handles cheat:{command} queries

func NewCheatHandler

func NewCheatHandler() *CheatHandler

NewCheatHandler creates a new cheat.sh handler

func (*CheatHandler) Handle

func (h *CheatHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*CheatHandler) Type

func (h *CheatHandler) Type() AnswerType

type ChmodHandler

type ChmodHandler struct{}

ChmodHandler handles chmod:{permissions} queries

func NewChmodHandler

func NewChmodHandler() *ChmodHandler

NewChmodHandler creates a new chmod handler

func (*ChmodHandler) Handle

func (h *ChmodHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*ChmodHandler) Type

func (h *ChmodHandler) Type() AnswerType

type CountryHandler

type CountryHandler struct {
	// contains filtered or unexported fields
}

CountryHandler handles country:{code} queries

func NewCountryHandler

func NewCountryHandler() *CountryHandler

NewCountryHandler creates a new country handler

func (*CountryHandler) Handle

func (h *CountryHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*CountryHandler) Type

func (h *CountryHandler) Type() AnswerType

type CronHandler

type CronHandler struct{}

CronHandler handles cron:{expression} queries

func NewCronHandler

func NewCronHandler() *CronHandler

NewCronHandler creates a new cron handler

func (*CronHandler) Handle

func (h *CronHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*CronHandler) Type

func (h *CronHandler) Type() AnswerType

type DNSHandler

type DNSHandler struct {
	// contains filtered or unexported fields
}

DNSHandler handles dns:{domain} queries

func NewDNSHandler

func NewDNSHandler() *DNSHandler

NewDNSHandler creates a new DNS handler

func (*DNSHandler) Handle

func (h *DNSHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*DNSHandler) Type

func (h *DNSHandler) Type() AnswerType

type DictHandler

type DictHandler struct {
	// contains filtered or unexported fields
}

DictHandler handles dict:{word} queries

func NewDictHandler

func NewDictHandler() *DictHandler

NewDictHandler creates a new dictionary handler

func (*DictHandler) Handle

func (h *DictHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*DictHandler) Type

func (h *DictHandler) Type() AnswerType

type DiffHandler

type DiffHandler struct{}

DiffHandler handles diff:{texts} queries

func NewDiffHandler

func NewDiffHandler() *DiffHandler

NewDiffHandler creates a new diff handler

func (*DiffHandler) Handle

func (h *DiffHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*DiffHandler) Type

func (h *DiffHandler) Type() AnswerType

type DirectoryHandler

type DirectoryHandler struct {
	// contains filtered or unexported fields
}

DirectoryHandler handles directory:{term} queries (open directory search)

func NewDirectoryHandler

func NewDirectoryHandler() *DirectoryHandler

NewDirectoryHandler creates a new directory search handler

func (*DirectoryHandler) Handle

func (h *DirectoryHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*DirectoryHandler) Type

func (h *DirectoryHandler) Type() AnswerType

type EmojiHandler

type EmojiHandler struct{}

EmojiHandler handles emoji:{name} queries

func NewEmojiHandler

func NewEmojiHandler() *EmojiHandler

NewEmojiHandler creates a new emoji handler

func (*EmojiHandler) Handle

func (h *EmojiHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*EmojiHandler) Type

func (h *EmojiHandler) Type() AnswerType

type EscapeHandler

type EscapeHandler struct{}

EscapeHandler handles escape:{text} queries

func NewEscapeHandler

func NewEscapeHandler() *EscapeHandler

NewEscapeHandler creates a new escape handler

func (*EscapeHandler) Handle

func (h *EscapeHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*EscapeHandler) Type

func (h *EscapeHandler) Type() AnswerType

type ExpandHandler

type ExpandHandler struct {
	// contains filtered or unexported fields
}

ExpandHandler handles expand:{url} queries (URL expander)

func NewExpandHandler

func NewExpandHandler() *ExpandHandler

NewExpandHandler creates a new URL expander handler

func (*ExpandHandler) Handle

func (h *ExpandHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*ExpandHandler) Type

func (h *ExpandHandler) Type() AnswerType

type FeedHandler

type FeedHandler struct {
	// contains filtered or unexported fields
}

FeedHandler handles feed:{domain} queries (RSS/Atom discovery)

func NewFeedHandler

func NewFeedHandler() *FeedHandler

NewFeedHandler creates a new feed discovery handler

func (*FeedHandler) Handle

func (h *FeedHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*FeedHandler) Type

func (h *FeedHandler) Type() AnswerType

type HTMLHandler

type HTMLHandler struct{}

HTMLHandler handles html:{text} queries

func NewHTMLHandler

func NewHTMLHandler() *HTMLHandler

NewHTMLHandler creates a new HTML encoding handler

func (*HTMLHandler) Handle

func (h *HTMLHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*HTMLHandler) Type

func (h *HTMLHandler) Type() AnswerType

type HTTPHandler

type HTTPHandler struct{}

HTTPHandler handles http:{code} queries

func NewHTTPHandler

func NewHTTPHandler() *HTTPHandler

NewHTTPHandler creates a new HTTP status code handler

func (*HTTPHandler) Handle

func (h *HTTPHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*HTTPHandler) Type

func (h *HTTPHandler) Type() AnswerType

type Handler

type Handler interface {
	// Type returns the answer type this handler provides
	Type() AnswerType
	// Handle processes the term and returns a direct answer
	Handle(ctx context.Context, term string) (*Answer, error)
}

Handler interface for direct answer handlers

type HeadersHandler

type HeadersHandler struct {
	// contains filtered or unexported fields
}

HeadersHandler handles headers:{url} queries

func NewHeadersHandler

func NewHeadersHandler() *HeadersHandler

NewHeadersHandler creates a new HTTP headers handler

func (*HeadersHandler) Handle

func (h *HeadersHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*HeadersHandler) Type

func (h *HeadersHandler) Type() AnswerType

type JSONHandler

type JSONHandler struct{}

JSONHandler handles json:{data} queries

func NewJSONHandler

func NewJSONHandler() *JSONHandler

NewJSONHandler creates a new JSON handler

func (*JSONHandler) Handle

func (h *JSONHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*JSONHandler) Type

func (h *JSONHandler) Type() AnswerType

type JWTHandler

type JWTHandler struct{}

JWTHandler handles jwt:{token} queries

func NewJWTHandler

func NewJWTHandler() *JWTHandler

NewJWTHandler creates a new JWT handler

func (*JWTHandler) Handle

func (h *JWTHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*JWTHandler) Type

func (h *JWTHandler) Type() AnswerType

type LicenseHandler

type LicenseHandler struct {
	// contains filtered or unexported fields
}

LicenseHandler handles license:{name} queries

func NewLicenseHandler

func NewLicenseHandler() *LicenseHandler

NewLicenseHandler creates a new license handler

func (*LicenseHandler) Handle

func (h *LicenseHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*LicenseHandler) Type

func (h *LicenseHandler) Type() AnswerType

type LoremHandler

type LoremHandler struct{}

LoremHandler handles lorem:{count} queries

func NewLoremHandler

func NewLoremHandler() *LoremHandler

NewLoremHandler creates a new lorem ipsum generator handler

func (*LoremHandler) Handle

func (h *LoremHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*LoremHandler) Type

func (h *LoremHandler) Type() AnswerType

type MIMEHandler

type MIMEHandler struct{}

MIMEHandler handles mime:{type} queries

func NewMIMEHandler

func NewMIMEHandler() *MIMEHandler

NewMIMEHandler creates a new MIME type handler

func (*MIMEHandler) Handle

func (h *MIMEHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*MIMEHandler) Type

func (h *MIMEHandler) Type() AnswerType

type ManHandler

type ManHandler struct {
	// contains filtered or unexported fields
}

ManHandler handles man:{page} queries

func NewManHandler

func NewManHandler() *ManHandler

NewManHandler creates a new man page handler

func (*ManHandler) Handle

func (h *ManHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*ManHandler) Type

func (h *ManHandler) Type() AnswerType

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager manages all direct answer handlers

func NewManager

func NewManager() *Manager

NewManager creates a new direct answer manager

func (*Manager) GetHandler

func (m *Manager) GetHandler(answerType AnswerType) (Handler, bool)

GetHandler returns the handler for a specific type

func (*Manager) GetHandlerTypes

func (m *Manager) GetHandlerTypes() []AnswerType

GetHandlerTypes returns all registered handler types

func (*Manager) IsDirectAnswer

func (m *Manager) IsDirectAnswer(query string) bool

IsDirectAnswer checks if query is a direct answer query

func (*Manager) Parse

func (m *Manager) Parse(query string) (AnswerType, string)

Parse checks if query matches direct answer syntax and returns type and term Returns empty strings if not a direct answer query

func (*Manager) Process

func (m *Manager) Process(ctx context.Context, query string) (*Answer, error)

Process handles a direct answer query

func (*Manager) ProcessType

func (m *Manager) ProcessType(ctx context.Context, answerType AnswerType, term string) (*Answer, error)

ProcessType handles a specific direct answer type

func (*Manager) Register

func (m *Manager) Register(h Handler)

Register adds a handler to the manager

type PkgHandler

type PkgHandler struct {
	// contains filtered or unexported fields
}

PkgHandler handles pkg:{name} queries

func NewPkgHandler

func NewPkgHandler() *PkgHandler

NewPkgHandler creates a new package handler

func (*PkgHandler) Handle

func (h *PkgHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*PkgHandler) Type

func (h *PkgHandler) Type() AnswerType

type PortHandler

type PortHandler struct{}

PortHandler handles port:{number} queries

func NewPortHandler

func NewPortHandler() *PortHandler

NewPortHandler creates a new port handler

func (*PortHandler) Handle

func (h *PortHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*PortHandler) Type

func (h *PortHandler) Type() AnswerType

type QRHandler

type QRHandler struct{}

QRHandler handles qr:{text} queries

func NewQRHandler

func NewQRHandler() *QRHandler

NewQRHandler creates a new QR code handler

func (*QRHandler) Handle

func (h *QRHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*QRHandler) Type

func (h *QRHandler) Type() AnswerType

type RFCHandler

type RFCHandler struct {
	// contains filtered or unexported fields
}

RFCHandler handles rfc:{number} queries

func NewRFCHandler

func NewRFCHandler() *RFCHandler

NewRFCHandler creates a new RFC handler

func (*RFCHandler) Handle

func (h *RFCHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*RFCHandler) Type

func (h *RFCHandler) Type() AnswerType

type RegexHandler

type RegexHandler struct{}

RegexHandler handles regex:{pattern} queries

func NewRegexHandler

func NewRegexHandler() *RegexHandler

NewRegexHandler creates a new regex handler

func (*RegexHandler) Handle

func (h *RegexHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*RegexHandler) Type

func (h *RegexHandler) Type() AnswerType

type ResolveHandler

type ResolveHandler struct {
	// contains filtered or unexported fields
}

ResolveHandler handles resolve:{hostname} queries

func NewResolveHandler

func NewResolveHandler() *ResolveHandler

NewResolveHandler creates a new resolve handler

func (*ResolveHandler) Handle

func (h *ResolveHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*ResolveHandler) Type

func (h *ResolveHandler) Type() AnswerType

type RobotsHandler

type RobotsHandler struct {
	// contains filtered or unexported fields
}

RobotsHandler handles robots:{domain} queries

func NewRobotsHandler

func NewRobotsHandler() *RobotsHandler

NewRobotsHandler creates a new robots.txt handler

func (*RobotsHandler) Handle

func (h *RobotsHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*RobotsHandler) Type

func (h *RobotsHandler) Type() AnswerType

type Rule

type Rule struct {
	Number int
	Text   string
}

Rule represents a single Rule of the Internet

type RulesHandler

type RulesHandler struct{}

RulesHandler handles rules:{query} queries Easter egg: Rules of the Internet

func NewRulesHandler

func NewRulesHandler() *RulesHandler

NewRulesHandler creates a new rules handler

func (*RulesHandler) Handle

func (h *RulesHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*RulesHandler) Type

func (h *RulesHandler) Type() AnswerType

type SafeHandler

type SafeHandler struct {
	// contains filtered or unexported fields
}

SafeHandler handles safe:{url} queries (URL safety check)

func NewSafeHandler

func NewSafeHandler() *SafeHandler

NewSafeHandler creates a new URL safety handler

func (*SafeHandler) Handle

func (h *SafeHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*SafeHandler) Type

func (h *SafeHandler) Type() AnswerType

type SitemapHandler

type SitemapHandler struct {
	// contains filtered or unexported fields
}

SitemapHandler handles sitemap:{domain} queries

func NewSitemapHandler

func NewSitemapHandler() *SitemapHandler

NewSitemapHandler creates a new sitemap handler

func (*SitemapHandler) Handle

func (h *SitemapHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*SitemapHandler) Type

func (h *SitemapHandler) Type() AnswerType

type SlangHandler

type SlangHandler struct {
	// contains filtered or unexported fields
}

SlangHandler handles slang:{term} queries Uses Urban Dictionary API for definitions

func NewSlangHandler

func NewSlangHandler() *SlangHandler

NewSlangHandler creates a new slang handler

func (*SlangHandler) Handle

func (h *SlangHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*SlangHandler) Type

func (h *SlangHandler) Type() AnswerType

type SlugHandler

type SlugHandler struct{}

SlugHandler handles slug:{text} queries

func NewSlugHandler

func NewSlugHandler() *SlugHandler

NewSlugHandler creates a new slug generator handler

func (*SlugHandler) Handle

func (h *SlugHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*SlugHandler) Type

func (h *SlugHandler) Type() AnswerType

type SubnetHandler

type SubnetHandler struct{}

SubnetHandler handles subnet:{cidr} queries

func NewSubnetHandler

func NewSubnetHandler() *SubnetHandler

NewSubnetHandler creates a new subnet calculator handler

func (*SubnetHandler) Handle

func (h *SubnetHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*SubnetHandler) Type

func (h *SubnetHandler) Type() AnswerType

type TLDRHandler

type TLDRHandler struct {
	// contains filtered or unexported fields
}

TLDRHandler handles tldr:{command} queries

func NewTLDRHandler

func NewTLDRHandler() *TLDRHandler

NewTLDRHandler creates a new TLDR handler

func (*TLDRHandler) Handle

func (h *TLDRHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*TLDRHandler) Type

func (h *TLDRHandler) Type() AnswerType

type TechHandler

type TechHandler struct {
	// contains filtered or unexported fields
}

TechHandler handles tech:{domain} queries (technology detection)

func NewTechHandler

func NewTechHandler() *TechHandler

NewTechHandler creates a new technology detection handler

func (*TechHandler) Handle

func (h *TechHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*TechHandler) Type

func (h *TechHandler) Type() AnswerType

type ThesaurusHandler

type ThesaurusHandler struct {
	// contains filtered or unexported fields
}

ThesaurusHandler handles thesaurus:{word} queries

func NewThesaurusHandler

func NewThesaurusHandler() *ThesaurusHandler

NewThesaurusHandler creates a new thesaurus handler

func (*ThesaurusHandler) Handle

func (h *ThesaurusHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*ThesaurusHandler) Type

func (h *ThesaurusHandler) Type() AnswerType

type TimestampHandler

type TimestampHandler struct{}

TimestampHandler handles timestamp:{value} queries

func NewTimestampHandler

func NewTimestampHandler() *TimestampHandler

NewTimestampHandler creates a new timestamp handler

func (*TimestampHandler) Handle

func (h *TimestampHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*TimestampHandler) Type

func (h *TimestampHandler) Type() AnswerType

type UnicodeHandler

type UnicodeHandler struct{}

UnicodeHandler handles unicode:{char} queries

func NewUnicodeHandler

func NewUnicodeHandler() *UnicodeHandler

NewUnicodeHandler creates a new Unicode handler

func (*UnicodeHandler) Handle

func (h *UnicodeHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*UnicodeHandler) Type

func (h *UnicodeHandler) Type() AnswerType

type UserAgentHandler

type UserAgentHandler struct{}

UserAgentHandler handles useragent:{string} queries

func NewUserAgentHandler

func NewUserAgentHandler() *UserAgentHandler

NewUserAgentHandler creates a new user agent parser handler

func (*UserAgentHandler) Handle

func (h *UserAgentHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*UserAgentHandler) Type

func (h *UserAgentHandler) Type() AnswerType

type WhoisHandler

type WhoisHandler struct {
	// contains filtered or unexported fields
}

WhoisHandler handles whois:{domain} queries

func NewWhoisHandler

func NewWhoisHandler() *WhoisHandler

NewWhoisHandler creates a new WHOIS handler

func (*WhoisHandler) Handle

func (h *WhoisHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*WhoisHandler) Type

func (h *WhoisHandler) Type() AnswerType

type WikiHandler

type WikiHandler struct {
	// contains filtered or unexported fields
}

WikiHandler handles wiki:{topic} queries

func NewWikiHandler

func NewWikiHandler() *WikiHandler

NewWikiHandler creates a new Wikipedia handler

func (*WikiHandler) Handle

func (h *WikiHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*WikiHandler) Type

func (h *WikiHandler) Type() AnswerType

type WordHandler

type WordHandler struct{}

WordHandler handles word:{text} queries (text statistics)

func NewWordHandler

func NewWordHandler() *WordHandler

NewWordHandler creates a new word/text statistics handler

func (*WordHandler) Handle

func (h *WordHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*WordHandler) Type

func (h *WordHandler) Type() AnswerType

type YAMLHandler

type YAMLHandler struct{}

YAMLHandler handles yaml:{data} queries

func NewYAMLHandler

func NewYAMLHandler() *YAMLHandler

NewYAMLHandler creates a new YAML handler

func (*YAMLHandler) Handle

func (h *YAMLHandler) Handle(ctx context.Context, term string) (*Answer, error)

func (*YAMLHandler) Type

func (h *YAMLHandler) Type() AnswerType

Jump to

Keyboard shortcuts

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