Documentation
¶
Index ¶
- Constants
- type AuthArgs
- type AuthReply
- type CreateMqArgs
- type CreateMqReply
- type DeleteMqArgs
- type DeleteMqReply
- type Mq
- type MqActiveArgs
- type MqActiveReply
- type MqDeleteArgs
- type MqDeleteReply
- type MqDropArgs
- type MqDropReply
- type MqPopArgs
- type MqPopReply
- type MqPushArgs
- type MqPushReply
- type MqRPC
- type MqReadArgs
- type MqReadReply
- type Msg
- type PingArgs
- type PingReply
Constants ¶
View Source
const ( MqRpcName = "MqRpc" AUTH = MqRpcName + ".Auth" CREATE_MQ = MqRpcName + ".CreateMq" DELETE_MQ = MqRpcName + ".DeleteMq" PUSH = MqRpcName + ".Push" READ = MqRpcName + ".Read" POP = MqRpcName + ".Pop" DELETE = MqRpcName + ".Delete" DROP = MqRpcName + ".Drop" ACTIVE = MqRpcName + ".Active" PING = MqRpcName + ".Ping" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CreateMqArgs ¶
type CreateMqArgs struct {
Mq string
}
type CreateMqReply ¶
type CreateMqReply struct{}
type DeleteMqArgs ¶
type DeleteMqArgs struct {
Mq string
}
type DeleteMqReply ¶
type DeleteMqReply struct{}
type Mq ¶
type Mq interface {
// 创建队列
CreateMq(mq string) (err error)
// 删除队列
DeleteMq(mq string) (err error)
// 向队列里添加消息
Push(mq string, msg string) (id uint64, err error)
// 读取指定条数消息,并设置超时时间
// 在时间范围内,消息不能再次被读取
// 如果超出时间范围没有将消息删除或归档,消息会在下次被读取
Read(mq string, num int, timeout time.Duration) (msgs []Msg, err error)
// 从队列中读取指定条数消息
// 并在队列中删除消息
Pop(mq string, num int) (msgs []Msg, err error)
// 从队列中删除指定消息
Delete(mq string, id uint64) (err error)
// 清空队列
Drop(mq string) (err error)
// 将消息存档
Active(mq string, id uint64) (err error)
}
type MqActiveArgs ¶
type MqActiveReply ¶
type MqActiveReply struct{}
type MqDeleteArgs ¶
type MqDeleteReply ¶
type MqDeleteReply struct{}
type MqDropArgs ¶
type MqDropArgs struct {
Mq string
}
type MqDropReply ¶
type MqDropReply struct{}
type MqPopReply ¶
type MqPopReply struct {
Msgs []Msg
}
type MqPushArgs ¶
type MqPushReply ¶
type MqPushReply struct {
Id uint64
}
type MqRPC ¶
type MqRPC interface {
Auth(args AuthArgs, reply *AuthReply) (err error)
CreateMq(args CreateMqArgs, reply *CreateMqReply) (err error)
DeleteMq(args DeleteMqArgs, reply *DeleteMqReply) (err error)
Push(args MqPushArgs, reply *MqPushReply) (err error)
Read(args MqReadArgs, reply *MqReadReply) (err error)
Pop(args MqPopArgs, reply *MqPopReply) (err error)
Delete(args MqDeleteArgs, reply *MqDeleteReply) (err error)
Drop(args MqDropArgs, reply *MqDropReply) (err error)
Active(args MqActiveArgs, reply *MqActiveReply) (err error)
Ping(PingArgs, *PingReply) (err error)
}
type MqReadReply ¶
type MqReadReply struct {
Msgs []Msg
}
Click to show internal directories.
Click to hide internal directories.