Documentation ¶
Index ¶
- Constants
- func AgentChatHandler(r *ghttp.Request)
- func VisitorChatHandler(r *ghttp.Request)
- type Bucket
- type Channel
- func (ch *Channel) WriteMessage(msg *ChatMsg) error
- func (ch *Channel) WriteSystemMessage(aid, vid, text string) error
- func (ch *Channel) WriteSystemMessagef(aid, vid, text string, format string, v ...interface{}) error
- func (ch *Channel) WriteTextMessage(aid, vid, text string) error
- func (ch *Channel) WriteTextMessagef(aid, vid, format string, v ...interface{}) error
- type ChatMsg
- type Conversation
- type Server
Constants ¶
View Source
const ( ChatMsgTypeSystem = "system" ChatMsgTypeText = "text" ChatMsgTypeImage = "image" ChatMsgTypeCmd = "cmd" )
Variables ¶
This section is empty.
Functions ¶
func AgentChatHandler ¶
func VisitorChatHandler ¶
Types ¶
type Channel ¶
type Channel struct {
// contains filtered or unexported fields
}
func (*Channel) WriteMessage ¶
func (*Channel) WriteSystemMessage ¶
func (*Channel) WriteSystemMessagef ¶
func (*Channel) WriteTextMessage ¶
func (*Channel) WriteTextMessagef ¶
type ChatMsg ¶
type ChatMsg struct { AgentID string `json:"agentID"` VisitorID string `json:"visitorID"` Type string `json:"type"` Content map[string]interface{} `json:"content" v:"required"` CreatedAt int64 `json:"createdAt"` }
func NewChatMsg ¶
type Conversation ¶
type Conversation struct { VisitorID string `json:"id"` Nickname string `json:"nickname"` Content map[string]interface{} `json:"content"` ActiveAt time.Time `json:"activeAt"` }
func GetRealtimeConversations ¶
func GetRealtimeConversations(ctx context.Context) ([]*Conversation, error)
GetRealtimeConversations 获取当前所有对话
Click to show internal directories.
Click to hide internal directories.