Documentation
¶
Index ¶
- func FileWrite(pathFile string, data bytes.Buffer) error
- func NewFileHandler(outputName, mediaType string, ac *AssetConfig, initCode func() (string, error)) *fileHandler
- func NewHtmlHandler(ac *AssetConfig) *indexHtmlHandler
- func NewSvgHandler(ac *AssetConfig) *fileHandler
- type AssetConfig
- type AssetMin
- 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) 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 NewFileHandler ¶ added in v0.0.21
func NewFileHandler(outputName, mediaType string, ac *AssetConfig, initCode func() (string, error)) *fileHandler
NewFileHandler creates a new fileHandler with the specified parameters
func NewHtmlHandler ¶ added in v0.0.20
func NewHtmlHandler(ac *AssetConfig) *indexHtmlHandler
func NewSvgHandler ¶ added in v0.0.19
func NewSvgHandler(ac *AssetConfig) *fileHandler
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) 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) 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