response

package
v0.0.0-...-d6791e1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2023 License: MIT Imports: 5 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 {
	Code        string   `json:"code"`
	Message     string   `json:"message"`
	ErrorFields []string `json:"errorFields,omitempty"`
	StatusCode  int      `json:"statusCode"`
}

func (*ErrorResponse) Error

func (er *ErrorResponse) Error() string

func (*ErrorResponse) GetCode

func (er *ErrorResponse) GetCode(code string) string

func (*ErrorResponse) HandleValidationError

func (er *ErrorResponse) HandleValidationError(err error) []string

type SuccessResponse

type SuccessResponse struct {
	Code       string `json:"code"`
	Data       any    `json:"data,omitempty"`
	Message    string `json:"message,omitempty"`
	StatusCode int    `json:"statusCode"`
}

func (*SuccessResponse) GetCode

func (er *SuccessResponse) GetCode(code string) string

Jump to

Keyboard shortcuts

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