chat

package
v0.7.4 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2021 License: BSD-3-Clause Imports: 5 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

Overview

Code generated by go generate; DO NOT EDIT. This file was generated at 2021-01-15 23:18:16.599746 -0800 PST m=+0.001241195

Code generated by go generate; DO NOT EDIT. This file was generated at 2021-01-30 11:07:14.593507 -0800 PST m=+0.001205313

Code generated by go generate; DO NOT EDIT. This file was generated at 2021-01-30 11:27:48.039104 -0800 PST m=+0.001821984

Code generated by go generate; DO NOT EDIT. This file was generated at 2021-01-15 23:18:17.029174 -0800 PST m=+0.003738011

Code generated by go generate; DO NOT EDIT. This file was generated at 2021-01-30 11:08:57.46043 -0800 PST m=+0.001705489

Code generated by go generate; DO NOT EDIT. This file was generated at 2021-01-30 11:29:08.177616 -0800 PST m=+0.001769886

Code generated by go generate; DO NOT EDIT. This file was generated at 2021-01-15 23:18:17.37513 -0800 PST m=+0.005275011

Index

Constants

This section is empty.

Variables

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

RestrictedWords contains restricted words not allowed in this example chat application.

Functions

func BindEvents

func BindEvents(binder rangedb.EventBinder)

func New

New constructs a new CQRS chat application that accepts commands to be dispatched.

func NewRoom

func NewRoom() *room

NewRoom constructs a new cqrs.Aggregate.

func NewUser

func NewUser() *user

NewUser constructs a new cqrs.Aggregate.

func NewWarnedUsersProjection added in v0.5.0

func NewWarnedUsersProjection() *warnedUsersProjection

NewWarnedUsersProjection constructs a projection for tracking the number of warnings by user.

Types

type BanUserFromRoom added in v0.5.0

type BanUserFromRoom struct {
	RoomID  string `json:"roomID"`
	UserID  string `json:"userID"`
	Reason  string `json:"reason"`
	Timeout uint   `json:"timeout"`
}

func (BanUserFromRoom) AggregateID added in v0.5.0

func (c BanUserFromRoom) AggregateID() string

func (BanUserFromRoom) AggregateType added in v0.5.0

func (c BanUserFromRoom) AggregateType() string

func (BanUserFromRoom) CommandType added in v0.5.0

func (c BanUserFromRoom) CommandType() string

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 RemoveUserFromRoom added in v0.5.0

type RemoveUserFromRoom struct {
	RoomID string `json:"roomID"`
	UserID string `json:"userID"`
	Reason string `json:"reason"`
}

func (RemoveUserFromRoom) AggregateID added in v0.5.0

func (c RemoveUserFromRoom) AggregateID() string

func (RemoveUserFromRoom) AggregateType added in v0.5.0

func (c RemoveUserFromRoom) AggregateType() string

func (RemoveUserFromRoom) CommandType added in v0.5.0

func (c RemoveUserFromRoom) CommandType() 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 UserWasBannedFromRoom added in v0.5.0

type UserWasBannedFromRoom struct {
	RoomID  string `json:"roomID"`
	UserID  string `json:"userID"`
	Reason  string `json:"reason"`
	Timeout uint   `json:"timeout"`
}

func (UserWasBannedFromRoom) AggregateID added in v0.5.0

func (e UserWasBannedFromRoom) AggregateID() string

func (UserWasBannedFromRoom) AggregateType added in v0.5.0

func (e UserWasBannedFromRoom) AggregateType() string

func (UserWasBannedFromRoom) EventType added in v0.5.0

func (e UserWasBannedFromRoom) EventType() 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

type UserWasRemovedFromRoom added in v0.5.0

type UserWasRemovedFromRoom struct {
	RoomID string `json:"roomID"`
	UserID string `json:"userID"`
	Reason string `json:"reason"`
}

func (UserWasRemovedFromRoom) AggregateID added in v0.5.0

func (e UserWasRemovedFromRoom) AggregateID() string

func (UserWasRemovedFromRoom) AggregateType added in v0.5.0

func (e UserWasRemovedFromRoom) AggregateType() string

func (UserWasRemovedFromRoom) EventType added in v0.5.0

func (e UserWasRemovedFromRoom) EventType() string

type UserWasWarned added in v0.5.0

type UserWasWarned struct {
	UserID string `json:"userID"`
	Reason string `json:"reason"`
}

func (UserWasWarned) AggregateID added in v0.5.0

func (e UserWasWarned) AggregateID() string

func (UserWasWarned) AggregateType added in v0.5.0

func (e UserWasWarned) AggregateType() string

func (UserWasWarned) EventType added in v0.5.0

func (e UserWasWarned) EventType() string

type WarnUser added in v0.5.0

type WarnUser struct {
	UserID string `json:"userID"`
	Reason string `json:"reason"`
}

func (WarnUser) AggregateID added in v0.5.0

func (c WarnUser) AggregateID() string

func (WarnUser) AggregateType added in v0.5.0

func (c WarnUser) AggregateType() string

func (WarnUser) CommandType added in v0.5.0

func (c WarnUser) CommandType() string

Jump to

Keyboard shortcuts

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