Documentation ¶
Index ¶
- type Chain
- type ChatChain
- type ChatMessage
- type Client
- type Context
- type DingTalkMessage
- type EventMessage
- type HandlerFunc
- type Message
- type MessageType
- type Messenger
- type Module
- type RWMap
- func (rw *RWMap[T, R]) Delete(key T)
- func (rw *RWMap[T, R]) Each(f func(T, R) bool)
- func (rw *RWMap[T, R]) Get(key T) (R, bool)
- func (rw RWMap[T, R]) MarshalJSON() ([]byte, error)
- func (rw *RWMap[T, R]) MustGet(key T) R
- func (rw *RWMap[T, R]) Put(key T, value R)
- func (rw *RWMap[T, R]) Size() int
- func (rw *RWMap[T, R]) UnmarshalJSON(bytes []byte) error
- type Sendable
- type Simple
- type Value
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Chain ¶
type Chain struct {
// contains filtered or unexported fields
}
Chain multi handler module
func ModuleChain ¶
func ModuleChain() *Chain
func (*Chain) Handle ¶
func (c *Chain) Handle(handler HandlerFunc) *Chain
func (*Chain) Use ¶
func (c *Chain) Use(middleware HandlerFunc) *Chain
type ChatChain ¶
type ChatChain struct {
// contains filtered or unexported fields
}
ChatChain check prefix as command handler module
func ModuleChatChain ¶
func ModuleChatChain() *ChatChain
func (*ChatChain) Default ¶
func (c *ChatChain) Default(handler HandlerFunc) *ChatChain
func (*ChatChain) Handle ¶
func (c *ChatChain) Handle(command string, handler HandlerFunc) *ChatChain
func (*ChatChain) Use ¶
func (c *ChatChain) Use(middleware HandlerFunc) *ChatChain
type ChatMessage ¶
type ChatMessage *chatbot.BotCallbackDataModel
type Client ¶
type Client struct { *Messenger // contains filtered or unexported fields }
func (*Client) AutoReconnect ¶
type Context ¶
type Context struct { *Message Client *Client Next func() // contains filtered or unexported fields }
func (*Context) AbortWithError ¶
type DingTalkMessage ¶
type DingTalkMessage struct { MsgKey string `json:"msgKey" mapstructure:"msgKey"` MsgParam map[string]string `json:"msgParam" mapstructure:"msgParam"` ConversationId string `json:"openConversationId" mapstructure:"openConversationId"` // contains filtered or unexported fields }
func (DingTalkMessage) MarshalJSON ¶
func (msg DingTalkMessage) MarshalJSON() ([]byte, error)
func (*DingTalkMessage) OpenConversationId ¶
func (msg *DingTalkMessage) OpenConversationId() string
type EventMessage ¶
type EventMessage *(struct { Header *event.EventHeader // contains filtered or unexported fields })
type HandlerFunc ¶
type HandlerFunc func(*Context)
type Message ¶
type Message struct { Type MessageType // contains filtered or unexported fields }
func (*Message) Chat ¶
func (m *Message) Chat() ChatMessage
func (*Message) Event ¶
func (m *Message) Event() EventMessage
type MessageType ¶
type MessageType string
const ( TypeChat MessageType = "Chat" TypeEvent MessageType = "Event" )
type Messenger ¶
type Messenger struct {
// contains filtered or unexported fields
}
func (*Messenger) SendMarkdownMessage ¶
func (*Messenger) SendTextMessage ¶
type RWMap ¶
type RWMap[T comparable, R any] struct { // contains filtered or unexported fields }
func NewRWMap ¶
func NewRWMap[T comparable, R any]() *RWMap[T, R]
func NewRWValueMap ¶
func NewRWValueMap[T comparable]() *RWMap[T, *Value]
func (RWMap[T, R]) MarshalJSON ¶
func (*RWMap[T, R]) UnmarshalJSON ¶
type Simple ¶
type Simple struct {
// contains filtered or unexported fields
}
Simple only one handler module
func ModuleSimple ¶
func ModuleSimple() *Simple
func (*Simple) Handle ¶
func (s *Simple) Handle(handler HandlerFunc) *Simple
Click to show internal directories.
Click to hide internal directories.