ifitlib

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidNameValueOpt = errors.New("Invalid option, should be Name or Name=Value")

Functions

func CommaList

func CommaList(strs []string) (s string)

Convert an array of strings into a comma separated list.

func Exists

func Exists(name string) bool

Return true if the file exists

func FindFile

func FindFile(PathOfInput, fn string, sp []string) (rv string)

Use the search path to find a file

func GetItemN

func GetItemN(line string, nthItem int) (name string)

Pull items out of a line and return the nth one

func GetItemSet

func GetItemSet(line string, nthItem int) (set []string)

Pull items out of a line of text, parse into words and then return the nth... !! marker.

func InArray

func InArray(lookFor string, inArr []string) bool

Return true if lookFor is in array inArr

func JsonStringToString

func JsonStringToString(s string) (theJSON map[string]string, err error)

Parse JSON string into map[string]string

func JsonStringToStringString

func JsonStringToStringString(s string) (theJSON map[string]map[string]string, err error)

Parse JSON string into map[string]map[string]string

func KeysSorted

func KeysSorted(sub map[string]string) (strs []string)

Sort the keys on a map and return it as an slice of strings

func ParseLineIntoWords

func ParseLineIntoWords(line string) []string

Parse a line of text into words

func ParseNameValueOpt

func ParseNameValueOpt(s string) (name, value string, err error)

Parse a name or name=value - if value is not specified then "on" is used.

Types

This section is empty.

Jump to

Keyboard shortcuts

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