Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type KafkaConfig ¶
type KafkaConfig struct {
// contains filtered or unexported fields
}
type Message ¶
type Message struct { ID int64 // Unique identifier Content string // Content Done bool // Is this Message done? }
func NewMessage ¶
NewMessage creates a new message given a title, that can't be empty.
type MessageManager ¶
type MessageManager struct { KafkaConfig // contains filtered or unexported fields }
MessageManager manages a list of messages in memory.
var (
DefaultMessageList *MessageManager
)
func NewMessageManager ¶
func NewMessageManager(kafkaConfig KafkaConfig) *MessageManager
NewMessageManager returns an empty MessageManager.
func (*MessageManager) All ¶
func (mm *MessageManager) All() []*Message
All returns the list of all the Messages in the MessageManager.
func (*MessageManager) Find ¶
func (mm *MessageManager) Find(ID int64) (*Message, bool)
Find returns the Message with the given id in the MessageManager and a boolean indicating if the id was found.
func (*MessageManager) Save ¶
func (mm *MessageManager) Save(message *Message) error
Save saves the given Message in the MessageManager.
func (*MessageManager) Send ¶
func (mm *MessageManager) Send(msg *Message) error
Send a message to a Kafka queue. Can return an error.
Click to show internal directories.
Click to hide internal directories.