sdk

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MqClient

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

func ConnectMq

func ConnectMq(ctx context.Context, addr string, safe bool, auth string) (*MqClient, error)

func (*MqClient) Active

func (m *MqClient) Active(mq string, id uint64) (err error)

将消息存档

func (*MqClient) CreateMq

func (m *MqClient) CreateMq(mq string) (err error)

创建队列

func (*MqClient) Delete

func (m *MqClient) Delete(mq string, id uint64) (err error)

从队列中删除指定消息

func (*MqClient) DeleteKeyValue added in v0.0.2

func (m *MqClient) DeleteKeyValue(mq string, key string) (err error)

func (*MqClient) DeleteMq

func (m *MqClient) DeleteMq(mq string) (err error)

删除队列

func (*MqClient) Drop

func (m *MqClient) Drop(mq string) (err error)

清空队列

func (*MqClient) GetKeyValue added in v0.0.2

func (m *MqClient) GetKeyValue(mq string, key string) (value *definition.Value, ok bool, err error)

func (*MqClient) Len added in v0.0.2

func (m *MqClient) Len(mq string) (int, error)

获取队列长度

func (*MqClient) Ping

func (m *MqClient) Ping() (err error)

func (*MqClient) Pop

func (m *MqClient) Pop(mq string, num int) (msgs []definition.Msg, err error)

从队列中读取指定条数消息 并在队列中删除消息

func (*MqClient) Push

func (m *MqClient) Push(mq string, msg string) (id uint64, err error)

向队列里添加消息

func (*MqClient) Read

func (m *MqClient) Read(mq string, num int, timeout time.Duration) (msgs []definition.Msg, err error)

读取指定条数消息,并设置超时时间 在时间范围内,消息不能再次被读取 如果超出时间范围没有将消息删除或归档,消息会在下次被读取

func (*MqClient) SetKeyValue added in v0.0.2

func (m *MqClient) SetKeyValue(mq string, key string, value string, expire time.Duration) (err error)

设置键值对

Jump to

Keyboard shortcuts

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