handlers

package
v0.0.0-...-2fb4a12 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 AchievementsHandler

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

AchievementsHandler used for getting and updating achievements

func NewAchievementsHandler

func NewAchievementsHandler(db database.AchievementDB) *AchievementsHandler

NewAchievementsHandler returns a pointer to a AchievementsHandler with the logger passed as a parameter

func (*AchievementsHandler) AddAchievement

func (achievementHandler *AchievementsHandler) AddAchievement(responseWriter http.ResponseWriter, request *http.Request)

AddAchievement creates a new achievement from the received JSON

func (*AchievementsHandler) Delete

func (achievementHandler *AchievementsHandler) Delete(responseWriter http.ResponseWriter, request *http.Request)

Delete a achievement with specified id from the database

func (*AchievementsHandler) GetAchievementByID

func (achievementHandler *AchievementsHandler) GetAchievementByID(responseWriter http.ResponseWriter, request *http.Request)

GetAchievementByID returns a single achievement from the database

func (*AchievementsHandler) GetAchievements

func (achievementHandler *AchievementsHandler) GetAchievements(responseWriter http.ResponseWriter, request *http.Request)

GetAchievements returns the full list of achievements

func (*AchievementsHandler) LivenessCheck

func (achievementHandler *AchievementsHandler) LivenessCheck(responseWriter http.ResponseWriter, request *http.Request)

LivenessCheck determine when the application needs to be restarted

func (*AchievementsHandler) MiddlewareAchievementValidation

func (achievementHandler *AchievementsHandler) MiddlewareAchievementValidation(next http.Handler) http.Handler

MiddlewareAchievementValidation is used to validate incoming achievement JSONS

func (*AchievementsHandler) ReadinessCheck

func (achievementHandler *AchievementsHandler) ReadinessCheck(responseWriter http.ResponseWriter, request *http.Request)

ReadinessCheck verifies that the application is ready to accept requests

func (*AchievementsHandler) UpdateAchievements

func (achievementHandler *AchievementsHandler) UpdateAchievements(responseWriter http.ResponseWriter, request *http.Request)

UpdateAchievements updates the achievement with the ID specified in the received JSON achievement

type KeyAchievement

type KeyAchievement struct{}

KeyAchievement is a key used for the Achievement object inside context

Jump to

Keyboard shortcuts

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