Documentation ¶
Index ¶
- Constants
- Variables
- func CleanEndpoint(s string) (string, error)
- func ComputeJSONHmac(hash, data, secret string, order bool) (string, error)
- func ConvertDefaultHeaderToCustomHeader(h *http.Header) *datastore.HttpHeader
- func GenerateAPIKey() (string, string)
- func GenerateRandomString(n int) (string, error)
- func GenerateSecret() (string, error)
- func IsJSON(s string) bool
- func IsStringEmpty(s string) bool
- func JsonReMarshalString(s string) (string, error)
- func ReadJSON(r *http.Request, dst interface{}) error
- func Validate(dst interface{}) error
- type Response
- type ServerResponse
- type ServiceError
- type Signature
Constants ¶
View Source
const ( Prefix string = "CO" Seperator string = "." )
Variables ¶
View Source
var ErrEmptyBody = errors.New("body must not be empty")
Functions ¶
func CleanEndpoint ¶
func ConvertDefaultHeaderToCustomHeader ¶
func ConvertDefaultHeaderToCustomHeader(h *http.Header) *datastore.HttpHeader
ConvertDefaultHeaderToCustomHeader converts http.Header to convoy.HttpHeader
func GenerateAPIKey ¶
func GenerateRandomString ¶
func GenerateSecret ¶
func IsStringEmpty ¶
IsStringEmpty checks if the given string s is empty or not
func JsonReMarshalString ¶
Types ¶
type ServerResponse ¶ added in v0.6.2
type ServerResponse struct { Response Status bool `json:"status"` Message string `json:"message"` Data json.RawMessage `json:"data,omitempty"` }
func NewErrorResponse ¶ added in v0.6.2
func NewErrorResponse(msg string, statusCode int) ServerResponse
func NewServerResponse ¶ added in v0.6.2
func NewServerResponse(msg string, object interface{}, statusCode int) ServerResponse
func NewServiceErrResponse ¶ added in v0.6.2
func NewServiceErrResponse(err error) ServerResponse
type ServiceError ¶ added in v0.6.2
type ServiceError struct {
// contains filtered or unexported fields
}
func NewServiceError ¶ added in v0.6.2
func NewServiceError(errCode int, errMsg error) *ServiceError
func (*ServiceError) ErrCode ¶ added in v0.6.2
func (s *ServiceError) ErrCode() int
func (*ServiceError) Error ¶ added in v0.6.2
func (s *ServiceError) Error() string
Click to show internal directories.
Click to hide internal directories.