apiutil

package
v0.0.0-...-07bc221 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Api

type Api struct {
	Ctx *gin.Context
}

func New

func New(ctx *gin.Context) *Api

func (*Api) Abort

func (c *Api) Abort(httpCode int, msg string, errorCode int)

func (*Api) Abort401

func (c *Api) Abort401(msg string, errorCode int)

func (*Api) Fail

func (c *Api) Fail(msg string)

func (*Api) FailWithData

func (c *Api) FailWithData(msg string, data interface{})

func (*Api) Out

func (c *Api) Out(success bool, msg string, data interface{})

func (*Api) Success

func (c *Api) Success(msg string)

func (*Api) SuccessWithData

func (c *Api) SuccessWithData(msg string, data interface{})

type Apier

type Apier interface {
	Out(success bool, msg string, data interface{})
	Success(msg string, data interface{})
	Fail(msg string)
	FailWithMsg(msg string, data interface{})
	Abort(httpCode int, msg string, errorCode int)
	Abort401(msg string, errCode int)
}

Jump to

Keyboard shortcuts

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