event

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterAppEventHandler

func RegisterAppEventHandler(kind AppEventKind, handler AppEventHandler)

RegisterAppEventHandler 注册代运营APP事件处理Handler

func RegisterAuthEventHandler

func RegisterAuthEventHandler(kind AuthEventKind, handler AuthEventHandler)

Types

type AppEventHandler

type AppEventHandler func() error

type AppEventKind

type AppEventKind string

type AuthEventHandler

type AuthEventHandler func(string) error // 处理事件

type AuthEventKind

type AuthEventKind string
const (
	AuthEventKindComponentVerifyTicket AuthEventKind = "component_verify_ticket" // 校验组件校验凭证
	AuthEventKindAuthorized            AuthEventKind = "authorized"              // 授权
	AuthEventKindUpdateAuthorized      AuthEventKind = "updateauthorized"        // 更新授权
	AuthEventKindUnauthorized          AuthEventKind = "unauthorized"            // 取消授权
)

type Event

type Event interface {
	Handle() error
}

func NewAppEvent

func NewAppEvent(appId, token, encodingAESKey string, message *Message) (Event, error)

func NewAuthEvent

func NewAuthEvent(appId, token, encodingAESKey string, message *Message) (Event, error)

NewAuthEvent 创建授权事件

type Message

type Message struct {
	Signature string
	Timestamp string
	Nonce     string
	Body      string
}

Message 接收到的消息

type PreProcessor

type PreProcessor interface {
	Process(data []byte) (string, error)
}

PreProcessor 预处理器,对消息进行预处理

Jump to

Keyboard shortcuts

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