Documentation
¶
Index ¶
- Variables
- type Message
- func (m *Message) CreatedAt() time.Time
- func (m *Message) Events() []pubsub.Event
- func (m *Message) ID() string
- func (m *Message) MarshalJSON() ([]byte, error)
- func (m *Message) Metadata() Metadata
- func (m *Message) PublishedAt() time.Time
- func (m *Message) Restore(memento *MessageMemento) (*Message, error)
- func (m *Message) RoomID() string
- func (m *Message) Text() string
- func (m *Message) UnmarshalJSON(data []byte) error
- func (m *Message) UserID() string
- type MessageMemento
- type MessageOptions
- type Metadata
- type Storage
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrInvalidMessageID = errors.New("invalid message id") ErrInvalidRoomID = errors.New("invalid room id") ErrInvalidUserID = errors.New("invalid user id") ErrInvalidText = errors.New("invalid text") ErrInvalidMetadata = errors.New("invalid metadata") ErrInvalidCreatedAt = errors.New("invalid created at") ErrInvalidPublishedAt = errors.New("invalid published at") ErrInvalidMessage = errors.New("invalid message") ErrMessageNotFound = errors.New("message not found") )
Functions ¶
This section is empty.
Types ¶
type Message ¶
type Message struct {
// contains filtered or unexported fields
}
func NewMessage ¶
func (*Message) MarshalJSON ¶
func (*Message) PublishedAt ¶
func (*Message) UnmarshalJSON ¶
type MessageMemento ¶
type MessageOptions ¶
type MessageOptions func(*Message)
func WithMetadata ¶
func WithMetadata(metadata Metadata) MessageOptions
func WithPublishedAt ¶
func WithPublishedAt(publishedAt time.Time) MessageOptions
Click to show internal directories.
Click to hide internal directories.