resp

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Output

type Output struct {
	Code string `json:"code"`
	Msg  string `json:"msg"`
	Data any    `json:"data"`
}

func (*Output) Json

func (o *Output) Json(c *gin.Context)

func (*Output) WithData

func (o *Output) WithData(data any) *Output

func (*Output) WithMsg

func (o *Output) WithMsg(msg string) *Output

type State

type State string
const (
	OK              State = "OK"
	InvalidErr      State = "InvalidParamsErr"
	UnauthorizedErr State = "UnauthorizedErr"
	DBErr           State = "DBErr"
	ServiceErr      State = "ServiceErr"
)

func (State) Output

func (r State) Output() *Output

Jump to

Keyboard shortcuts

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