ret

package
v0.0.0-...-99a0925 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2026 License: Apache-2.0, BSD-2-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package ret provides a type for representing the return value of a function.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Err

func Err(c errorcode.ErrorCode, msg string) error

func Errorf

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

Types

type Error

type Error struct {
	// contains filtered or unexported fields
}

func (*Error) Error

func (e *Error) Error() string

func (*Error) GRPCStatus

func (e *Error) GRPCStatus() *Status

type Status

type Status struct {
	RetCode errorcode.ErrorCode
	RetMsg  string
}

func FromError

func FromError(err error) (s *Status, ok bool)

func New

func New(c errorcode.ErrorCode, msg string) *Status

func Newf

func Newf(c errorcode.ErrorCode, format string, a ...interface{}) *Status

func (*Status) Code

func (s *Status) Code() errorcode.ErrorCode

func (*Status) Err

func (s *Status) Err() error

func (*Status) Message

func (s *Status) Message() string

Jump to

Keyboard shortcuts

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