Documentation ¶
Index ¶
- func CreateError(ctx context.Context, err error) (*schemas.ErrorResp, error)
- func CreateFail[T interface{}](ctx context.Context, err error, data T) (*schemas.FailureResp[T], error)
- func CreateSuccess[T interface{}](ctx context.Context, payload T) (*schemas.SuccessResp[T], error)
- func ExtractRequestID(r *http.Request) string
- func GetMetadata(ctx context.Context) (*schemas.Metadata, error)
- func GetRequestDuration(ctx context.Context) (int, error)
- func NewWriter(l *logging.ZapEventLogger, rw http.ResponseWriter) *writer
- func WriteError(ctx context.Context, l *logging.ZapEventLogger, rw http.ResponseWriter, ...)
- func WriteFail(ctx context.Context, l *logging.ZapEventLogger, rw http.ResponseWriter, ...)
- func WriteSuccess(ctx context.Context, l *logging.ZapEventLogger, rw http.ResponseWriter, ...)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateFail ¶
func CreateSuccess ¶
func CreateSuccess[T interface{}](ctx context.Context, payload T) (*schemas.SuccessResp[T], error)
func ExtractRequestID ¶
func NewWriter ¶
func NewWriter(l *logging.ZapEventLogger, rw http.ResponseWriter) *writer
func WriteError ¶
func WriteError(ctx context.Context, l *logging.ZapEventLogger, rw http.ResponseWriter, inErr error)
func WriteFail ¶
func WriteFail(ctx context.Context, l *logging.ZapEventLogger, rw http.ResponseWriter, inErr error, data interface{})
func WriteSuccess ¶
func WriteSuccess(ctx context.Context, l *logging.ZapEventLogger, rw http.ResponseWriter, payload interface{})
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.