Documentation
¶
Index ¶
Constants ¶
View Source
const ( DefaultLimit = 10 DefaultSort = "created_at" DefaultOrder = "desc" )
Variables ¶
This section is empty.
Functions ¶
func IsClientError ¶
func IsRetryableCode ¶
func IsServerError ¶
func ToHTTPStatus ¶
Types ¶
type Code ¶
type Code uint
func FromFiberError ¶
func FromFiberError(err *fiber.Error) Code
func FromGRPCError ¶
type Error ¶
type Error struct { // Code should be unique and identifiable. It is used to determine the type of error. Code Code `example:"1000" json:"code" validate:"required"` // Title is a short, human-readable title of the error. It is used to determine the type of error. Title string `example:"Internal Server Error" json:"title" validate:"optional"` // Message is a human-readable description of the error. Should not be used to display to the user. Message string `example:"An unexpected error occurred. Please try again later." json:"message" validate:"optional"` }
Error model @Description Represents a client-facing API error.
type RequestPagination ¶
type RequestPagination struct { // Token is a base64 string that can be used to retrieve the next page of results. // If not present, retrieve the first page. Token string `default:"" example:"Vk4gV29ya2RheSBFeGFtcGxl" format:"base64" json:"token" validate:"optional"` // Limit is the maximum number of items to return in the response. // The default value is 10. Limit uint `default:"10" example:"10" json:"limit" maximum:"100" minimum:"1" validate:"required"` }
RequestPagination godoc @Description Represents a pagination request.
type ResponsePagination ¶
type ResponsePagination struct { // NextToken is a token that can be used to retrieve the next page of results. // If this field is not present, it means that there are no more results to retrieve. NextToken string `example:"Vk4gV29ya2RheSBFeGFtcGxl" format:"base64" json:"next_token" validate:"optional"` // PreviousToken a token that can be used to retrieve the previous page of results. // If this field is not present, it means that there are no more results to retrieve. PreviousToken string `example:"Vk4gV29ya2RheSBFeGFtcGxl" format:"base64" json:"previous_token" validate:"optional"` // Total is the total number of items in the list. Total uint `example:"100" json:"total" minimum:"0" validate:"required"` // TotalPages is the total number of pages in the list. TotalPages uint `example:"10" json:"total_pages" minimum:"0" validate:"required"` }
ResponsePagination godoc @Description Represents a pagination response.
Click to show internal directories.
Click to hide internal directories.