response

package
v0.0.0-...-05d1b2a Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Error

func Error(ctx *gin.Context, message string, opts ...Option)

func Success

func Success(ctx *gin.Context, data any, opts ...Option)

Types

type Option

type Option func(*Options)

func CodeName

func CodeName(name string) Option

func DataName

func DataName(name string) Option

func ErrorCode

func ErrorCode(code int32) Option

func HttpCode

func HttpCode(code int) Option

func MessageName

func MessageName(name string) Option

func SuccessCode

func SuccessCode(code int32) Option

func SuccessMessage

func SuccessMessage(message string) Option

type Options

type Options struct {
	HttpCode    int
	SuccessCode int32
	ErrorCode   int32

	CodeName    string
	MessageName string
	DataName    string

	SuccessMessage string
}

Jump to

Keyboard shortcuts

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