handlers

package
v0.0.0-...-0e27891 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KeyConversation

type KeyConversation struct{}

KeyConversation is a key used for the Conversation object inside context

type KeyMessage

type KeyMessage struct{}

KeyMessage is a key used for the Message object inside context

type TextChatHandler

type TextChatHandler struct {
	// contains filtered or unexported fields
}

func NewTextChatHandler

func NewTextChatHandler(db database.TextChatDB) *TextChatHandler

func (*TextChatHandler) AddConversation

func (textChatHandler *TextChatHandler) AddConversation(responseWriter http.ResponseWriter, request *http.Request)

AddConversation creates a new message from the received JSON

func (*TextChatHandler) AddMessage

func (textChatHandler *TextChatHandler) AddMessage(responseWriter http.ResponseWriter, request *http.Request)

AddMessage creates a new message from the received JSON

func (*TextChatHandler) AddUserToConversation

func (textChatHandler *TextChatHandler) AddUserToConversation(responseWriter http.ResponseWriter, request *http.Request)

AddConversation creates a new message from the received JSON

func (*TextChatHandler) DeleteConversation

func (textChatHandler *TextChatHandler) DeleteConversation(responseWriter http.ResponseWriter, request *http.Request)

Delete a conversation with specified id from the database

func (*TextChatHandler) DeleteMessage

func (textChatHandler *TextChatHandler) DeleteMessage(responseWriter http.ResponseWriter, request *http.Request)

Delete a message with specified id from the database

func (*TextChatHandler) GetConversationByID

func (textChatHandler *TextChatHandler) GetConversationByID(responseWriter http.ResponseWriter, request *http.Request)

func (*TextChatHandler) GetMessageByID

func (textChatHandler *TextChatHandler) GetMessageByID(responseWriter http.ResponseWriter, request *http.Request)

func (*TextChatHandler) GetMessagesByConversationID

func (textChatHandler *TextChatHandler) GetMessagesByConversationID(responseWriter http.ResponseWriter, request *http.Request)

func (*TextChatHandler) LivenessCheck

func (textChatHandler *TextChatHandler) LivenessCheck(responseWriter http.ResponseWriter, request *http.Request)

LivenessCheck determine when the application needs to be restarted

func (*TextChatHandler) MiddlewareConversationValidation

func (textChatHandler *TextChatHandler) MiddlewareConversationValidation(next http.Handler) http.Handler

MiddlewareConversatonValidation is used to validate incoming conversation JSONS

func (*TextChatHandler) MiddlewareMessageValidation

func (textChatHandler *TextChatHandler) MiddlewareMessageValidation(next http.Handler) http.Handler

MiddlewareMessageValidation is used to validate incoming message JSONS

func (*TextChatHandler) ReadinessCheck

func (textChatHandler *TextChatHandler) ReadinessCheck(responseWriter http.ResponseWriter, request *http.Request)

ReadinessCheck verifies that the application is ready to accept requests

Jump to

Keyboard shortcuts

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