notify

package
v1.8.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const InternalTokenHeader = "X-Internal-Token"

InternalTokenHeader is the header key for internal service authentication.

View Source
const (
	// NotifyBotUIDValue is the static UID for the notification system bot.
	NotifyBotUIDValue = "notification"
)

Variables

This section is empty.

Functions

func NotifyBotUID

func NotifyBotUID() string

NotifyBotUID returns the static notification bot UID.

Types

type BatchNotifyReq

type BatchNotifyReq struct {
	Notifications []NotifyReq `json:"notifications" binding:"required"`
}

BatchNotifyReq 批量通知请求

type BatchNotifyResp

type BatchNotifyResp struct {
	Results   []BatchNotifyResult `json:"results"`
	HasErrors bool                `json:"has_errors"`
}

BatchNotifyResp 批量通知响应

type BatchNotifyResult

type BatchNotifyResult struct {
	NotifyResp
	Error string `json:"error,omitempty"`
}

BatchNotifyResult 批量通知中单条结果

type Notify

type Notify struct {
	log.Log
	// contains filtered or unexported fields
}

Notify 通知模块

func New

func New(ctx *config.Context) *Notify

New 创建 Notify 实例

func (*Notify) Route

func (n *Notify) Route(r *wkhttp.WKHttp)

Route 路由配置

type NotifyReq

type NotifyReq struct {
	SpaceID  string                 `json:"space_id" binding:"required"`
	Service  string                 `json:"service" binding:"required"`
	Event    string                 `json:"event"`
	Targets  []string               `json:"targets" binding:"required"`
	ActorUID string                 `json:"actor_uid"`
	Payload  map[string]interface{} `json:"payload" binding:"required"`
}

NotifyReq 通知请求

type NotifyResp

type NotifyResp struct {
	Delivered []string          `json:"delivered"`
	Filtered  map[string]string `json:"filtered"`
}

NotifyResp 单条通知响应

Jump to

Keyboard shortcuts

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