base

package
v0.0.0-...-90ef440 Latest Latest
Warning

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

Go to latest
Published: Dec 2, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Code

func Code(err error) codes.Code

func ErrWithCaller

func ErrWithCaller(err error) error

func GetCaller

func GetCaller(skip int) uintptr

func GetFilePathTailPart

func GetFilePathTailPart(filePath string, count int) string

func GetFilePosition

func GetFilePosition(pc uintptr) string

func GetPanicReportEvent

func GetPanicReportEvent(skip int, r any) string

GetPanicReportEvent only call this function in recover code

func GetStackFrame

func GetStackFrame(pc uintptr) runtime.Frame

func GetStackPosition

func GetStackPosition(skip int) string

func In

func In[T comparable](val T, set1 T, sets ...T) bool

func PanicIfErr

func PanicIfErr(c context.Context, err error, attrs ...slog.Attr)

func ToEventString

func ToEventString(s string, maxLen int) string

Types

type Composer

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

func NewComposer

func NewComposer(c context.Context, err error) *Composer

func (*Composer) Error

func (com *Composer) Error() error

func (*Composer) Report

func (com *Composer) Report() *Composer

func (*Composer) Status

func (com *Composer) Status() *Status

type Status

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

func New

func New(code codes.Code) *Status

func (*Status) Error

func (s *Status) Error() string

func (*Status) GetCode

func (s *Status) GetCode() codes.Code

func (*Status) GetEvent

func (s *Status) GetEvent() string

func (*Status) GetMsg

func (s *Status) GetMsg() string

func (*Status) MarshalJSONV2

func (s *Status) MarshalJSONV2(encoder *jsontext.Encoder, opts jsontext.Options) error

func (*Status) SetErrEvent

func (s *Status) SetErrEvent(err error) *Status

func (*Status) SetEvent

func (s *Status) SetEvent(event string) *Status

func (*Status) SetMsg

func (s *Status) SetMsg(msg string, args ...any) *Status

Jump to

Keyboard shortcuts

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