responses

package
v0.0.0-...-76f2794 Latest Latest
Warning

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

Go to latest
Published: Sep 18, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorResponse

type ErrorResponse struct {
	Meta Meta `json:"meta"`
}

type Meta

type Meta struct {
	Code    int    `json:"code"`
	Success bool   `json:"success"`
	Message string `json:"message"`
}

Meta represents the metadata for the response.

type Response

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

Response represents the common response format for your endpoints.

func CustomResponse

func CustomResponse(data interface{}, code int, success bool, message string) Response

NewResponse creates a new Response with the given data and metadata.

Jump to

Keyboard shortcuts

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