Versions in this module Expand all Collapse all v1 v1.0.10 Oct 7, 2023 v1.0.9 Oct 7, 2023 v1.0.8 Sep 26, 2023 v1.0.7 Sep 17, 2023 v1.0.6 Sep 13, 2023 v1.0.5 Sep 11, 2023 v1.0.4 Sep 10, 2023 v1.0.3 Sep 8, 2023 v1.0.2 Sep 7, 2023 Changes in this version type ChatMessage + func NewChatMessage() *ChatMessage type ChatMessageBody + func NewChatMessageBody() *ChatMessageBody v1.0.1 Sep 6, 2023 v1.0.0 Sep 6, 2023 Changes in this version + const ChannelChatMessage + const ChannelNotify + const PayloadTypeChatMessage + const PayloadTypeFriendInvite + func DefaultPubsuber() *pubsuber + func Init(cfg config.Config) error + func NewSubscriber() *subscriber + func PublishChatMessage(ctx context.Context, data *ChatMessage) error + func PublishNotifyMessage(ctx context.Context, typ string, data any) error + func PublishWithPayload(ctx context.Context, channel, typ string, data any) error + type ChatMessage struct + ActionID string + Body ChatMessageBody + CreatedAt int64 + MessageID int64 + PublishTargets []int64 + ReceiverID int64 + SenderID int64 + SessionType int + Type int + type ChatMessageBody struct + Format string + Latitude string + LocationLabel string + Longitude string + Scale float64 + Size string + Src string + Text string + type FriendInvite struct + CreatedAt time.Time + ID int64 + Note string + Reply string + Status int + TargetID int64 + UserID int64 + type Payload struct + Channel string + Data string + Type string + func (p *Payload) MarshalBinary() (data []byte, err error) + func (p *Payload) UnmarshalBinary(data []byte) error + func (p *Payload) UnmarshalData(dest any) error + type SubscribeHandlerFunc func(context.Context, *Payload)