gutil

package module
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: 4 Imported by: 1

README

gutil

工具包

使用指南

1.定义自己的返回值

gutil.RegisterHttpResponse(f)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InstallLog added in v1.0.4

func InstallLog(ll Log)

func RegisterHttpResponse added in v1.0.1

func RegisterHttpResponse(h inter.Responser)

RegisterHttpResponse 注册错误处理使用

func RetError

func RetError(err error) interface{}

RetError error 返回错误

func RetFail

func RetFail(code int32, detail string, logMsg ...string) interface{}

RetFail 返回错误结构

func RetSuccess

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

RetSuccess return success

Types

type DescAPI added in v1.0.5

type DescAPI struct {
	// API 名称
	Name string
	// 完整路径
	FullPath string
	// 方法
	Method string
}

type Log added in v1.0.4

type Log func(ctx context.Context, info ...interface{})

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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