event

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// GroupCreate 群创建
	GroupCreate string = "group.create"
	// GroupUnableAddDestroyAccount 无法添加注销账号到群聊
	GroupUnableAddDestroyAccount string = "group.unable.add.destroy.account"
	// GroupUpdate 群更新
	GroupUpdate string = "group.update"
	// GroupMemberAdd 群成员添加
	GroupMemberAdd string = "group.memberadd"
	// GroupMemberScanJoin 扫码加入群
	GroupMemberScanJoin string = "group.member.scan.join"
	// GroupMemberTransferGrouper 转让群主
	GroupMemberTransferGrouper string = "group.member.transfer.grouper"
	// GroupAvatarUpdate 群头像更新
	GroupAvatarUpdate string = "group.avatar.update"
	// GroupMemberRemove 群成员移除
	GroupMemberRemove string = "group.memberremove"
	// GroupDisband 群解散
	GroupDisband string = "group.disband"
	// FriendApply 好友申请
	FriendApply string = "friend.apply"
	// GroupMemberInviteRequest 群邀请请求
	GroupMemberInviteRequest string = "group.member.invite"
	// ConversationDelete 删除最近会话
	ConversationDelete string = "conversation.delete"
	// EventUserRegister 用户注册
	EventUserRegister string = "user.register"
	// EventUserPublishMoment 用户发布动态
	EventUserPublishMoment string = "moment.publish"
	// EventUserDeleteMoment 用户删除动态
	EventUserDeleteMoment string = "moment.delete"
	// FriendSure 好友确认
	FriendSure string = "friend.sure"
	// FriendDelete 好友删除
	FriendDelete string = "friend.delete"
	// OrgOrDeptCreate 组织货部门创建
	OrgOrDeptCreate string = "organization_department.create"
	// OrgOrDeptEmployeeUpdate 组织或部门员工更改
	OrgOrDeptEmployeeUpdate string = "organization_department.employee.update"
	// OrgEmployeeExit 组织成员退出
	OrgEmployeeExit string = "organization.employee.exit"
	// EventUpdateSearchMessage 修改搜索消息内容
	EventUpdateSearchMessage string = "message.update.search.data"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

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

DB 事件的db

func NewDB

func NewDB(session *dbr.Session) *DB

NewDB 创建DB

func (*DB) InsertTx

func (d *DB) InsertTx(m *Model, tx *dbr.Tx) (int64, error)

InsertTx 插入事件

func (*DB) QueryAllWait

func (d *DB) QueryAllWait(limit uint64) ([]*Model, error)

QueryAllWait 查询所有等待事件

func (*DB) QueryWithID

func (d *DB) QueryWithID(id int64) (*Model, error)

QueryWithID 根据id查询事件

func (*DB) UpdateStatus

func (d *DB) UpdateStatus(reason string, status int, versionLock int64, id int64) error

UpdateStatus 更新事件状态

type Event

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

Event 事件

func New

func New(ctx *config.Context) *Event

New 创建一个事件

func (*Event) Begin

func (e *Event) Begin(data *et.Data, tx *dbr.Tx) (int64, error)

Begin 开启事件

func (*Event) Commit

func (e *Event) Commit(eventID int64)

Commit 提交事件

func (*Event) EventTimerPush

func (e *Event) EventTimerPush()

EventTimerPush 定时发布事件

func (*Event) Support

func (e *Event) Support(typ int) bool

Support 是否支持的事件类型

type Handler

type Handler func(model *Model)

Handler 事件处理者

type Model

type Model struct {
	Event       string // 事件标示
	Type        int    // 事件类型
	Data        string // 事件数据
	Status      int    // 事件状态 0.待发布 1.已发布 2.发布失败!
	Reason      string // 原因 如果状态为2,则有发布失败的原因
	VersionLock int64  // 乐观锁
	db.BaseModel
}

Model 数据库对象

Jump to

Keyboard shortcuts

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