common

package
v0.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateErrorResponse

func GenerateErrorResponse(c echo.Context, data interface{}, message string) error

GenerateErrorResponse Http error response

func GenerateSuccessResponse

func GenerateSuccessResponse(c echo.Context, data interface{}, metadata *MetaData, message string) error

GenerateSuccessResponse Http success response

Types

type MetaData

type MetaData struct {
	Page       int64               `json:"page"`
	PerPage    int64               `json:"per_page"`
	PageCount  int64               `json:"page_count"`
	TotalCount int64               `json:"total_count"`
	Links      []map[string]string `json:"links"`
}

MetaData Http response metadata

type ResponseDTO

type ResponseDTO struct {
	Metadata *MetaData   `json:"_metadata"`
	Data     interface{} `json:"data" msgpack:"data" xml:"data"`
	Status   string      `json:"status" msgpack:"status" xml:"status"`
	Message  string      `json:"message" msgpack:"message" xml:"message"`
}

ResponseDTO Http response dto

Jump to

Keyboard shortcuts

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