shared

package
v0.0.0-...-b957f84 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildJSONResponse

func BuildJSONResponse[T any](res http.ResponseWriter, resp T, httpCode int)

JsonResponse function for Marshal and format response using Json

Types

type EmptyJSON

type EmptyJSON struct{}

EmptyJSON type

type Response

type Response[T any] struct {
	Success bool   `json:"success"`
	Code    int    `json:"code"`
	Message string `json:"message"`
	Data    T      `json:"data,omitempty"`
}

Response type

Jump to

Keyboard shortcuts

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