fnc

package
v1.4.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 2, 2023 License: GPL-3.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateHash added in v1.4.7

func CreateHash(s string) string

creates a hash, to check if any changes occured in the appsettings

func EncodeB64

func EncodeB64(text string) string

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

func FindStringInRegexpList(compare string, listOfRegexp []string) bool

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

func JSONToYAML(j []byte) (yamlBytes []byte, err error)

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

func LoadStructFromFile(datatype, file string, objpointer interface{}) (err error)

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

func StringInList(_string string, _list []string) bool

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

func UnencodeB64(b64 string) (res string)

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL