Documentation
¶
Index ¶
- Constants
- Variables
- func APICall(method, path string, requestBody PropertyMap, headers map[string]string) (responseCode int, responseBody map[string]string, err error)
- func CreateUUID() string
- func GetConfigValue(key string) string
- func GetNestedKeyValue(keys []string, nestedObject interface{}) (value interface{}, found bool)
- func LeftPad(data, padding string, totalLength int) string
- func MapToStruct(sourceMap map[string]interface{}, targetStruct interface{}) error
- func ParseDateStr(dateString string) (time.Time, error)
- func RightPad(data, padding string, totalLength int) string
- func StrToHex(data string, mod int) string
- type BaseModel
- type PropertyMap
Constants ¶
const DobFormatLayout = "2006-01-02"
Variables ¶
var Region = os.Getenv("SSM_PS_RG")
Functions ¶
func APICall ¶
func APICall(method, path string, requestBody PropertyMap, headers map[string]string) (responseCode int, responseBody map[string]string, err error)
APICall will call api specifed in the path with parameters specified..
func CreateUUID ¶
func CreateUUID() string
CreateUUID create a v4 UUID string without any "-" (hyphen)
func GetConfigValue ¶
GetConfigValue get the environment value using the key. if not found, then fetches it from AWS Parameter Store
func GetNestedKeyValue ¶
GetNestedKeyValue will return a nested value using arrays of keys which constitute the path to the nested path eg. for nested key, "top/middle/end" => ["top", "middle", "end"] should be passed as keys if at any stage a key is not found, it returns empty interface and found as false
NOTE: Its the user responsibility to check if found is true, before using interface value
func MapToStruct ¶
MapToStruct Convert Map to Specified Struct
func ParseDateStr ¶
ParseDateStr Convert Date String (YYYY-MM-DD) to time.Time object
Types ¶
type PropertyMap ¶
type PropertyMap map[string]interface{}
PropertyMap can be used for any non-fixed json to map parsing
func (*PropertyMap) Scan ¶
func (pm *PropertyMap) Scan(src interface{}) error