status

package
v3.0.13 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Success               = 0
	Ok                    = Success
	ErrCanceled           = 1
	ErrUnknown            = 2
	ErrArgument           = 3
	ErrDeadlineExceeded   = 4
	ErrNotFound           = 5
	ErrAlreadyExists      = 6
	ErrPermissionDenied   = 7
	ErrResourceExhausted  = 8
	ErrFailedPrecondition = 9
	ErrAborted            = 10
	ErrOutOfRange         = 11
	ErrUnimplemented      = 12
	ErrInternal           = 13
	ErrUnavailable        = 14
	ErrDataLoss           = 15
	ErrUnauthenticated    = 16
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Status

type Status struct {
	Code    uint32 `json:"code" yaml:"code"`
	Message string `json:"msg" yaml:"msg"`
	Data    any    `json:"data" yaml:"data"`
	Flag    uint16 `json:"flag" yaml:"flag"`
}

func JsonUnmarshalStatus

func JsonUnmarshalStatus(data []byte) (*Status, error)

func StatusError

func StatusError(code uint32, flag uint16) *Status

func StatusOk

func StatusOk(data any) *Status

func (*Status) Error

func (s *Status) Error() string

func (*Status) IsCode

func (s *Status) IsCode(code uint32) bool

func (*Status) Reset

func (s *Status) Reset()

func (*Status) ToError

func (s *Status) ToError() error

func (*Status) WithFlag

func (s *Status) WithFlag(flag uint16) *Status

func (*Status) WithMsg

func (s *Status) WithMsg(msg string) *Status

Jump to

Keyboard shortcuts

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