errhandle

package
v0.0.0-...-971e649 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Log = NewLogger()
)

Functions

func Infof

func Infof(format string, msg ...any)

Types

type ErrCode

type ErrCode int
const (
	NoError ErrCode = iota
	InnerError
	TokenError
	ParamsError
	UserExists
	UserNonExists
	PasswordInvalid
	PermissionDenied
	ClassError
	SexError
	NameExists
	EmailFormatError
	RealNameFormatError
	SchoolError
	PasswordTooShort
	ClassNotFound
	TeacherNotFound
	TeacherNotJoinClass
)

func (ErrCode) String

func (i ErrCode) String() string

type Logger

type Logger struct {
	*slog.Logger
}

func NewLogger

func NewLogger(opts ...LoggerOptions) *Logger

func (*Logger) Errorf

func (l *Logger) Errorf(format string, s ...any)

func (*Logger) Errorln

func (l *Logger) Errorln(s ...any)

func (*Logger) Fatal

func (l *Logger) Fatal(s ...any)

type LoggerOptions

type LoggerOptions func(*Logger)

Jump to

Keyboard shortcuts

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