Documentation
¶
Index ¶
- Constants
- type CreateMqArgs
- type CreateMqReply
- type DeleteMqArgs
- type DeleteMqReply
- type Mq
- type MqActiveArgs
- type MqActiveReply
- type MqDeleteArgs
- type MqDeleteKeyValueArgs
- type MqDeleteKeyValueReply
- type MqDeleteReply
- type MqDropArgs
- type MqDropReply
- type MqGetKeyValueArgs
- type MqGetKeyValueReply
- type MqLenArgs
- type MqLenReply
- type MqPopArgs
- type MqPopReply
- type MqPushArgs
- type MqPushReply
- type MqRPC
- type MqReadArgs
- type MqReadReply
- type MqSetKeyValueArgs
- type MqSetKeyValueReply
- type Msg
- type PingArgs
- type PingReply
- type Value
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" LEN = MqRpcName + ".Len" SET_KEY_VALUE = MqRpcName + ".SetKeyValue" GET_KEY_VALUE = MqRpcName + ".GetKeyValue" DELETE_KEY_VALUE = MqRpcName + ".DeleteKeyValue" )
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) // 获取队列长度 Len(mq string) (int, error) // 设置键值对 SetKeyValue(mq string, key string, value string, expire time.Duration) (err error) GetKeyValue(mq string, key string) (value *Value, ok bool, err error) DeleteKeyValue(mq string, key string) (err error) }
type MqActiveArgs ¶
type MqActiveReply ¶
type MqActiveReply struct{}
type MqDeleteArgs ¶
type MqDeleteKeyValueArgs ¶ added in v0.0.2
type MqDeleteKeyValueReply ¶ added in v0.0.2
type MqDeleteKeyValueReply struct{}
type MqDeleteReply ¶
type MqDeleteReply struct{}
type MqDropArgs ¶
type MqDropArgs struct {
Mq string
}
type MqDropReply ¶
type MqDropReply struct{}
type MqGetKeyValueArgs ¶ added in v0.0.2
type MqGetKeyValueReply ¶ added in v0.0.2
type MqLenReply ¶ added in v0.0.2
type MqLenReply struct {
Len int
}
type MqPopReply ¶
type MqPopReply struct {
Msgs []Msg
}
type MqPushArgs ¶
type MqPushReply ¶
type MqPushReply struct {
Id uint64
}
type MqRPC ¶
type MqRPC interface { 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) Len(args MqLenArgs, reply *MqLenReply) (err error) SetKeyValue(args MqSetKeyValueArgs, reply *MqSetKeyValueReply) (err error) GetKeyValue(args MqGetKeyValueArgs, reply *MqGetKeyValueReply) (err error) DeleteKeyValue(args MqDeleteKeyValueArgs, reply *MqDeleteKeyValueReply) (err error) Ping(PingArgs, *PingReply) (err error) }
type MqReadReply ¶
type MqReadReply struct {
Msgs []Msg
}
type MqSetKeyValueArgs ¶ added in v0.0.2
type MqSetKeyValueReply ¶ added in v0.0.2
type MqSetKeyValueReply struct{}
Click to show internal directories.
Click to hide internal directories.