Documentation
¶
Index ¶
- Constants
- Variables
- func Contains(s []string, e string) bool
- func Copy(toValue interface{}, fromValue interface{}) (err error)
- func CreateKeyValuePairs(m map[string]string) string
- func CreateSQSUrlFromArn(arn string) string
- func ErrorToText(err GenericResponse) string
- func FileExists(filename string) bool
- func GetHeaderWithPrefixAndDecode(headerName string, prefix string, r *http.Request) (string, error)
- func GetISO3361CodeCountry(country string) string
- func GetISOCodeCountry(country string) string
- func GetRequestBody(request *http.Request) ([]byte, error)
- func Getenv(key, fallback string) string
- func Indirect(reflectValue reflect.Value) reflect.Value
- func IndirectType(reflectType reflect.Type) reflect.Type
- func IsCustomType(t reflect.Type) bool
- func IsNativeKind(v reflect.Kind) bool
- func IsNil(i interface{}) bool
- func IsPtrType(t reflect.Type) bool
- func IsPtrValue(t reflect.Value) bool
- func IsTimeType(t reflect.Type) bool
- func IsValidGUID(guid string) bool
- func JsonIt(a interface{}) string
- func Ptr(v reflect.Value) reflect.Value
- func ResolveStatus(r *http.Response) string
- func ResponseWriterJSON(writer http.ResponseWriter, response interface{})
- func ResponseWriterTextHtml(writer http.ResponseWriter, response interface{})
- func ResponseWriterXML(writer http.ResponseWriter, response interface{})
- func SafeAtoi(str string, fallback *int) *int
- func Src(callerDepth int) string
- func StringPtr(str string) *string
- func TrimLeftChars(s string, n int) string
- func XmlIt(a interface{}) string
- type GenericResponse
- type HTTPStatusCode
- type JsonQuery
- func (j *JsonQuery) Array(s ...string) ([]interface{}, error)
- func (j *JsonQuery) ArrayOfArrays(s ...string) ([][]interface{}, error)
- func (j *JsonQuery) ArrayOfBools(s ...string) ([]bool, error)
- func (j *JsonQuery) ArrayOfFloats(s ...string) ([]float64, error)
- func (j *JsonQuery) ArrayOfInts(s ...string) ([]int, error)
- func (j *JsonQuery) ArrayOfObjects(s ...string) ([]map[string]interface{}, error)
- func (j *JsonQuery) ArrayOfStrings(s ...string) ([]string, error)
- func (j *JsonQuery) Bool(s ...string) (bool, error)
- func (j *JsonQuery) Float(s ...string) (float64, error)
- func (j *JsonQuery) Int(s ...string) (int, error)
- func (j *JsonQuery) Interface(s ...string) (interface{}, error)
- func (j *JsonQuery) Matrix2D(s ...string) ([][]interface{}, error)
- func (j *JsonQuery) Object(s ...string) (map[string]interface{}, error)
- func (j *JsonQuery) String(s ...string) (string, error)
- type MappingBuilder
- type MappingStrategy
- type MappingValues
- type SqlQuery
Constants ¶
const ( // ContentTypeApplicationANY const ContentTypeApplicationANY = "*/*" // ContentTypeApplicationJSON const ContentTypeApplicationJSON = "application/json" // ContentTypeApplicationXML const ContentTypeApplicationXML = "application/xml" // ContentTypeHeader const ContentTypeHeader = "Content-Type" // AuthorizationHeader const AuthorizationHeader = "Authorization" // BearerToken const BearerToken = "Bearer " )
Variables ¶
var HTTPStatusCodes = map[HTTPStatusCode]string{
200: "The API request is successful.",
201: "Request fulfilled for single record insertion.",
202: "Request fulfilled for multiple records insertion.",
204: "There is no content available for the request.",
304: "The requested page has not been modified. In case \"If-Modified-Since\" header is used for GET APIs",
400: "The request or the authentication considered is invalid.",
401: "Invalid API key provided.",
403: "No permission to do the operation.",
404: "Invalid request.",
405: "The specified method is not allowed.",
413: "The server did not accept the request while uploading a file, since the limited file size has exceeded.",
415: "The server did not accept the request while uploading a file, since the media/ file type is not supported.",
429: "Number of API requests per minute/day has exceeded the limit.",
500: "Generic error that is encountered due to an unexpected server error.",
}
HTTPStatusCodes is a map of possible HTTP Status Code and Messages
Functions ¶
func CreateKeyValuePairs ¶
func CreateSQSUrlFromArn ¶
func GetISO3361CodeCountry ¶
func GetISOCodeCountry ¶ added in v1.0.3
func GetRequestBody ¶
GetRequestBody return array of byte from the request
func IsNativeKind ¶
func IsValidGUID ¶
func ResolveStatus ¶
func ResponseWriterJSON ¶
func ResponseWriterJSON(writer http.ResponseWriter, response interface{})
ResponseWriterJSON function
func ResponseWriterTextHtml ¶
func ResponseWriterTextHtml(writer http.ResponseWriter, response interface{})
ResponseWriterTextHtml function
func ResponseWriterXML ¶
func ResponseWriterXML(writer http.ResponseWriter, response interface{})
ResponseWriterXML function
func TrimLeftChars ¶
Types ¶
type GenericResponse ¶
type HTTPStatusCode ¶
type HTTPStatusCode int
HTTPStatusCode is a type for resolving the returned HTTP Status Code Content
type JsonQuery ¶
type JsonQuery struct {
// contains filtered or unexported fields
}
JsonQuery is an object that enables querying of a Go map with a simple positional query language. All credit goes to https://github.com/jmoiron/jsonq
func NewJsonQuery ¶
func NewJsonQuery(data interface{}) *JsonQuery
NewJsonQuery creates a new JsonQuery obj from an interface{}.
func (*JsonQuery) ArrayOfArrays ¶
ArrayOfArrays extracts an array of []interface{} (arrays) from some json
func (*JsonQuery) ArrayOfBools ¶
ArrayOfBools extracts an array of bools from some json
func (*JsonQuery) ArrayOfFloats ¶
ArrayOfFloats extracts an array of float64s from some json
func (*JsonQuery) ArrayOfInts ¶
ArrayOfInts extracts an array of ints from some json
func (*JsonQuery) ArrayOfObjects ¶
ArrayOfObjects extracts an array of map[string]interface{} (objects) from some json
func (*JsonQuery) ArrayOfStrings ¶
ArrayOfStrings extracts an array of strings from some json
type MappingBuilder ¶
type MappingBuilder struct {
// contains filtered or unexported fields
}
func NewMappingBuilder ¶
func NewMappingBuilder(mappings map[string]string, doc map[string]interface{}) *MappingBuilder
func (*MappingBuilder) BuildBody ¶
func (mb *MappingBuilder) BuildBody() (map[string]interface{}, error)
type MappingStrategy ¶
type MappingStrategy interface {
// contains filtered or unexported methods
}
type MappingValues ¶
type SqlQuery ¶
type SqlQuery struct { // Filter should be a pointer //Filter *string Filter *strings.Builder Parameters map[int]interface{} Error error Limit string OrderBy string // contains filtered or unexported fields }
func ParseScimParams ¶
func ParseScimParams(params scim.ListRequestParams, fieldMappings map[filter.AttributePath]MappingValues, orderField string, orderDirection string) (*SqlQuery, error)
func (*SqlQuery) GetParameterList ¶
func (sq *SqlQuery) GetParameterList() []interface{}