CoreNats

package
v5.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(url string) (err error)

func Push

func Push(topic string, data []byte) (err error)

Push 发布消息

func PushData

func PushData(topic string, action string, id int64, mark string, data interface{}) (err error)

PushData 发送数据包

func PushDataNoErr

func PushDataNoErr(topic string, action string, id int64, mark string, data interface{})

PushDataNoErr 发送数据包无错误

func PushJson

func PushJson(topic string, data interface{}) (err error)

PushJson 发送json数据包

func PushJsonNoErr

func PushJsonNoErr(topic string, data interface{})

func ReflectData

func ReflectData(mapData interface{}, rawData interface{}) (err error)

ReflectData 反射结构体

func ReflectDataByte

func ReflectDataByte(mapData []byte, rawData interface{}) (err error)

ReflectDataByte 反射结构体

func SetSubPrefix

func SetSubPrefix(prefix string)

SetSubPrefix 设置全局订阅前缀

func Sub

func Sub(topic string, cb func(msg *nats.Msg)) (err error)

Sub 订阅消息

func SubData

func SubData(topic string, cb func(msg *nats.Msg, action string, id int64, mark string, data interface{})) (err error)

SubData 订阅数据包

func SubDataByte

func SubDataByte(topic string, cb func(msg *nats.Msg, action string, id int64, mark string, data []byte)) (err error)

SubDataByte 订阅数据包

func SubDataByteNoErr

func SubDataByteNoErr(topic string, cb func(msg *nats.Msg, action string, id int64, mark string, data []byte))

SubDataByteNoErr 订阅数据包

Types

This section is empty.

Jump to

Keyboard shortcuts

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