event

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 3 Imported by: 0

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
	// REWRITE 全部删除、重新录入数据
	REWRITE Action = 3
	// DELETE 全部删除、重新录入数据
	DELETE Action = 4
)

func (Action) ToUint8

func (s Action) ToUint8() uint8

type Endpoint

type Endpoint struct {
	Path   string `json:"path"`
	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