Documentation ¶
Index ¶
- func CreateHash(s string) string
- func EncodeB64(text string) string
- func FindStringInRegexpList(compare string, listOfRegexp []string) bool
- func JSONToYAML(j []byte) (yamlBytes []byte, err error)
- func LoadStructFromFile(datatype, file string, objpointer interface{}) (err error)
- func StringInList(_string string, _list []string) bool
- func UnencodeB64(b64 string) (res string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateHash ¶ added in v1.4.7
creates a hash, to check if any changes occured in the appsettings
func EncodeB64 ¶
encode something to base64, this function only exists, because there is a function to unencode base64 strings... it is not necessary, you can just use base64.StdEncoding.EncodeToString([]byte(text))
Parameters:
- `text` : string > unencoded string, which should be abse64 encoded
func FindStringInRegexpList ¶ added in v1.4.2
compare a string with a list of regexp-like strings, if the list contains an expression, which matches with the given string, the return value will be true
if an error occurs, the returnvalue will be false
Parameters:
- `compare` : string > string, which should be compared to the list
- `listOfRegexp` : []string > list of regexp-like strings
func JSONToYAML ¶
JSONToYAML converts json to yaml
Parameters:
- `j` : []byte > unparsed json byte, converted from a string to a byte-array
func LoadStructFromFile ¶ added in v1.2.2
load a struct from a file
Parameters:
- `datatype` : string > declares the file type: ["json", "yaml"]
- `file` : string > path to the jsonfile, which contains the object, the json-tags are necessary
- `objpointer` : interface{} > pointer to the object, which should be loaded from json (*interface{})
func StringInList ¶ added in v1.4.0
compares the given string with the given list, if the list contains the string, the returnvalue will be true
Parameters:
- `_string` : string > contains the string, which will be looked for in the list
- `_list` : []string > list of string, maybe contains the given string
func UnencodeB64 ¶
this function just skips the error, which the base64-package throws
Parameters:
- `b64` : string > base64 encoded string, which should be unencoded
Types ¶
This section is empty.