Documentation
¶
Index ¶
- Constants
- func FromAppError(w http.ResponseWriter, reqID string, err error)
- func FromPgBool(b pgtype.Bool) bool
- func FromPgInt4(i pgtype.Int4) *int32
- func FromPgInt32(i pgtype.Int4) int32
- func FromPgText(t pgtype.Text) string
- func FromPgTimestamptz(ts pgtype.Timestamptz) time.Time
- func FromPgUUID(u pgtype.UUID) uuid.UUID
- func ToPgInt4(i *int32) pgtype.Int4
- func ToPgText(s string) pgtype.Text
- func ToPgTimestamptz(time time.Time) pgtype.Timestamptz
- func ToPgUUID(id uuid.UUID) pgtype.UUID
- func WrapRepoError(op string, err error, log *zerolog.Logger) error
- func WriteError(w http.ResponseWriter, httpStatusCode int, reqID string, code apperror.Kind, ...)
- func WriteJSON[T any](w http.ResponseWriter, status int, reqID string, message string, data T)
- type Error
- type ErrorResponse
- type SuccessResponse
Constants ¶
View Source
const ( UserRegistered = "User registered successfully" UserLoggedIn = "User logged in successfully" UserUpdated = "User updated successfully" UserDeleted = "User deleted successfully" )
Variables ¶
This section is empty.
Functions ¶
func FromAppError ¶
func FromAppError(w http.ResponseWriter, reqID string, err error)
func FromPgBool ¶
func FromPgInt4 ¶
func FromPgInt32 ¶
func FromPgText ¶
func FromPgTimestamptz ¶
func FromPgTimestamptz(ts pgtype.Timestamptz) time.Time
func ToPgTimestamptz ¶
func ToPgTimestamptz(time time.Time) pgtype.Timestamptz
func WriteError ¶
Types ¶
type ErrorResponse ¶
Click to show internal directories.
Click to hide internal directories.