Documentation
¶
Index ¶
- Constants
- func ConstructErrorResponseData(debugID string, startProcessingTime time.Time, message string) map[string]interface{}
- func ConstructStdResponseData(debugID string, startProcessingTime time.Time, data interface{}, ...) map[string]interface{}
- func Get(ctx context.Context, req Request) (respBody []byte, respCode int, err error)
- func GetDebugIDFromRequest(r *http.Request) string
- func GetMockUserAgent() string
- func Post(ctx context.Context, req Request) (respBody []byte, respCode int, err error)
- type API
- func (m API) BadRequestResponse(err error) error
- func (m API) ErrorResponse(err error) error
- func (m API) ErrorResponseWithCustomData(err error, data interface{}) error
- func (m API) ErrorResponseWithReqData(err error, data interface{}) error
- func (m API) GetDebugID() string
- func (m API) RawResponse(statusCode int, message string, data interface{}) error
- func (m API) SuccessResponse(data interface{}) error
- func (m API) SuccessResponseWithMessage(data interface{}, message string) error
- func (m API) UnathorizedResponse(err error) error
- func (m API) UnathorizedResponseWithReqData(err error, data interface{}) error
- type Request
Constants ¶
View Source
const ( HeaderAuthorization string = "Authorization" HeaderDebugID string = "X-Debug-ID" HeaderHMACSignature string = "X-Signature" HeaderDateRequest string = "X-Date" )
Variables ¶
This section is empty.
Functions ¶
func GetDebugIDFromRequest ¶
GetDebugIDFromRequest get from request header
func GetMockUserAgent ¶
func GetMockUserAgent() string
GetMockUserAgent returns a random mock user-agent
Types ¶
type API ¶
type API struct {
// contains filtered or unexported fields
}
func NewResponder ¶
func NewResponderWithContext ¶
func (API) BadRequestResponse ¶
func (API) ErrorResponse ¶
func (API) ErrorResponseWithCustomData ¶
func (API) ErrorResponseWithReqData ¶
func (API) GetDebugID ¶
func (API) RawResponse ¶
func (API) SuccessResponse ¶
func (API) SuccessResponseWithMessage ¶
func (API) UnathorizedResponse ¶
func (API) UnathorizedResponseWithReqData ¶
Click to show internal directories.
Click to hide internal directories.