handlers

package
v0.0.0-...-b7d3607 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package classification of ChatroomMembersRequest API

Documentation for ChatroomMembersRequest API

Schemes: http
BasePath: /
Version: 1.0.0

Consumes:
- application/json

Produces:
- application/json

swagger:meta

Package classification of ChatroomRequest API

Documentation for ChatroomRequest API

Schemes: http
BasePath: /
Version: 1.0.0

Consumes:
- application/json

Produces:
- application/json

swagger:meta

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidChatroomPath = fmt.Errorf("Invalid Path, path should be /Chatrooms/[id]")

ErrInvalidChatroomPath is an error message when the ChatroomRequest path is not valid

Functions

This section is empty.

Types

type AppError

type AppError struct {
	StatusCode int    `json:"status_code"`
	Message    string `json:"message,omitempty"`
	ID         string `json:"id,omitempty"`
	RequestID  string `json:"request_id,omitempty"`
}

AppError is a generic error message returned by a server Generic error message returned as a string swagger:response errorResponse

type ChatroomMembers

type ChatroomMembers struct {
	ChatroomMemberDB *data.ChatroomMembersDB
	// contains filtered or unexported fields
}

ChatroomMembers handler for getting and updating ChatroomMembers

func NewChatroomMembers

func NewChatroomMembers(l hclog.Logger, pdb *data.ChatroomMembersDB) *ChatroomMembers

NewChatroomMembers returns a new ChatroomMembers handler with the given logger

func (*ChatroomMembers) AddMember

func (p *ChatroomMembers) AddMember(c *gin.Context)

swagger:route POST /chatroomMembers{chatroomid} chatroomMembers createChatroomMembers AddMember a new chatroomMember

responses:

	200: chatroomMemberResponse
 422: errorValidation
 501: errorResponse

AddMember handles POST requests to add new chatroomMembers

func (*ChatroomMembers) AddOrGetMemberByID

func (p *ChatroomMembers) AddOrGetMemberByID(c *gin.Context)

func (*ChatroomMembers) GetMembersByChatroomID

func (p *ChatroomMembers) GetMembersByChatroomID(c *gin.Context)

GetMembersByChatroomID handles GET requests

func (*ChatroomMembers) GetMembersByUserID

func (p *ChatroomMembers) GetMembersByUserID(c *gin.Context)

GetMembersByChatroomID handles GET requests

func (*ChatroomMembers) ListAll

func (p *ChatroomMembers) ListAll(c *gin.Context)

GetChatroomsAll handles GET requests and returns all current ChatroomMembers

func (*ChatroomMembers) Update

func (p *ChatroomMembers) Update(c *gin.Context)

Update handles PUT requests to update chatroomMembers

func (*ChatroomMembers) UpdateLastViewedAt

func (p *ChatroomMembers) UpdateLastViewedAt(c *gin.Context)

Update handles PUT requests to update chatroomMembers

type Chatrooms

type Chatrooms struct {
	ChatroomDB *data.ChatroomsDB
	// contains filtered or unexported fields
}

Chatrooms handler for getting and updating Chatrooms

func NewChatrooms

func NewChatrooms(l hclog.Logger, pdb *data.ChatroomsDB) *Chatrooms

NewChatrooms returns a new Chatrooms handler with the given logger

func (*Chatrooms) Create

func (p *Chatrooms) Create(c *gin.Context)

swagger:route POST /chatrooms chatrooms createChatroom Create a new chatroom

responses:

	200: chatroomResponse
 422: errorValidation
 501: errorResponse

Create handles POST requests to add new chatrooms

func (*Chatrooms) Delete

func (p *Chatrooms) Delete(c *gin.Context)

Delete handles DELETE requests and removes items from the database

func (*Chatrooms) GetChatroomByID

func (p *Chatrooms) GetChatroomByID(c *gin.Context)

GetChatroomByID handles GET requests

func (*Chatrooms) GetChatroomsAll

func (p *Chatrooms) GetChatroomsAll(c *gin.Context)

GetChatroomsAll handles GET requests and returns all current Chatrooms

func (*Chatrooms) Update

func (p *Chatrooms) Update(c *gin.Context)

Update handles PUT requests to update chatrooms

type GenericError

type GenericError struct {
	Message string `json:"message"`
}

GenericError is a generic error message returned by a server

type ValidationError

type ValidationError struct {
	Messages []string `json:"messages"`
}

ValidationError is a collection of validation error messages

Jump to

Keyboard shortcuts

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