inter

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 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 Any

type Any struct {
	Result
}

type DefaultResp

type DefaultResp struct{}

func (*DefaultResp) RetError

func (dt *DefaultResp) RetError(err error) interface{}

RetError error 返回错误

func (*DefaultResp) RetFail

func (dt *DefaultResp) RetFail(code int32, detail string) interface{}

RetFail 返回错误结构

func (*DefaultResp) RetSuccess

func (dt *DefaultResp) RetSuccess(detail string, data proto.Message) interface{}

RetSuccess return success

type Responser

type Responser interface {
	RetSuccess(detail string, data proto.Message) interface{}
	RetError(err error) interface{}
	RetFail(code int32, detail string) interface{}
}

func GetRespHandler

func GetRespHandler() Responser

type Result

type Result struct {
	Code   int32         `json:"code" `
	Detail string        `json:"detail"`
	Data   proto.Message `json:"data"`
}

Jump to

Keyboard shortcuts

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