dto

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteJson

func WriteJson(w http.ResponseWriter, httpStatus int, data any)

func WriteJsonError

func WriteJsonError(w http.ResponseWriter, err error)

func WriteJsonErrorData

func WriteJsonErrorData(w http.ResponseWriter, err error, data any)

Types

type ErrorResponse

type ErrorResponse struct {
	Code    string `json:"code"`
	SubCode string `json:"subcode"`
	Message string `json:"message"`
}

func NewErrorResponse

func NewErrorResponse(err error) *ErrorResponse

type Response

type Response struct {
	Status string         `json:"status"`
	Error  *ErrorResponse `json:"error,omitempty"`
	Data   any            `json:"data,omitempty"`
}

Jump to

Keyboard shortcuts

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