event

package
v0.2.5 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

This section is empty.

Types

type AppEvent added in v0.2.5

type AppEvent interface {
	RegisterHandler(kind AppEventKind, handler AppEventHandler)
	Handle() error
}

func NewAppEvent

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

type AppEventHandler

type AppEventHandler func() error

type AppEventKind

type AppEventKind string

type AuthEvent added in v0.2.5

type AuthEvent interface {
	RegisterHandler(kind AuthEventKind, handler AuthEventHandler)
	Handle() error
}

func NewAuthEvent

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

NewAuthEvent 创建授权事件

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 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