handler

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteBadRequestResponse

func WriteBadRequestResponse(w http.ResponseWriter)

WriteBadRequestResponse writes bad request response to the HTTP connection

func WriteInternalServerErrorResponse

func WriteInternalServerErrorResponse(w http.ResponseWriter)

WriteInternalServerErrorResponse writes internal server error response to the HTTP connection

func WriteResponse

func WriteResponse(w http.ResponseWriter, statusCode int, body interface{})

WriteResponse writes response to the HTTP connection

Types

type DataResponse

type DataResponse struct {
	Data interface{}  `json:"data"`
	Meta ResponseMeta `json:"meta"`
}

DataResponse is a response with data and meta property

type FriendHandler

type FriendHandler struct {
	FriendService service.FriendUseCase
}

FriendHandler handle /friends routes

func (*FriendHandler) Create

Create is a handler function for POST /friends

func (*FriendHandler) Delete

Delete is a handler function for DELETE /friends/:id

func (*FriendHandler) Index

Index is a handler function for GET /friends

func (*FriendHandler) Update

Update is a handler function for PUT /friends/:id

type HealthzHandler

type HealthzHandler struct{}

HealthzHandler handle /healthz routes

func (*HealthzHandler) Index

Index is a handler function for GET /healthz

type MessageDataResponse

type MessageDataResponse struct {
	Message string       `json:"message"`
	Meta    ResponseMeta `json:"meta"`
}

MessageDataResponse is a response with message, data and meta property

type MessageResponse

type MessageResponse struct {
	Message string       `json:"message"`
	Meta    ResponseMeta `json:"meta"`
}

MessageResponse is a response with message and meta property

type ResponseMeta

type ResponseMeta struct {
	HTTPStatus int `json:"http_status"`
}

ResponseMeta is a struct for response meta property

Jump to

Keyboard shortcuts

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