event

package
v0.0.0-...-ff14b99 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2021 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BotRecvMsgHandler

func BotRecvMsgHandler(ctx context.Context, data []byte) error

BotRecvMsgHandler callback botRecvMsg

func BotRecvMsgRegister

func BotRecvMsgRegister(appID string, cmdName string, handler HandlerBotMsg) error

BotRecvMsgRegister appid+cmd --> handler

func CardCallBack

func CardCallBack(ctx context.Context, appID string, header map[string]string, body []byte) (*protocol.CardForm, string, error)

func CardRegister

func CardRegister(appID string, method string, handler ActionMethod) error

func EventCallback

func EventCallback(ctx context.Context, body string, appID string) (string, error)

func EventRegister

func EventRegister(appID, eventTypeList string, eventHandler EventHandler) error

func IgnoreSign

func IgnoreSign(appid string, ignore bool)

Types

type ActionHandlerManager

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

func (*ActionHandlerManager) Get

func (a *ActionHandlerManager) Get(appID string, method string) (ActionMethod, error)

func (*ActionHandlerManager) Set

func (a *ActionHandlerManager) Set(appID string, method string, v ActionMethod)

type ActionMethod

type ActionMethod func(ctx context.Context, cardCallback *protocol.CardCallbackForm) (*protocol.CardForm, error)

type CommandHandlerManager

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

CommandHandlerManager cmd --> handler

func (*CommandHandlerManager) Get

func (p *CommandHandlerManager) Get(appID string, cmdName string) (HandlerBotMsg, error)

func (*CommandHandlerManager) Set

func (p *CommandHandlerManager) Set(appID string, cmdName string, handler HandlerBotMsg)

type EventHandler

type EventHandler func(ctx context.Context, eventBody []byte) error

type EventHandlerManager

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

func (*EventHandlerManager) Get

func (a *EventHandlerManager) Get(appID string, eventType string) (EventHandler, error)

func (*EventHandlerManager) Set

func (a *EventHandlerManager) Set(appID, eventTypeList string, eventHandler EventHandler)

type HandlerBotMsg

type HandlerBotMsg func(ctx context.Context, msg *protocol.BotRecvMsg) error

Jump to

Keyboard shortcuts

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