chat

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 3, 2020 License: BSD-3-Clause Imports: 3 Imported by: 0

README

Chat Application w/ CQRS + Event Sourcing

Example chat application using the RangeDB library for CQRS and Event Sourcing.

Event Model

Chat Event Model

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RestrictedWords = []string{"golly", "dagnabit", "gadzooks"}

Functions

func BindEvents

func BindEvents(binder rangedb.EventBinder)

func New

func NewRoom

func NewRoom() *room

func NewUser

func NewUser() *user

Types

type JoinRoom

type JoinRoom struct {
	RoomID string `json:"roomID"`
	UserID string `json:"userID"`
}

func (JoinRoom) AggregateID

func (c JoinRoom) AggregateID() string

func (JoinRoom) AggregateType

func (c JoinRoom) AggregateType() string

func (JoinRoom) CommandType

func (c JoinRoom) CommandType() string

type MessageWasSentToRoom

type MessageWasSentToRoom struct {
	RoomID  string `json:"roomID"`
	UserID  string `json:"userID"`
	Message string `json:"message"`
}

func (MessageWasSentToRoom) AggregateID

func (e MessageWasSentToRoom) AggregateID() string

func (MessageWasSentToRoom) AggregateType

func (e MessageWasSentToRoom) AggregateType() string

func (MessageWasSentToRoom) EventType

func (e MessageWasSentToRoom) EventType() string

type OnBoardRoom

type OnBoardRoom struct {
	RoomID   string `json:"roomID"`
	UserID   string `json:"userID"`
	RoomName string `json:"roomName"`
}

func (OnBoardRoom) AggregateID

func (c OnBoardRoom) AggregateID() string

func (OnBoardRoom) AggregateType

func (c OnBoardRoom) AggregateType() string

func (OnBoardRoom) CommandType

func (c OnBoardRoom) CommandType() string

type OnBoardUser

type OnBoardUser struct {
	UserID string `json:"userID"`
	Name   string `json:"name"`
}

func (OnBoardUser) AggregateID

func (c OnBoardUser) AggregateID() string

func (OnBoardUser) AggregateType

func (c OnBoardUser) AggregateType() string

func (OnBoardUser) CommandType

func (c OnBoardUser) CommandType() string

type PrivateMessageWasSentToRoom

type PrivateMessageWasSentToRoom struct {
	RoomID       string `json:"roomID"`
	TargetUserID string `json:"userID"`
	Message      string `json:"message"`
}

func (PrivateMessageWasSentToRoom) AggregateID

func (e PrivateMessageWasSentToRoom) AggregateID() string

func (PrivateMessageWasSentToRoom) AggregateType

func (e PrivateMessageWasSentToRoom) AggregateType() string

func (PrivateMessageWasSentToRoom) EventType

func (e PrivateMessageWasSentToRoom) EventType() string

type RoomWasJoined

type RoomWasJoined struct {
	RoomID string `json:"roomID"`
	UserID string `json:"userID"`
}

func (RoomWasJoined) AggregateID

func (e RoomWasJoined) AggregateID() string

func (RoomWasJoined) AggregateType

func (e RoomWasJoined) AggregateType() string

func (RoomWasJoined) EventType

func (e RoomWasJoined) EventType() string

type RoomWasOnBoarded

type RoomWasOnBoarded struct {
	RoomID   string `json:"roomID"`
	UserID   string `json:"userID"`
	RoomName string `json:"roomName"`
}

func (RoomWasOnBoarded) AggregateID

func (e RoomWasOnBoarded) AggregateID() string

func (RoomWasOnBoarded) AggregateType

func (e RoomWasOnBoarded) AggregateType() string

func (RoomWasOnBoarded) EventType

func (e RoomWasOnBoarded) EventType() string

type SendMessageToRoom

type SendMessageToRoom struct {
	RoomID  string `json:"roomID"`
	UserID  string `json:"userID"`
	Message string `json:"message"`
}

func (SendMessageToRoom) AggregateID

func (c SendMessageToRoom) AggregateID() string

func (SendMessageToRoom) AggregateType

func (c SendMessageToRoom) AggregateType() string

func (SendMessageToRoom) CommandType

func (c SendMessageToRoom) CommandType() string

type SendPrivateMessageToRoom

type SendPrivateMessageToRoom struct {
	RoomID       string `json:"roomID"`
	TargetUserID string `json:"userID"`
	Message      string `json:"message"`
}

func (SendPrivateMessageToRoom) AggregateID

func (c SendPrivateMessageToRoom) AggregateID() string

func (SendPrivateMessageToRoom) AggregateType

func (c SendPrivateMessageToRoom) AggregateType() string

func (SendPrivateMessageToRoom) CommandType

func (c SendPrivateMessageToRoom) CommandType() string

type UserWasOnBoarded

type UserWasOnBoarded struct {
	UserID string `json:"userID"`
	Name   string `json:"name"`
}

func (UserWasOnBoarded) AggregateID

func (e UserWasOnBoarded) AggregateID() string

func (UserWasOnBoarded) AggregateType

func (e UserWasOnBoarded) AggregateType() string

func (UserWasOnBoarded) EventType

func (e UserWasOnBoarded) EventType() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL