handler

package
v0.0.0-...-18aef32 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container interface {
	Startup()
	Shutdown()
	HandleResolveByID(w http.ResponseWriter, r *http.Request)
	HandleResolvePage(w http.ResponseWriter, r *http.Request)
	HandleCreate(w http.ResponseWriter, r *http.Request)
}

Container is the handler interface for Containers

type ContainerImpl

type ContainerImpl struct {
	ContainerService service.Container `inject:"containerService"`
}

ContainerImpl is the handler implementation for Containers

func (*ContainerImpl) HandleCreate

func (h *ContainerImpl) HandleCreate(w http.ResponseWriter, r *http.Request)

HandleCreate handles the request @Summary Create a Container. @Description Creates a new Container. @Tags containers @Accept json @Produce json @Param input body model.ContainerInput true "Input in the form of Container JSON." @Success 200 {object} response.BaseResponse{data=model.Container} @Failure 400 {object} response.BaseResponse @Failure 409 {object} response.BaseResponse @Failure 500 {object} response.BaseResponse @Router /containers [post]

func (*ContainerImpl) HandleResolveByID

func (h *ContainerImpl) HandleResolveByID(w http.ResponseWriter, r *http.Request)

HandleResolveByID handles the request @Summary Resolve a Container. @Description Resolves a Container by its ID. @Tags containers @Produce json @Param id path string true "The Container's identifier." @Success 200 {object} response.BaseResponse{data=model.Container} @Failure 400 {object} response.BaseResponse @Failure 404 {object} response.BaseResponse @Failure 500 {object} response.BaseResponse @Router /containers/{id} [get]

func (*ContainerImpl) HandleResolvePage

func (h *ContainerImpl) HandleResolvePage(w http.ResponseWriter, r *http.Request)

HandleResolvePage handles the request @Summary Resolve a Page of Containers. @Description Resolves a Page of Containers based on page and page size parameters. @Tags containers @Produce json @Param page query int false "The page number. Defaults to 1." @Param pageSize query int false "The number of records on a page. Defaults to 10." @Success 200 {object} response.BaseResponse{data=model.Page} @Failure 400 {object} response.BaseResponse @Failure 404 {object} response.BaseResponse @Failure 500 {object} response.BaseResponse @Router /containers/ [get]

func (*ContainerImpl) Shutdown

func (h *ContainerImpl) Shutdown()

Shutdown cleans up everything and shuts down

func (*ContainerImpl) Startup

func (h *ContainerImpl) Startup()

Startup performs startup functions

type Health

type Health interface {
	Startup()
	Shutdown()
	HandleHealthCheck(w http.ResponseWriter, r *http.Request)
}

Health is the handler interface for Server Health

type HealthImpl

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

HealthImpl is the handler implementation for Server Health

func (*HealthImpl) HandleHealthCheck

func (h *HealthImpl) HandleHealthCheck(w http.ResponseWriter, r *http.Request)

HandleHealthCheck handles the request @Summary Health check. @Description Performs a check on the server's health status. @Description Returns HTTP 200/OK if healthy, @Description returns HTTP 503/Service Unavailable otherwise. @Tags health @Produce json @Success 200 {object} response.BaseResponse @Failure 503 {object} response.BaseResponse @Router /health [get]

func (*HealthImpl) PrepareShutdown

func (h *HealthImpl) PrepareShutdown()

PrepareShutdown prepares the service for shutdown

func (*HealthImpl) Shutdown

func (h *HealthImpl) Shutdown()

Shutdown cleans up everything and shuts down

func (*HealthImpl) Startup

func (h *HealthImpl) Startup()

Startup perform startup functions

type Player

type Player interface {
	Startup()
	Shutdown()
	HandleResolveByID(w http.ResponseWriter, r *http.Request)
	HandleResolvePage(w http.ResponseWriter, r *http.Request)
	HandleCreate(w http.ResponseWriter, r *http.Request)
	HandleAddBall(w http.ResponseWriter, r *http.Request)
}

Player is the handler interface for Players

type PlayerImpl

type PlayerImpl struct {
	PlayerService service.Player `inject:"playerService"`
}

PlayerImpl is the handler implementation for Players

func (*PlayerImpl) HandleAddBall

func (h *PlayerImpl) HandleAddBall(w http.ResponseWriter, r *http.Request)

HandleAddBall handles the request @Summary Add balls. @Description Add balls to containers belonging to a particular user. @Tags players @Accept json @Produce json @Param input body model.PlayerAddBallInput true "Input specifying the player ID." @Success 200 {object} response.BaseResponse{data=model.Player} @Failure 400 {object} response.BaseResponse @Failure 409 {object} response.BaseResponse @Failure 500 {object} response.BaseResponse @Router /players/addBall [post]

func (*PlayerImpl) HandleCreate

func (h *PlayerImpl) HandleCreate(w http.ResponseWriter, r *http.Request)

HandleCreate handles the request @Summary Create a Player. @Description Creates a new Player. @Tags players @Accept json @Produce json @Param input body model.PlayerInput true "Input in the form of Player JSON." @Success 200 {object} response.BaseResponse{data=model.Player} @Failure 400 {object} response.BaseResponse @Failure 409 {object} response.BaseResponse @Failure 500 {object} response.BaseResponse @Router /players [post]

func (*PlayerImpl) HandleResolveByID

func (h *PlayerImpl) HandleResolveByID(w http.ResponseWriter, r *http.Request)

HandleResolveByID handles the request @Summary Resolve a Player. @Description Resolves a Player by its ID. @Tags players @Produce json @Param id path string true "The Player's identifier." @Success 200 {object} response.BaseResponse{data=model.Player} @Failure 400 {object} response.BaseResponse @Failure 404 {object} response.BaseResponse @Failure 500 {object} response.BaseResponse @Router /players/{id} [get]

func (*PlayerImpl) HandleResolvePage

func (h *PlayerImpl) HandleResolvePage(w http.ResponseWriter, r *http.Request)

HandleResolvePage handles the request @Summary Resolve a Page of Players. @Description Resolves a Page of Players based on page and page size parameters. @Tags players @Produce json @Param page query int false "The page number. Defaults to 1." @Param pageSize query int false "The number of records on a page. Defaults to 10." @Success 200 {object} response.BaseResponse{data=model.Page} @Failure 400 {object} response.BaseResponse @Failure 404 {object} response.BaseResponse @Failure 500 {object} response.BaseResponse @Router /players/ [get]

func (*PlayerImpl) Shutdown

func (h *PlayerImpl) Shutdown()

Shutdown cleans up everything and shuts down

func (*PlayerImpl) Startup

func (h *PlayerImpl) Startup()

Startup performs startup functions

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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