handlers

package
v0.0.0-...-a723260 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 KeyRelationship

type KeyRelationship struct{}

KeyRelationship is a key used for the Relationship object inside context

type RelationshipsHandler

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

RelationshipsHandler contains the items common to all relationship handler functions

func NewRelationshipsHandler

func NewRelationshipsHandler(db database.RelationshipDB) *RelationshipsHandler

NewRelationshipsHandler returns a pointer to a RelationshipsHandler with the logger passed as a parameter

func (*RelationshipsHandler) AddRelationship

func (relationshipHandler *RelationshipsHandler) AddRelationship(responseWriter http.ResponseWriter, request *http.Request)

AddRelationship creates a new relationship from the received JSON

func (*RelationshipsHandler) Delete

func (relationshipHandler *RelationshipsHandler) Delete(responseWriter http.ResponseWriter, request *http.Request)

Delete a relationship with specified id from the database

func (*RelationshipsHandler) GetFriendsListByUserID

func (relationshipHandler *RelationshipsHandler) GetFriendsListByUserID(responseWriter http.ResponseWriter, request *http.Request)

GetFriendsListByUserID returns all the relationships of a user from the database

func (*RelationshipsHandler) GetInvitesListByUserID

func (relationshipHandler *RelationshipsHandler) GetInvitesListByUserID(responseWriter http.ResponseWriter, request *http.Request)

GetInvitesListByUserID returns all the invites of a user from the database

func (*RelationshipsHandler) LivenessCheck

func (relationshipHandler *RelationshipsHandler) LivenessCheck(responseWriter http.ResponseWriter, request *http.Request)

LivenessCheck determine when the application needs to be restarted

func (*RelationshipsHandler) MiddlewareRelationshipValidation

func (relationshipHandler *RelationshipsHandler) MiddlewareRelationshipValidation(next http.Handler) http.Handler

MiddlewareRelationshipValidation is used to validate incoming relationship JSONS

func (*RelationshipsHandler) ReadinessCheck

func (relationshipHandler *RelationshipsHandler) ReadinessCheck(responseWriter http.ResponseWriter, request *http.Request)

ReadinessCheck verifies that the application is ready to accept requests

func (*RelationshipsHandler) UpdateRelationships

func (relationshipHandler *RelationshipsHandler) UpdateRelationships(responseWriter http.ResponseWriter, request *http.Request)

UpdateRelationships updates the relationship with the ID specified in the received JSON relationship

Jump to

Keyboard shortcuts

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