Versions in this module Expand all Collapse all v1 v1.0.4 Feb 19, 2024 v1.0.3 Feb 14, 2024 v1.0.2 Feb 8, 2024 Changes in this version + const GlobalMidIncrementKey + func InitBus() + func Push() + type EventBus struct + Bus sync.Map + var Bus *EventBus + func (bus *EventBus) AddTopics(userKey string, topics ...string) + func (bus *EventBus) GetEventChannel(userKey string) *EventChannel + func (bus *EventBus) PubByTopic(topic string, params []byte) + func (bus *EventBus) PubByUser(userKey string, params []byte) + func (bus *EventBus) RemoveTopics() + func (bus *EventBus) Sub(userKey string, topic *EventChannel) *EventChannel + type EventChannel struct + func NewTopic() *EventChannel + func (c *EventChannel) Chan() chan *EventData + type EventData struct + func NewEventData(data []byte) *EventData + func NewParams(params []byte) *EventData + func (c *EventData) GetData() []byte + type EventMonitorItem interface + ProgramID func() string + Send func(topic ...string) error + Type func() string + type IMessage interface + GetBytes func() []byte + GetData func() string + GetId func() uint64 + GetMethod func() string + type Item interface + MsgSubType func() string + MsgType func() string + PubBus func() + Set func(k, v string) + Updates func() error + type JsonBase struct + From string + JWT interface{} + Method string + Origin string + PlatFormId string + RemoteIP string + To string + Zone int + type JsonBody struct + Data string + type JsonError struct + Code uint64 + Data interface{} + Message string + type JsonMsg struct + func AbleJsonMsg() *JsonMsg + func (m *JsonMsg) GetId() uint64 + func (m *JsonMsg) GetMessage() []byte + func (m *JsonMsg) GetParams() interface{} + func (m *JsonMsg) GetRequest() *JsonRequest + func (m *JsonMsg) PackDecode(buf []byte, value interface{}) error + func (m *JsonMsg) PackEncode() []byte + func (m *JsonMsg) SetMessage(option *MsgOptions) + type JsonNotify struct + Id uint64 + KeepaliveTime time.Duration + Operator MessageOperator + ProgramID string + SubType MessageSub + Timestamp int64 + Type MessageType + type JsonParams struct + Params interface{} + type JsonRequest struct + ID uint64 + type Message struct + Able T + MqRabbit *mq.RabbitMQ + MqRedis *redis.Client + Opts *MsgOptions + func NewMessage[T MsgAble](able T, opts ...MsgOption) *Message[T] + func (m *Message[T]) GetBytes() []byte + func (m *Message[T]) GetData() string + func (m *Message[T]) GetId() uint64 + func (m *Message[T]) GetMethod() string + func (m *Message[T]) Pack() + func (m *Message[T]) ProgramID() string + func (m *Message[T]) RabbitMq(conf *gofkConf.MqConfig) + func (m *Message[T]) RedisMq(conf *gofkConf.RedisConfig) + func (m *Message[T]) Send(topic ...string) error + func (m *Message[T]) Type() string + func (m *Message[T]) UnPackFromBytes(msg []byte) *Message[T] + type MessageOperator string + const AddIncrement + const EditIncrement + const QueryOperator + type MessageSub string + type MessageType string + const DataResponse + const DataSync + const MonitorHeartBeat + const WebSocketKeepalive + type MsgAble interface + type MsgOption func(options *MsgOptions) + func WithId(id uint64) MsgOption + func WithJsonNotify(notify *JsonNotify) MsgOption + func WithMethod(method string) MsgOption + func WithParams(params interface{}) MsgOption + func WithRequest(request *JsonRequest) MsgOption + type MsgOptions struct + Id uint64 + type PackageMsg interface + GetMessage func() []byte + PackDecode func(data []byte, value interface{}) error + PackEncode func() []byte + SetMessage func(options *MsgOptions) + type Subject interface + EventUp func() error + NotifyUp func() error + type XMLBody struct + Items []struct{ ... } + type XMLHeader struct + Id uint64 + Operator string + SubType string + Type string + type XMLMsg struct + Body *XMLBody + Head *XMLHeader + XMLName xml.Name + func AbleXmlMsg() *XMLMsg + func (m *XMLMsg) GetMessage() []byte + func (m *XMLMsg) Marshal() []byte + func (m *XMLMsg) PackDecode(data []byte, value interface{}) error + func (m *XMLMsg) PackEncode() []byte + func (m *XMLMsg) SetMessage(option *MsgOptions) + func (m *XMLMsg) UnMarshal(buf []byte) (PackageMsg, error)