helper

package
v7.5.1-8 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BytesToJson

func BytesToJson(data []byte, convertedData interface{}) error

BytesToJson permit to convert bytes to Json struct It return error if somthing wrong when it convert json to struct It add struct on convertedData interface.

func ExtractFromRegex

func ExtractFromRegex(regex string, data string) ([]string, error)

ExtractFromRegex permet to extract some substring from regex It return error if regex syntaxe is bad It return nil if regex not match

func JsonToBytes

func JsonToBytes(data interface{}) ([]byte, error)

JsonToBytes permit to convert interface that represent Json to bytes The json is pretty formatted before to be converted in bytes. It return error if something wrong when convert json in byte It return an array of bytes that represent the pretty formated json

func ListFilesInPath

func ListFilesInPath(path string, extention string) ([]string, error)

ListFilesInPath permtit to list all file in provided path that match the extension It return error if somethink wrong when it list the file on path It return a list of full path. It return empty list if it doesn't found file

func LoadYaml

func LoadYaml(filePath string, data interface{}) error

LoadYaml permit to read yaml file and convert content to map

func WriteFile

func WriteFile(path string, content []byte) error

WriteFile permit to write the content in file It return error if something wrong when write file

Types

type Config

type Config struct {
}

Jump to

Keyboard shortcuts

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