gasx

package module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2019 License: MIT Imports: 14 Imported by: 1

README

gasx — library for creating gas applications builders

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearDir

func ClearDir(dir string)

ClearDir reacreate directory or create if it doesn't exists

func CopyDir

func CopyDir(dirA, dirB string)

CopyDir copy dirA to dirB

func CopyFile

func CopyFile(pathA, pathB string)

CopyFile copy file from pathA to file in pathB

func DeleteFile

func DeleteFile(path string)

DeleteFile delete file

func ErrorMsg

func ErrorMsg(msg string)

ErrorMsg print message with ERROR tag

func Exists

func Exists(name string) bool

Exists return true if file exisits

func FilesByPattern

func FilesByPattern(dir string, pattern string) ([]string, error)

FilesByPattern return files path matched by mattern in directory

func GetWASMExecScript

func GetWASMExecScript() string

GetWASMExecScript return wasm execution script

func GrepStyles

func GrepStyles() ([]string, error)

GrepStyles grep styles files path in deps by their styles.gas

func GrepStylesCustom

func GrepStylesCustom(dir string, already map[string]bool) ([]string, error)

GrepStylesCustom grep styles files path in deps (for custom dir) by their styles.gas

func InArrayString

func InArrayString(a string, arr []string) bool

InArrayString return is string in array of strings

func Log

func Log(msg string)

Log println message with "Builder" prefix

func Must

func Must(err error)

Must compact "if err != nil"

func NewFile

func NewFile(path, body string)

NewFile create new file

func RunCommand

func RunCommand(command string)

RunCommand execute command

func StartWatcher

func StartWatcher(onUpdate func(name string), ignoringExt, watchings, recursiveWatchings []string) error

func UniteFilesByPaths

func UniteFilesByPaths(paths []string) (string, error)

Types

type BlockCompiler

type BlockCompiler func(*BlockInfo) (string, error)

BlockCompiler node for render pipeline

type BlockInfo

type BlockInfo struct {
	// Name File name
	Name string

	// Value special block value
	Value string

	// FileInfo isExternal, file path, extension, e.t.c.
	FileInfo File

	// FileBytes full GOS file value
	FileBytes string
}

BlockInfo information about special block

type Builder

type Builder struct {
	// BlockCompilers pipeline of special blocks compilers
	BlockCompilers []BlockCompiler
}

Builder GOS files builder

func (*Builder) CompileFile

func (builder *Builder) CompileFile(fileInfo File, fileBody string) (string, error)

ParseFile compile GOS file to pure golang

func (*Builder) ParseFiles

func (builder *Builder) ParseFiles(files []File) error

ParseFiles parse and compile GOS files

func (*Builder) RenderBlock

func (builder *Builder) RenderBlock(block *BlockInfo) (string, error)

RenderBlock compile special block by render pipeline

type File

type File struct {
	Path      string
	Extension string
}

File information about file

func GasFiles

func GasFiles(extensions []string) ([]File, error)

GasFiles find files for builder in current directory

func GasFilesCustomDir

func GasFilesCustomDir(root string, extensions []string) ([]File, error)

GasFilesCustomDir find files for builder in directory

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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