response

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Text = http.StatusText

	MsgSuccess = map[string]string{"en": "Success", "id": "Sukses"}
	MsgFailed  = map[string]string{"en": "Failed", "id": "Gagal"}
)

Functions

This section is empty.

Types

type CaptureError

type CaptureError struct {
	Details string `json:"details"`
	Message string `json:"message"`
}

type Message

type Message map[string]string

type Response

type Response struct {
	Status  int            `json:"status"`
	Message Message        `json:"message"`
	Errors  []CaptureError `json:"errors,omitempty"`
	Data    interface{}    `json:"data,omitempty"`
	Meta    interface{}    `json:"meta,omitempty"`
	Header  http.Header    `json:"header,omitempty"`
	Body    interface{}    `json:"body,omitempty"`
}

func NewResponse

func NewResponse(statusCode int, message Message, data interface{}) Response

func NewResponseError

func NewResponseError(statusCode int, messageStatus Message, details string) Response

Jump to

Keyboard shortcuts

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