CoreNats

package
v5.2.20 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 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(serviceCode string, topic string, data []byte) (err error)

Push 发布消息

func PushData

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

PushData 发送数据包

func PushDataNoErr

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

PushDataNoErr 发送数据包无错误

func PushJson

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

PushJson 发送json数据包

func PushJsonNoErr

func PushJsonNoErr(serviceCode string, 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(serviceCode string, topic string, cb func(msg *nats.Msg)) (err error)

Sub 订阅消息

func SubData

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

SubData 订阅数据包

func SubDataByte

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

SubDataByte 订阅数据包

func SubDataByteNoErr

func SubDataByteNoErr(serviceCode string, 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