Documentation
¶
Index ¶
- func FileWrite(pathFile string, data bytes.Buffer) error
- func NewHtmlHandler(ac *AssetConfig) *asset
- func NewSvgHandler(ac *AssetConfig) *asset
- type AssetConfig
- type AssetMin
- func (c *AssetMin) EnsureOutputDirectoryExists()
- func (c *AssetMin) NewFileEvent(fileName, extension, filePath, event string) error
- func (c *AssetMin) NotifyIfOutputFilesExist()
- func (c *AssetMin) UnobservedFiles() []string
- func (c *AssetMin) UpdateFileContentInMemory(filePath, extension, event string, content []byte) (*asset, error)
- type TestEnvironment
- func (env *TestEnvironment) CleanDirectory()
- func (env *TestEnvironment) CreateModulesDir() *TestEnvironment
- func (env *TestEnvironment) CreatePublicDir() *TestEnvironment
- func (env *TestEnvironment) CreateThemeDir() *TestEnvironment
- func (env *TestEnvironment) TestConcurrentFileProcessing(fileExtension string, fileCount int)
- func (env *TestEnvironment) TestFileCRUDOperations(fileExtension string)
- func (env *TestEnvironment) TestJSInitCodePriority()
- func (env *TestEnvironment) TestThemePriority(fileExtension string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileWrite ¶
pathFile e.g., "theme/htmlMainFileName" data e.g., *bytes.Buffer NOTE: The buffer data will be cleared after writing the file
func NewHtmlHandler ¶ added in v0.0.20
func NewHtmlHandler(ac *AssetConfig) *asset
func NewSvgHandler ¶ added in v0.0.19
func NewSvgHandler(ac *AssetConfig) *asset
Types ¶
type AssetConfig ¶ added in v0.0.12
type AssetMin ¶
type AssetMin struct { *AssetConfig WriteOnDisk bool // Indica si se debe escribir en disco // contains filtered or unexported fields }
func NewAssetMin ¶ added in v0.0.5
func NewAssetMin(ac *AssetConfig) *AssetMin
func (*AssetMin) EnsureOutputDirectoryExists ¶ added in v0.0.5
func (c *AssetMin) EnsureOutputDirectoryExists()
crea el directorio de salida si no existe
func (*AssetMin) NewFileEvent ¶
event: create, remove, write, rename
func (*AssetMin) NotifyIfOutputFilesExist ¶ added in v0.0.37
func (c *AssetMin) NotifyIfOutputFilesExist()
NotifyIfOutputFilesExist checks if the output files for all assets already exist
func (*AssetMin) UnobservedFiles ¶
type TestEnvironment ¶ added in v0.0.3
type TestEnvironment struct { BaseDir string ThemeDir string PublicDir string ModulesDir string MainJsPath string MainCssPath string MainSvgPath string MainHtmlPath string AssetsHandler *AssetMin // contains filtered or unexported fields }
TestEnvironment holds all the paths and components needed for asset tests
func (*TestEnvironment) CleanDirectory ¶ added in v0.0.3
func (env *TestEnvironment) CleanDirectory()
CleanDirectory removes all content from the test directory but keeps the directory itself
func (*TestEnvironment) CreateModulesDir ¶ added in v0.0.4
func (env *TestEnvironment) CreateModulesDir() *TestEnvironment
CreateModulesDir creates the modules directory if it doesn't exist
func (*TestEnvironment) CreatePublicDir ¶ added in v0.0.4
func (env *TestEnvironment) CreatePublicDir() *TestEnvironment
CreatePublicDir creates the public directory if it doesn't exist
func (*TestEnvironment) CreateThemeDir ¶ added in v0.0.4
func (env *TestEnvironment) CreateThemeDir() *TestEnvironment
CreateThemeDir creates the theme directory if it doesn't exist
func (*TestEnvironment) TestConcurrentFileProcessing ¶ added in v0.0.9
func (env *TestEnvironment) TestConcurrentFileProcessing(fileExtension string, fileCount int)
TestConcurrentFileProcessing is a reusable function to test concurrent file processing for both JS and CSS.
func (*TestEnvironment) TestFileCRUDOperations ¶ added in v0.0.11
func (env *TestEnvironment) TestFileCRUDOperations(fileExtension string)
TestFileCRUDOperations tests the complete CRUD cycle (create, write, remove) for a file
func (*TestEnvironment) TestJSInitCodePriority ¶ added in v0.0.29
func (env *TestEnvironment) TestJSInitCodePriority()
TestJSInitCodePriority verifica que el código de inicialización JS aparece al principio del archivo generado
func (*TestEnvironment) TestThemePriority ¶ added in v0.0.15
func (env *TestEnvironment) TestThemePriority(fileExtension string)
TestThemePriority tests that files in 'theme' folder appear before files in 'modules' folder