domain

package
v0.0.0-...-40fc3ee Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2019 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chat

type Chat struct {
	ID        bson.ObjectId            `json:"_id" bson:"_id"`
	Messages  []Message                `json:"messages" bson:"messages"`
	Observers map[string]chan *Message `json:"observers" bson:"observers"`
	StartDate time.Time                `json:"startdate" bson:"startdate"`
	EndDate   time.Time                `json:"enddate" bson:"enddate"`
}

Chat is a conversation object that has datatypes for the chat domain (Chat)

func NewChat

func NewChat(messages []Message) *Chat

NewChat creates a new Chat!

type Message

type Message struct {
	ID         bson.ObjectId `json:"_id" bson:"_id"`
	Sender     bson.ObjectId `json:"sender" bson:"sender"`
	Receiver   bson.ObjectId `json:"receiver" bson:"receiver"`
	Type       string        `json:"type" bson:"type"`
	Text       string        `json:"text" bson:"text"`
	IsSeen     bool          `json:"is_seen" bson:"is_seen"`
	IsSent     bool          `json:"is_sent" bson:"is_sent"`
	IsReceived bool          `json:"is_received" bson:"is_received"`
	Timestamp  time.Time     `json:"timestamp" bson:"timestamp"`
}

Message is a message object that has datatypes for the message domain (Message)

func NewMessage

func NewMessage(sender, receiver, msgType, text string, isSeen, isSent, isReceived bool) *Message

NewMessage creates a new Message!

Jump to

Keyboard shortcuts

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