Documentation
¶
Index ¶
- Constants
- func AddNewApiErrorResponse(name string, response map[string]ApiErrorResponse) error
- func AddNewApiResponse(name string, response map[string]ApiResponse) error
- func AllApiErrorResponses() map[string]map[string]ApiErrorResponse
- func AllApiResponses() map[string]map[string]ApiResponse
- type ApiErrorResponse
- func Failed(name string, errors []error) (int, ApiErrorResponse)
- func FallbackToFailedError(name string, errs []error) (int, ApiErrorResponse)
- func NotCreated(name string, errors []error) (int, ApiErrorResponse)
- func NotDeleted(name string, errors []error) (int, ApiErrorResponse)
- func NotFound(name string, errors []error) (int, ApiErrorResponse)
- func NotUpdated(name string, errors []error) (int, ApiErrorResponse)
- type ApiResponse
- func Created(name string, data interface{}) (int, ApiResponse)
- func Deleted(name string, data interface{}) (int, ApiResponse)
- func FallbackToFailed(name string) (int, ApiResponse)
- func Found(name string, data interface{}, pagination interface{}) (int, ApiResponse)
- func HealthcheckFound(data interface{}, pagination interface{}) (int, ApiResponse)
- func Ok(name string, data interface{}) (int, ApiResponse)
- func Updated(name string, data interface{}) (int, ApiResponse)
- type GeoPoint
- type GeoPointStr
- type Healthcheck
- type Pagination
- type PaginationContainer
- type ResponseHeader
- type SearchParams
Constants ¶
View Source
const ( StatusNotCreated = "notCreated" StatusCreated = "created" StatusNotUpdated = "notUpdated" StatusUpdated = "updated" StatusNotDeleted = "notDeleted" StatusDeleted = "deleted" StatusNotFound = "notFound" StatusFound = "found" StatusOk = "ok" StatusFailed = "failed" TypeHealthcheck = "healthcheck" TypeSystem = "system" )
Variables ¶
This section is empty.
Functions ¶
func AddNewApiErrorResponse ¶
func AddNewApiErrorResponse(name string, response map[string]ApiErrorResponse) error
AddNewApiErrorResponse adds new error api response by name, returns error if already exists
func AddNewApiResponse ¶
func AddNewApiResponse(name string, response map[string]ApiResponse) error
AddNewApiResponse adds new api response by name, returns error if already exists
func AllApiErrorResponses ¶
func AllApiErrorResponses() map[string]map[string]ApiErrorResponse
AllApiErrorResponses returns full map of map ApiErrorResponse structure
func AllApiResponses ¶
func AllApiResponses() map[string]map[string]ApiResponse
AllApiResponses returns full map of map ApiResponse structure
Types ¶
type ApiErrorResponse ¶
type ApiErrorResponse struct { Code int32 `json:"code"` Type string `json:"type"` Message string `json:"message"` Errors []error `json:"errors"` Data interface{} `json:"data"` }
func FallbackToFailedError ¶
func FallbackToFailedError(name string, errs []error) (int, ApiErrorResponse)
func NotCreated ¶
func NotCreated(name string, errors []error) (int, ApiErrorResponse)
func NotDeleted ¶
func NotDeleted(name string, errors []error) (int, ApiErrorResponse)
func NotUpdated ¶
func NotUpdated(name string, errors []error) (int, ApiErrorResponse)
type ApiResponse ¶
type ApiResponse struct { Code int32 `json:"code"` Type string `json:"type"` Message string `json:"message"` Data interface{} `json:"data"` *PaginationContainer }
func Created ¶
func Created(name string, data interface{}) (int, ApiResponse)
func Deleted ¶
func Deleted(name string, data interface{}) (int, ApiResponse)
func FallbackToFailed ¶
func FallbackToFailed(name string) (int, ApiResponse)
func Found ¶
func Found(name string, data interface{}, pagination interface{}) (int, ApiResponse)
func HealthcheckFound ¶
func HealthcheckFound(data interface{}, pagination interface{}) (int, ApiResponse)
func Ok ¶
func Ok(name string, data interface{}) (int, ApiResponse)
func Updated ¶
func Updated(name string, data interface{}) (int, ApiResponse)
type GeoPointStr ¶
type Healthcheck ¶
type Pagination ¶
type PaginationContainer ¶
type PaginationContainer struct {
Pagination Pagination `json:"pagination"`
}
type ResponseHeader ¶
type SearchParams ¶
Click to show internal directories.
Click to hide internal directories.