Documentation
¶
Index ¶
- func ConvertInterfaceToByteAndMap(Body interface{}) ([]byte, map[string]interface{}, error)
- func CreateMultiPartFormPayload(file *os.File, reqBodyMap map[string]interface{}) (*bytes.Reader, string, error)
- func EncodeToBase64(val string) string
- func GetRequestedDateTime() string
- func HttpRequest(method string, apiUrl string, queryParams map[string]string, data interface{}, ...) ([]byte, error)
- func MapToURLEncodedString(valMap map[string]string) (encodedData string)
- type FDKError
- type Paginator
- type SignatureModel
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeToBase64 ¶
EncodeToBase64 gives base64 encoded string
func GetRequestedDateTime ¶
func GetRequestedDateTime() string
GetRequestedDateTime reuse and returns the date time created
func HttpRequest ¶
func MapToURLEncodedString ¶
MapToURLEncodedString converts map to url encoded string
Types ¶
type FDKError ¶
type FDKError struct {
// Message is user-friendly message that can be displayed on front-end for end-users
Message string `json:"message"`
// Status is HTTP status code that is set in API response
Status int `json:"status"`
// A Code should be unique and used only once throughout the project
// so that it can lead to the exact line of failed function when searched in the entire project.
Code string `json:"code"`
// Exception is technical expection title. This should be mostly 2-3 words title of the
// error/er to be understood by developers.
Exception string `json:"exception"`
// Info is link/URL to the logging system(Sentry/Kibana) to get more insight and trace error
Info string `json:"info"`
// RequestID is the unique ID of a particular request for tracing the errors in the logging system(Sentry/Kibana)
RequestID string `json:"request_id,omitempty"`
//StackTrace gives the report of the active stack frames at a certain point in time during the execution of a program used for debugging purposes
StackTrace string `json:"stack_trace,omitempty"`
//Meta can be used for your custom keys, which would be helpful for detailed error and for debugging
Meta objx.Map `json:"meta,omitempty"`
}
FDKError is custom error type to pass more information along with the native error.
func NewFDKError ¶
NewFDKError constructs and returns new FDKError object
func (*FDKError) SetRequestID ¶
SetRequestID sets the RequestID in the error object
type Paginator ¶
type Paginator struct {
PageNo float64
HasNextPage bool
NextID string
Next func() (interface{}, error)
}
Paginator holds paginator object
func NewPaginator ¶
NewPaginator returns paginator instance
type SignatureModel ¶
type SignatureModel struct {
// contains filtered or unexported fields
}
func NewSignatureModel ¶
func (*SignatureModel) AddSignatureToHeaders ¶
func (model *SignatureModel) AddSignatureToHeaders(signQuery bool) (map[string]string, error)
Click to show internal directories.
Click to hide internal directories.