Documentation
¶
Index ¶
- Constants
- Variables
- func CheckDuplication(source []string, separator string) (bool, string)
- func Extract(line string, name string, separator string) (string, bool)
- func Normalization(source string, separator string, comment string) ([]string, error)
- func NormalizeLine(line string, separator string, comment string) (string, error)
- func Parse(line string, separator string, comment string) (string, string, error)
- func Treasure(source []string, separator string) (map[string]string, error)
- func ValidationDelimiters(separator string, comment string) error
- func ValidationFile(file *os.File) error
- func ValidationName(name string) (string, bool)
- func ValidationSource(source string) error
- func ValidationSuffix(suffix string) (string, bool)
Constants ¶
const ( NewLine string = "\n" NewLineByte byte = '\n' Empty string = "" )
Pre-defined control characters
const AnnotationDelimiters string = "{} "
Variables ¶
var ( RegexSeparator *regexp.Regexp = regexp.MustCompile(`^[=|:;,.?@]{1}$`) RegexComments *regexp.Regexp = regexp.MustCompile(`^[#|:;,.?@]{1}$`) )
Regex for separator and comment validation
var RegexAnnotation *regexp.Regexp = regexp.MustCompile(`{{\s*(\w+)\s*}}`)
Functions ¶
func CheckDuplication ¶
CheckDuplication check for any duplicated names in source
func Extract ¶
Extract search for a name in line and return value and true if found, else return empty string and false if not found
func Normalization ¶
Normalization parse each line and return prepared source collection
func NormalizeLine ¶
NormalizeLine parse line and return prepared line
func ValidationDelimiters ¶
ValidationDelimiters validate demilimters such as separator and comment
func ValidationFile ¶
ValidationFile check file stat and size
func ValidationName ¶
ValidationName check name validation and return trimed name, return false if name is invalid
func ValidationSource ¶
ValidationSource validate source string
func ValidationSuffix ¶
ValidationSuffix check suffix validation and return right trimed suffix, return flase if suffix is invalid
Types ¶
This section is empty.