response

package
v0.0.0-...-d4a6c04 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SendResponse

func SendResponse(w http.ResponseWriter, statusCode int, message string, stack string, data interface{}, returnOnlyMockedValue bool)

SendResponse is a helper function to send standardized API responses or mock responses

Types

type Response

type Response struct {
	Message string      `json:"message"`
	Stack   string      `json:"stack,omitempty"` // Stack can be omitted if empty
	Data    interface{} `json:"data,omitempty"`  // Data can be omitted if nil
}

Response is the common structure for all API responses.

Jump to

Keyboard shortcuts

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