codes

package
v0.0.0-...-d5b0b98 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2023 License: Apache-2.0, BSD-2-Clause, BSD-3-Clause, + 1 more Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EqualError

func EqualError(code Code, err error) bool

EqualError equal error.

func Error

func Error(c Code, msg string) error

Error returns an error representing c and msg. If c is OK, returns nil.

func Errorf

func Errorf(c Code, format string, a ...interface{}) error

Errorf returns Error(c, fmt.Sprintf(format, a...)).

func Register

func Register(m map[int]string)

Register registers the code message.

Types

type Code

type Code int

A Code is an int error code.

func (Code) Code

func (c Code) Code() int

Code returns the error code.

func (Code) Details

func (c Code) Details() []interface{}

Details returns the details.

func (Code) Error

func (c Code) Error() string

func (Code) GRPCStatus

func (c Code) GRPCStatus() *status.Status

GRPCStatus returns the Status.

func (Code) Message

func (c Code) Message() string

Message returns the error message.

Jump to

Keyboard shortcuts

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