# README
Response with Logger
This package enables response with event logging in go-restful apps. For the event logging please read logger/event package
Usage
Importing
import "github.com/AccelByte/go-restful-plugins/v4/pkg/response"
Write Response Success
Write(request, response, httpStatusCode, serviceType, eventID, message, entity)
Write Response Error
WriteError(request, response, httpStatusCode, serviceType, eventErr, errorResponse)
Error Response Example
&Error{
ErrorCode: unableToWriteResponse,
ErrorMessage: "unable to write response",
ErrorLogMsg: fmt.Sprintf("unable to write response: %+v, body: %+v, error: %v", response, entity, err),
})
We recommend use "github.com/pkg/errors"
to create error and wrap the errors with stack trace to help with debugging
# Functions
Write sends response with specified values.
WriteError sends error message.
WriteErrorWithEventID sends error message with Event ID.