Documentation ¶
Index ¶
- Constants
- func HandlerFucAndAck(f func(msgC *MqMsg)) func(msg *nats.Msg)
- func JsHandlerFucAndAck(f func(msgC *JsMqMsg)) func(msg jetstream.Msg)
- func NatsJsClient(url string, jsName string, subjects []string) (*nats.Conn, nats.JetStreamContext, error)
- func NewEncodedNatsClient(url string) (*nats.EncodedConn, error)
- func NewNatsClient(url string) (*nats.Conn, error)
- type DigitalProduceMsg
- type DigitalProduceMsgData
- type JsMqMsg
- type JsMsgHandlerFunc
- type MqMsg
- type MqSub
- type MsgData
- type MsgHandlerFunc
- type Msgs
- type NatJs
- func (n *NatJs) CloseNc()
- func (n *NatJs) CreateOrUpdateConsumer(conName string) (jetstream.Consumer, error)
- func (n *NatJs) Drain()
- func (n *NatJs) Flush()
- func (n *NatJs) JsConsumerSub(conName string, f func(msg *JsMqMsg)) (jetstream.ConsumeContext, error)
- func (n *NatJs) JsConsumerSubStop(c jetstream.ConsumeContext)
- func (n *NatJs) JsPushMessage(subject string, b []byte) error
- func (n *NatJs) JsQueueSub(subject, queue, consumer string, f func(msgC *MqMsg)) (*MqSub, error)
- func (n *NatJs) JsQueueSubSync(subject, queue string) (*MqSub, error)
- func (n *NatJs) PushProduceCallBack(subject string, msgD *ProduceResultMsg) error
- func (n *NatJs) PushProduceMessage(subject string, msgD *DigitalProduceMsg) error
- type NatQueueCon
- func (n *NatQueueCon) CloseNc()
- func (n *NatQueueCon) Drain() error
- func (n *NatQueueCon) Flush() error
- func (n *NatQueueCon) Push(subject string, b []byte) error
- func (n *NatQueueCon) PushMessage(subject string, msgD *Msgs) error
- func (n *NatQueueCon) QueueSub(subject, queue string, f func(msgC *MqMsg)) (*MqSub, error)
- func (n *NatQueueCon) QueueSubSync(subject, queue string) (*MqSub, error)
- func (n *NatQueueCon) Sub(subject string, f func(msgC *MqMsg)) (*MqSub, error)
- func (n *NatQueueCon) SubSync(subject string) (*MqSub, error)
- type ProduceCallbackMsg
- type ProduceResultMsg
- type Receiver
- type SnapShotMap
- type UserMsgUser
Constants ¶
View Source
const ( SourceDigital = 1 SourceDigitalProduce = 2 DigitalProduceSubject = "digital.produce" )
View Source
const ( ChannelTypeEmail = 1 // 邮件 ChannelTypeWebhook = 2 // WebHook ChannelTypeDingDing = 3 // 钉钉 DefaultMessageSubject = "message-service.message" )
Variables ¶
This section is empty.
Functions ¶
func HandlerFucAndAck ¶
func HandlerFucAndAck(f func(msgC *MqMsg)) func(msg *nats.Msg)
func JsHandlerFucAndAck ¶
JsHandlerFucAndAck func(msg Msg)
func NatsJsClient ¶
func NewEncodedNatsClient ¶
func NewNatsClient ¶
Types ¶
type DigitalProduceMsg ¶
type DigitalProduceMsg struct { Source uint8 `json:"source"` // 服务来源类型 1-事件监控系统 2-监控告警系统 3-.... Data []*DigitalProduceMsgData // 发送消息信息 SourceCreateTime time.Time // 消息创建时间 }
type DigitalProduceMsgData ¶
type DigitalProduceMsgData struct { BackgroundUri string `json:"background_uri"` FaceVideo string `json:"face_video"` AudionUri string `json:"audion_uri"` StoryboardId int32 `json:"storyboard_id"` StoryboardSectionId int32 `json:"storyboard_section_id"` Payload string `json:"payload"` }
DigitalProduceMsgData 订阅主题使用的消息
type JsMsgHandlerFunc ¶
type MsgHandlerFunc ¶
type MsgHandlerFunc func(msg *nats.Msg) // 回调处理方法
type Msgs ¶
type NatJs ¶
type NatJs struct { Url string JsName string Subject []string JsCtx nats.JetStreamContext Js jetstream.JetStream Nc *nats.Conn }
func (*NatJs) CreateOrUpdateConsumer ¶
func (*NatJs) JsConsumerSub ¶
func (*NatJs) JsConsumerSubStop ¶
func (n *NatJs) JsConsumerSubStop(c jetstream.ConsumeContext)
func (*NatJs) JsPushMessage ¶
JsPushMessage 发送消息
func (*NatJs) JsQueueSub ¶
JsQueueSub 订阅一个js队列消息
func (*NatJs) JsQueueSubSync ¶
func (*NatJs) PushProduceCallBack ¶
func (n *NatJs) PushProduceCallBack(subject string, msgD *ProduceResultMsg) error
func (*NatJs) PushProduceMessage ¶
func (n *NatJs) PushProduceMessage(subject string, msgD *DigitalProduceMsg) error
PushProduceMessage to ProduceServer 发送生产视频的消息
type NatQueueCon ¶
type NatQueueCon struct { Url string Nc *nats.Conn }
func NewNatsSubPushClient ¶
func NewNatsSubPushClient(url string) (*NatQueueCon, error)
func (*NatQueueCon) CloseNc ¶
func (n *NatQueueCon) CloseNc()
func (*NatQueueCon) Drain ¶
func (n *NatQueueCon) Drain() error
func (*NatQueueCon) Flush ¶
func (n *NatQueueCon) Flush() error
func (*NatQueueCon) PushMessage ¶
func (n *NatQueueCon) PushMessage(subject string, msgD *Msgs) error
PushMessage to MessageService 发送消息
func (*NatQueueCon) QueueSub ¶
func (n *NatQueueCon) QueueSub(subject, queue string, f func(msgC *MqMsg)) (*MqSub, error)
QueueSub 订阅一个队列消息
func (*NatQueueCon) QueueSubSync ¶
func (n *NatQueueCon) QueueSubSync(subject, queue string) (*MqSub, error)
QueueSubSync 订阅一个js队列消息
type ProduceCallbackMsg ¶
type ProduceResultMsg ¶
type ProduceResultMsg struct { Source uint8 `json:"source"` // 服务来源类型 1-事件监控系统 2-监控告警系统 3-.... Data *ProduceCallbackMsg // 发送消息信息 SourceCreateTime time.Time // 消息创建时间 }
type SnapShotMap ¶
type UserMsgUser ¶
Click to show internal directories.
Click to hide internal directories.