logger

package
v0.4.11 Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package logger 是 cap/larkevent.Handler 的示例插件: 订阅一类或多类 Lark 自定义事件,收到后以 slog 记录。 注入 platform/feishu、platform/lark 的 deps.eventHandlers 使用。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// EventTypes 是 Lark 事件类型字符串(如 drive.file.created_v1),
	// 需与 Lark 开发者后台的事件订阅保持一致。
	EventTypes []string `json:"eventTypes"`
	// LogRaw 为 true 时记录完整事件 JSON(默认只记录类型与上下文摘要)。
	LogRaw bool `json:"logRaw,omitempty"`
}

Config 声明本实例订阅的事件类型列表。

type Deps

type Deps struct{}

type Handler

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

Handler 实现 cap/larkevent.Handler。

func New

func New(cfg Config, _ Deps) (*Handler, error)

New 注册 lark-event/logger:按 config.eventTypes 订阅 Lark 自定义事件并打日志。

func (*Handler) EventTypes

func (h *Handler) EventTypes() []string

func (*Handler) Handle

func (h *Handler) Handle(_ context.Context, event caplarkevent.Event) error

Jump to

Keyboard shortcuts

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