http

package
v0.0.0-...-4f9ff06 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2022 License: BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AuthenticationMiddleware

func AuthenticationMiddleware(function func(c *gin.Context)) gin.HandlerFunc

func RouterInit

func RouterInit(engine *gin.Engine, handlers *Handler)

Types

type Handler

type Handler struct {
	UserSvc *user.Service
}

func NewHandler

func NewHandler(userSvc *user.Service) *Handler

func (*Handler) Delete

func (h *Handler) Delete(c *gin.Context)

Delete godoc @Summary Endpoint to delete user @Description Endpoint to delete user @Tags Delete @Accept json @Produce json @Param X-Client-Id header string true "Client identifier" @Param X-Authorization header string true "Auth Token" @Success 200 {object} map[string]interface{} @Failure 400 {object} string @Failure 500 {object} string @Router /user/v1 [delete]

func (*Handler) HealthCheck

func (h *Handler) HealthCheck(c *gin.Context)

HealthCheck godoc @Summary Return status of service @Tags General @Accept json @Produce json @Success 200 {object} map[string]interface{} @Router /health-check [get]

func (*Handler) Login

func (h *Handler) Login(c *gin.Context)

Login godoc @Summary Endpoint to login user @Description Endpoint to login user @Tags Login @Accept json @Produce json @Param X-Client-Id header string true "Client identifier" @Param Payload body entity.Login true "Payload" @Success 200 {object} entity.LoginResponse @Failure 401 {object} entity.LoginResponse @Router /user/v1/login [post]

func (*Handler) Register

func (h *Handler) Register(c *gin.Context)

Register godoc @Summary Endpoint to signup user @Description Endpoint to register user @Tags Register @Accept json @Produce json @Param X-Client-Id header string true "Client identifier" @Param Payload body entity.Signup true "Payload" @Success 201 {object} map[string]interface{} @Failure 400 {object} string @Router /user/v1/register [post]

func (*Handler) Update

func (h *Handler) Update(c *gin.Context)

Update godoc @Summary Endpoint to update user @Description Endpoint to update user @Tags Update @Accept json @Produce json @Param X-Client-Id header string true "Client identifier" @Param X-Authorization header string true "Auth Token" @Param Payload body entity.Signup true "Payload" @Success 200 {object} map[string]interface{} @Failure 400 {object} string @Failure 500 {object} string @Router /user/v1 [put]

Jump to

Keyboard shortcuts

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