Documentation ¶
Index ¶
- func CtxIngestID(ctx context.Context) (types.IngestID, context.Context)
- func CtxLogger(ctx context.Context) *slog.Logger
- func CtxRequestID(ctx context.Context) (types.RequestID, context.Context)
- func CtxTime(ctx context.Context) time.Time
- func CtxWithLogger(ctx context.Context, logger *slog.Logger) context.Context
- func CtxWithTime(ctx context.Context, timeFunc TimeFunc) context.Context
- func ErrLog(err error) slog.Attr
- func HandleError(ctx context.Context, msg string, err error)
- func LoadEnv(t *testing.T, key string) string
- func Logger() *slog.Logger
- func SafeClose(c Closer)
- func SafeWrite(w io.Writer, b []byte)
- func SetLogger(l *slog.Logger)
- type Closer
- type TimeFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CtxIngestID ¶
CtxIngestID returns stream ID from context. If stream ID is not set, return new stream ID and context with it
func CtxRequestID ¶
CtxRequestID returns request ID from context. If request ID is not set, return new request ID and context with it
func CtxTime ¶ added in v0.1.0
CtxTime returns time from context. If time is not set, return current time and context with it
func CtxWithLogger ¶
WithLogger returns a new context with logger
func CtxWithTime ¶ added in v0.1.0
CtxWithTime returns a new context with time function
Types ¶
Click to show internal directories.
Click to hide internal directories.