Documentation ¶
Index ¶
- func CtxCWD(ctx context.Context) string
- func CtxLogger(ctx context.Context) *slog.Logger
- func CtxRequestID(ctx context.Context) (context.Context, types.RequestID)
- func CtxWithCWD(ctx context.Context, dir string) context.Context
- func CtxWithLogger(ctx context.Context, logger *slog.Logger) context.Context
- func ErrLog(err error) slog.Attr
- func HandleError(ctx context.Context, msg string, err error)
- func LoadEnv(envs ...EnvLoader) error
- func Logger() *slog.Logger
- func ReconfigureLogger(handler slog.Handler)
- func SafeClose(c Closer)
- func SafeWrite(w io.Writer, b []byte)
- type Closer
- type EnvLoader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CtxRequestID ¶
WithRequestID returns context with request ID. If request ID is already set, it returns same context. If not, it generates new request ID and set it and logger to context.
func ReconfigureLogger ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.