event

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2025 License: MIT Imports: 3 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// MenuChangeEventName 菜单变更事件
	MenuChangeEventName = "menu_change_events"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action uint8
const (
	// CREATE 创建动作,比如 ADMIN 超级管理员自动权限录入
	// TODO 拥有根菜单权限录入
	CREATE Action = 1
	// WRITE 写入动作
	WRITE Action = 2
	// DELETE 全部删除、重新录入数据
	DELETE Action = 3
)

func (Action) ToUint8

func (s Action) ToUint8() uint8

type Endpoint

type Endpoint struct {
	Path     string `json:"path"`
	Resource string `json:"resource"`
	Method   string `json:"method"`
}
type Menu struct {
	Id        int64      `json:"id"`
	Endpoints []Endpoint `json:"endpoints"`
}
type MenuChangeEventProducer interface {
	Produce(ctx context.Context, evt MenuEvent) error
}

func NewMenuChangeEventProducer

func NewMenuChangeEventProducer(q mq.MQ) (MenuChangeEventProducer, error)
type MenuEvent struct {
	Menu   Menu   `json:"menu"`
	Action Action `json:"action"`
}

Jump to

Keyboard shortcuts

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