Documentation ¶
Index ¶
- Constants
- func APIAccessDeniedError(w http.ResponseWriter, r *http.Request, message string, details string)
- func APIAuthError(w http.ResponseWriter, r *http.Request, message string)
- func APIDomainErrorResponse(w http.ResponseWriter, r *http.Request, err *domain.Error, code ...int)
- func APIGenericErrorResponse(w http.ResponseWriter, r *http.Request, key string, err error, code ...int)
- func APISuccessResponse(w http.ResponseWriter, r *http.Request, data interface{}, code ...int)
- func GetReqID(ctx context.Context) string
- func InvalidRequestError(w http.ResponseWriter, r *http.Request, err error, code ...int)
- type CreateNoteResponse
- type Error
- type ErrorDetails
- type ErrorResponse
- type GetNoteResponse
- type GetNotesResponse
- type LoginResponse
- type Note
Constants ¶
View Source
const ACCESS_DENIED = "ACCESS_DENIED"
View Source
const AUTH_FAILED = "AUTH_FAILED"
View Source
const INVALID_REQUEST = "INVALID_REQUEST"
Variables ¶
This section is empty.
Functions ¶
func APIAccessDeniedError ¶
func APIAuthError ¶
func APIAuthError(w http.ResponseWriter, r *http.Request, message string)
func APIDomainErrorResponse ¶
func APIGenericErrorResponse ¶
func APISuccessResponse ¶
func APISuccessResponse(w http.ResponseWriter, r *http.Request, data interface{}, code ...int)
func InvalidRequestError ¶
Types ¶
type CreateNoteResponse ¶
type CreateNoteResponse struct {
ID string `json:"id"`
}
type Error ¶
type Error struct { Code int64 `json:"code" example:"4000"` Key string `json:"key" example:"VALIDATION_ERROR"` TraceID string `json:"trace_id" example:"1a7b11aa-8abb-40a9-a369-74bdc23971e8"` Details []ErrorDetails `json:"details"` }
type ErrorDetails ¶
type ErrorResponse ¶
type GetNoteResponse ¶
type GetNoteResponse struct {
Note Note `json:"note"`
}
type GetNotesResponse ¶
type GetNotesResponse struct {
Notes []Note `json:"notes"`
}
type LoginResponse ¶
type LoginResponse struct {
AccessToken string `json:"access_token"`
}
Click to show internal directories.
Click to hide internal directories.