Documentation ¶
Index ¶
- Constants
- func Abs(name string) (string, error)
- func ArrayStringDelete(a []string, element string) []string
- func BuildURLPath(aPath, repo, subpath, document string) (fullFileName string)
- func DefColor(colorNum int) (color, reset string)
- func Evaluate(value string, tmpl *template.Template, data interface{}, ...) (_ string, _ error)
- func InStringList(element string, elements ...string) string
- func ReadDocumentFrom(urls []*url.URL, repos, subPaths []string, document, contentType string) ([]byte, error)
- func RunCmd(command string, args ...string) int
- func RunCmdOutput(command string, args ...string) (string, int)
- func Touch(file string) error
- type MLoop
Constants ¶
const RepoTag = "<repo>"
PluginTag to identify variable component name in a Document path.
Variables ¶
This section is empty.
Functions ¶
func Abs ¶
Abs returns an absolute path
It expands ~ to $HOME If path is already absolute, it cleans up (shortest path). If the path is relative, it adds current directory to create it as absolute path
func ArrayStringDelete ¶
func BuildURLPath ¶
BuildURLPath build the path logic introducing the pluginTag to replace.
func InStringList ¶
func ReadDocumentFrom ¶
func ReadDocumentFrom(urls []*url.URL, repos, subPaths []string, document, contentType string) ([]byte, error)
ReadDocumentFrom is used to read a document from a url like github raw or directly from a local path It supports file or url stored in url.URL structure each urls can be defined with a plugin tag "<plugin>" which will be replaced by the document name(document) the file name and the extension is added at the end of the string.
func RunCmd ¶
RunCmd is a simple function to call a shell command and display to stdout stdout is displayed as is when it arrives, while stderr is displayed in Red, line per line.
func RunCmdOutput ¶
RunCmdOutput run a command and return the standard output as result. stderr is displayed in Red, line per line.