executor

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//KeyPrefixStateDB state db key必须前缀
	KeyPrefixStateDB = "mavl-chat-"
	//KeyPrefixLocalDB local db的key必须前缀
	KeyPrefixLocalDB = "LODB-chat-"
)

Functions

func CheckFieldName

func CheckFieldName(fd string) bool

func CheckLevel

func CheckLevel(lv string) bool

func GenerateGroupId

func GenerateGroupId(groups []*chattypes.ServerGroup) (string, error)

func GetName

func GetName() string

GetName get driver name

func Init

func Init(name string, cfg *types.Chain33Config, sub []byte)

Init 重命名执行器名称

func InitExecType

func InitExecType()

InitExecType Init Exec Type

func NewChat

func NewChat() drivers.Driver

func NowMillionSecond

func NowMillionSecond() int64

Types

type Action

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

Action 具体动作执行

func NewAction

func NewAction(Chat *Chat, tx *types.Transaction, index int) *Action

NewAction 生成Action对象

func (*Action) UpdateBlackList

func (action *Action) UpdateBlackList(send *chattypes.UpdateBlackList) (*types.Receipt, error)

UpdateBlackList 更新黑名单信息

func (*Action) UpdateFriend

func (action *Action) UpdateFriend(send *chattypes.UpdateFriends) (*types.Receipt, error)

UpdateFriend 更新好友信息

func (*Action) UpdateServerGroup

func (action *Action) UpdateServerGroup(send *chattypes.UpdateServerGroups) (*types.Receipt, error)

UpdateBlackList 更新黑名单信息

func (*Action) UpdateUser

func (action *Action) UpdateUser(send *chattypes.UpdateFields) (*types.Receipt, error)

UpdateFriend 更新好友信息

type ByIdGroup

type ByIdGroup []*chattypes.ServerGroup

func (ByIdGroup) Compare

func (g ByIdGroup) Compare(i int, val interface{}) int

func (ByIdGroup) Len

func (g ByIdGroup) Len() int

func (ByIdGroup) Less

func (g ByIdGroup) Less(i, j int) bool

func (ByIdGroup) Swap

func (g ByIdGroup) Swap(i, j int)

type Chat

type Chat struct {
	drivers.DriverBase
}

func (*Chat) ExecDelLocal

func (c *Chat) ExecDelLocal(tx *types.Transaction, receipt *types.ReceiptData, index int) (*types.LocalDBSet, error)

ExecDelLocal 回退自动删除,重写基类

func (*Chat) ExecLocal_Black

func (c *Chat) ExecLocal_Black(payload *chattypes.UpdateBlackList, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

func (*Chat) ExecLocal_Update

func (c *Chat) ExecLocal_Update(payload *chattypes.UpdateFriends, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

func (*Chat) ExecLocal_UpdateServerGroup

func (c *Chat) ExecLocal_UpdateServerGroup(payload *chattypes.UpdateServerGroups, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

func (*Chat) ExecLocal_UpdateUser

func (c *Chat) ExecLocal_UpdateUser(payload *chattypes.UpdateFields, tx *types.Transaction, receiptData *types.ReceiptData, index int) (*types.LocalDBSet, error)

func (*Chat) Exec_Black

func (c *Chat) Exec_Black(payload *chattypes.UpdateBlackList, tx *types.Transaction, index int) (*types.Receipt, error)

func (*Chat) Exec_Update

func (c *Chat) Exec_Update(payload *chattypes.UpdateFriends, tx *types.Transaction, index int) (*types.Receipt, error)

func (*Chat) Exec_UpdateServerGroup

func (c *Chat) Exec_UpdateServerGroup(payload *chattypes.UpdateServerGroups, tx *types.Transaction, index int) (*types.Receipt, error)

func (*Chat) Exec_UpdateUser

func (c *Chat) Exec_UpdateUser(payload *chattypes.UpdateFields, tx *types.Transaction, index int) (*types.Receipt, error)

func (*Chat) GetDriverName

func (c *Chat) GetDriverName() string

func (*Chat) Query_GetBlackList

func (r *Chat) Query_GetBlackList(in *chattypes.ReqGetBlackList) (types.Message, error)

Query_GetBlackList 查询黑名单列表

func (*Chat) Query_GetFriends

func (r *Chat) Query_GetFriends(in *chattypes.ReqGetFriends) (types.Message, error)

Query_GetFriends 查询好友列表

func (*Chat) Query_GetServerGroup

func (r *Chat) Query_GetServerGroup(in *chattypes.ReqGetServerGroup) (types.Message, error)

Query_GetServerGroup 查询服务分组列表

func (*Chat) Query_GetUser

func (r *Chat) Query_GetUser(in *chattypes.ReqGetUser) (types.Message, error)

Query_GetUser 查询用户信息

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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