lei

package
v0.0.0-...-700eda8 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddMessages

func AddMessages(locale string, messages map[string]string) error

func Debug

func Debug(format string, args ...any)

func DebugErr

func DebugErr(err error)

func DebugErrF

func DebugErrF(format string, err error, args ...any)

func Error

func Error(format string, args ...any)

func ErrorErr

func ErrorErr(err error)

func ErrorErrF

func ErrorErrF(format string, err error, args ...any)

func Info

func Info(format string, args ...any)

func InfoErr

func InfoErr(err error)

func InfoErrF

func InfoErrF(format string, err error, args ...any)

func Message

func Message(ctx context.Context, key string, args ...any) string

func MustAddMessages

func MustAddMessages(locale string, messages map[string]string)

func Panic

func Panic(format string, args ...any)

func PanicErr

func PanicErr(err error)

func PanicErrF

func PanicErrF(format string, err error, args ...any)

func Warn

func Warn(format string, args ...any)

func WarnErr

func WarnErr(err error)

func WarnErrF

func WarnErrF(format string, err error, args ...any)

func WithLocale

func WithLocale(ctx context.Context, locales string) context.Context

Types

type Err

type Err struct {
	Code    string
	Message string
	Cause   error
	Status  int
}

func Adapt

func Adapt(err error) *Err

func I18nNew

func I18nNew(ctx context.Context, key string, args ...any) *Err

func I18nWrap

func I18nWrap(ctx context.Context, key string, cause error, args ...any) *Err

func New

func New(msg string, args ...any) *Err

func Wrap

func Wrap(msg string, cause error, args ...any) *Err

func (*Err) Error

func (e *Err) Error() string

func (*Err) Unwrap

func (e *Err) Unwrap() error

func (*Err) WithCode

func (e *Err) WithCode(code string) *Err

func (*Err) WithStatus

func (e *Err) WithStatus(status int) *Err

type ErrMarshaller

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

func (*ErrMarshaller) MarshalLogObject

func (e *ErrMarshaller) MarshalLogObject(encoder zapcore.ObjectEncoder) error

Jump to

Keyboard shortcuts

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