Documentation ¶
Index ¶
- Constants
- type IdleMessageStore
- type KafkaConsumer
- type KafkaMessageStore
- func (k *KafkaMessageStore) Close() error
- func (k *KafkaMessageStore) NextSegmentSequence(id subscription.ChanID, info subscription.ChanInfo) (int64, int64, error)
- func (k *KafkaMessageStore) StoreChannelMessage(ch subscription.ChanID, m *messages.ChatMessage) error
- func (k *KafkaMessageStore) StoreMessage(message *messages.ChatMessage) error
- func (k *KafkaMessageStore) StoreOffline(message *messages.ChatMessage) error
- type MessageStore
- type SubscriptionStore
Constants ¶
View Source
const ( KafkaChatMessageTopic = "getaway_chat_message" KafkaChatOfflineMessageTopic = "getaway_chat_offline_message" KafkaChannelMessageTopic = "gateway_channel_message" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IdleMessageStore ¶
type IdleMessageStore struct { }
func (*IdleMessageStore) StoreMessage ¶
func (i *IdleMessageStore) StoreMessage(*messages.ChatMessage) error
func (*IdleMessageStore) StoreOffline ¶ added in v1.5.0
func (i *IdleMessageStore) StoreOffline(message *messages.ChatMessage) error
type KafkaConsumer ¶ added in v1.6.0
type KafkaConsumer struct {
// contains filtered or unexported fields
}
func NewKafkaConsumer ¶ added in v1.6.0
func NewKafkaConsumer(address []string) (*KafkaConsumer, error)
func (*KafkaConsumer) Close ¶ added in v1.6.0
func (c *KafkaConsumer) Close() error
func (*KafkaConsumer) ConsumeChannelMessage ¶ added in v1.6.0
func (c *KafkaConsumer) ConsumeChannelMessage(cf func(m *messages.ChatMessage))
func (*KafkaConsumer) ConsumeChatMessage ¶ added in v1.6.0
func (c *KafkaConsumer) ConsumeChatMessage(cf func(m *messages.ChatMessage))
func (*KafkaConsumer) ConsumeOfflineMessage ¶ added in v1.6.0
func (c *KafkaConsumer) ConsumeOfflineMessage(cf func(m *messages.ChatMessage))
type KafkaMessageStore ¶ added in v1.6.0
type KafkaMessageStore struct {
// contains filtered or unexported fields
}
func NewKafkaProducer ¶ added in v1.6.0
func NewKafkaProducer(address []string) (*KafkaMessageStore, error)
func (*KafkaMessageStore) Close ¶ added in v1.6.0
func (k *KafkaMessageStore) Close() error
func (*KafkaMessageStore) NextSegmentSequence ¶ added in v1.6.0
func (k *KafkaMessageStore) NextSegmentSequence(id subscription.ChanID, info subscription.ChanInfo) (int64, int64, error)
func (*KafkaMessageStore) StoreChannelMessage ¶ added in v1.6.0
func (k *KafkaMessageStore) StoreChannelMessage(ch subscription.ChanID, m *messages.ChatMessage) error
func (*KafkaMessageStore) StoreMessage ¶ added in v1.6.0
func (k *KafkaMessageStore) StoreMessage(message *messages.ChatMessage) error
func (*KafkaMessageStore) StoreOffline ¶ added in v1.6.0
func (k *KafkaMessageStore) StoreOffline(message *messages.ChatMessage) error
type MessageStore ¶
type MessageStore interface { // StoreMessage stores chat message to database StoreMessage(message *messages.ChatMessage) error StoreOffline(message *messages.ChatMessage) error }
MessageStore is a store for messages, used to store chat messages in messaging.Interface, its many be called multiple times, but only the last updates will be stored.
type SubscriptionStore ¶
type SubscriptionStore interface { // NextSegmentSequence return the next segment of specified channel, and segment length. NextSegmentSequence(id subscription.ChanID, info subscription.ChanInfo) (int64, int64, error) // StoreChannelMessage stores a published message. StoreChannelMessage(ch subscription.ChanID, msg *messages.ChatMessage) error }
Click to show internal directories.
Click to hide internal directories.