Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNoRequestBodyResponse is a response indicating there was no request body. ErrNoRequestBodyResponse = NewErrorResponse(http.StatusBadRequest, "No Request Body") // ErrUnprocessableEntityResponse is a response indicating the service instance not async ErrUnprocessableEntityResponse = NewErrorResponse(http.StatusUnprocessableEntity, "This Service Instance requires client support for asynchronous binding operations") )
View Source
var ( // SuccessCreateResponse represents the response that all successful instance creations should return. SuccessCreateResponse = newSuccessResponse(http.StatusCreated, SuccessCreateResponseType, "The instance was created") // SuccessAcceptedResponse represents the response that all successful instance acceptions should return. SuccessAcceptedResponse = newSuccessResponse(http.StatusAccepted, SuccessAcceptedResponseType, "The operation was accepted") // SuccessDeleteResponse represents the response that all successful instance deletions should return. SuccessDeleteResponse = newSuccessResponse(http.StatusOK, SuccessDeleteResponseType, "The instance was deleted") )
Functions ¶
This section is empty.
Types ¶
type Response ¶
Response represents the common data for all types of responses to have and implement.
func NewAsyncOperationResponse ¶
If a broker has an async operation ( create, modify, delete, bind) and wants to return an "operation" they should use this Otherwise they can return SuccessAcceptedResponse
func NewErrorResponse ¶
NewErrorResponse is the constructor for an errorResponse.
func NewSuccessBindResponse ¶
NewSuccessBindResponse is the constructor for a successBindResponse.
func NewSuccessLastOperation ¶
NewSuccessLastOperation for async responses
type Type ¶
type Type string
Type indicates the type of response. Nice for debug situations.
var ( // SuccessCreateResponseType represents a response for a successful instance creation. SuccessCreateResponseType Type = "success_create" // SuccessAcceptedResponseType represents a response for a successful instance creation. SuccessAcceptedResponseType Type = "success_accept" // SuccessLastOperationResponseType represents a response for a successful last operation. SuccessLastOperationResponseType Type = "success_lastoperation" // SuccessBindResponseType represents a response for a successful instance binding. SuccessBindResponseType Type = "success_bind" // SuccessDeleteResponseType represents a response for a successful instance deletion. SuccessDeleteResponseType Type = "success_delete" // ErrorResponseType represents a response for an error. ErrorResponseType Type = "error" )
These contain the list of response types. Useful for debug situations.
Click to show internal directories.
Click to hide internal directories.