Documentation ¶
Index ¶
- func CreateError(ctx context.Context, err error) (*common.ErrorResp, error)
- func CreateFail[T interface{}](ctx context.Context, err error, data T) (*common.FailureResp[T], error)
- func CreateSuccess[T interface{}](ctx context.Context, payload T) (*common.SuccessResp[T], error)
- func ExtractRequestID(r *http.Request) string
- func GetMetadata(ctx context.Context) (*common.Metadata, error)
- func GetRequestDuration(ctx context.Context) (int, error)
- func NewWriter(l *zap.Logger, rw http.ResponseWriter) *writer
- func WriteError(ctx context.Context, l *zap.Logger, rw http.ResponseWriter, inErr error)
- func WriteFail(ctx context.Context, l *zap.Logger, rw http.ResponseWriter, inErr error, ...)
- func WriteSuccess(ctx context.Context, l *zap.Logger, 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) (*common.SuccessResp[T], error)
func ExtractRequestID ¶
func WriteError ¶
func WriteSuccess ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.