Documentation
¶
Overview ¶
Package messagebroker provides the message broker implementation of the Yorkie.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrEmptyAddress is returned when the address is empty. ErrEmptyAddress = errors.New("address cannot be empty") // ErrEmptyTopic is returned when the topic is empty. ErrEmptyTopic = errors.New("topic cannot be empty") // ErrInvalidDuration is returned when the duration is invalid. ErrInvalidDuration = errors.New("invalid duration") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Addresses string `yaml:"Addresses"` Topic string `yaml:"Topic"` WriteTimeout string `yaml:"WriteTimeout"` }
Config is the configuration for creating a message broker instance.
func (*Config) MustParseWriteTimeout ¶
MustParseWriteTimeout parses the write timeout and returns the duration.
func (*Config) SplitAddresses ¶
SplitAddresses splits the addresses by comma.
type DummyBroker ¶
type DummyBroker struct{}
DummyBroker is a dummy broker that does nothing. It is used when the message broker is not configured.
type KafkaBroker ¶
type KafkaBroker struct {
// contains filtered or unexported fields
}
KafkaBroker is a producer for Kafka.
type UserEventMessage ¶
type UserEventMessage struct { ProjectID string `json:"project_id"` EventType events.ClientEventType `json:"event_type"` UserID string `json:"user_id"` Timestamp time.Time `json:"timestamp"` UserAgent string `json:"user_agent"` }
UserEventMessage represents a message for user events
func (UserEventMessage) Marshal ¶
func (m UserEventMessage) Marshal() ([]byte, error)
Marshal marshals the user event message to JSON.
Click to show internal directories.
Click to hide internal directories.