Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func TGChatID2TanantID ¶
Types ¶
type API ¶
API :Cypress API struct Endpoint: cypress api endpoint TermMustMode = true: add cy_termmust=true to the cypress api request url url
func (*API) SearchWithClause ¶
func (api *API) SearchWithClause(searchclause *SearchClause, chatID int64) (*Result, error)
SearchWithClause : request the search result from cypress serach API
func (*API) Update ¶
func (api *API) Update(doc *ChatDocument)
Update send the ChatDocument to the cypress update API
type ChatDocument ¶
type ChatDocument struct { XMLName xml.Name `xml:"node"` TenantID *TenantID `xml:"cy_tenantid"` URI string `xml:"uri"` XMLURI string `xml:"xmluri"` Title *Title `xml:"title"` Content *Content `xml:"content"` IsReply bool `xml:"isreply"` ChatID int64 `xml:"chatid"` MessageID int `xml:"messsageid"` UserID int `xml:"userid"` UserName string `xml:"username"` Date *Date `xml:"newdate"` }
ChatDocument is the Cypress Document Node
func TelegramMessageToDocument ¶
func TelegramMessageToDocument(msg *tgbotapi.Message) *ChatDocument
TelegramMessageToDocument make ChatDocument Instances from Telegram Messages
type Date ¶
type Date struct { XMLName xml.Name `xml:"newdate"` Type string `xml:"type,attr"` Text int `xml:",chardata"` }
Date is the Cypress Document Date Node
type Item ¶
type Item struct { NewDate string `json:"newdate"` Date string `json:"date"` Match float32 `json:"cypress.match"` IsReply string `json:"isreply"` MesssageID string `json:"messsageid"` ChatID string `json:"chatid"` Title string `json:"title"` URI string `json:"uri"` UserID string `json:"userid"` UserName string `json:"username"` Content string `json:"content"` }
Item is search hit item node
type Result ¶
type Result struct { Spellcorrect string `json:"spellcorrect"` Segment string `json:"segment"` Count int `json:"count"` Querywords string `json:"querywords"` Time int `json:"time"` Items []Item `json:"items"` }
Result is the child node of the top node
type SearchClause ¶
type SearchResult ¶
type SearchResult struct {
Result Result `json:"result"`
}
SearchResult is the Cypress Search result top node
Click to show internal directories.
Click to hide internal directories.