response_helper

package module
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 2 Imported by: 0

README

iris-response-helper

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ResponseHelper

type ResponseHelper struct {
	Status int         `json:"status"`
	Msg    string      `json:"message"`
	Data   interface{} `json:"data,omitempty"`
	// contains filtered or unexported fields
}

func NewResponseHelper

func NewResponseHelper(ctx *iris.Context, logFunc func(...interface{})) *ResponseHelper

func (*ResponseHelper) ErrorLog

func (h *ResponseHelper) ErrorLog(errLabel string, err error)

func (*ResponseHelper) IsFailed

func (h *ResponseHelper) IsFailed(err error, status int, resMsg string) (isFailed bool)

func (*ResponseHelper) Response

func (h *ResponseHelper) Response(contentType string, errLabel string)

func (*ResponseHelper) ResponseJSON

func (h *ResponseHelper) ResponseJSON(errLabel string)

Jump to

Keyboard shortcuts

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