rorerror

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: May 14, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GinHandleErrorAndAbort

func GinHandleErrorAndAbort(c *gin.Context, status int, err error, fields ...Field) bool

Types

type Field

type Field struct {
	Key   string
	Value string
}

func ByteString

func ByteString(key string, value []byte) Field

func ByteStringp

func ByteStringp(key string, value *[]byte) Field

func Float32

func Float32(key string, value float32) Field

func Float32p

func Float32p(key string, value *float32) Field

func Float64

func Float64(key string, value float64) Field

func Float64p

func Float64p(key string, value *float64) Field

func Int

func Int(key string, value int) Field

func Int64

func Int64(key string, value int64) Field

func Int64p

func Int64p(key string, value *int64) Field

func Intp

func Intp(key string, value *int) Field

func String

func String(key, value string) Field

func Stringp

func Stringp(key string, value *string) Field

func Uint

func Uint(key string, value uint) Field

func Uintp

func Uintp(key string, value *uint) Field

func (Field) ToRlog

func (f Field) ToRlog() rlog.Field

type RorError

type RorError struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

func NewRorError

func NewRorError(status int, err string, errors ...error) RorError

func NewRorErrorFromError

func NewRorErrorFromError(status int, err error) RorError

func (RorError) AsJson

func (e RorError) AsJson() []byte

func (RorError) AsString

func (e RorError) AsString() string

func (RorError) Error

func (e RorError) Error() string

func (RorError) GinLogErrorAndAbort

func (e RorError) GinLogErrorAndAbort(c *gin.Context, fields ...Field)

func (RorError) GinLogErrorAndAbortWithMessage

func (e RorError) GinLogErrorAndAbortWithMessage(c *gin.Context, message string, fields ...rlog.Field)

Jump to

Keyboard shortcuts

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