Documentation ¶
Overview ¶
Package composer implements the Composite design pattern used to manage files and folder structure for sveltin projects and artifacts.
Index ¶
- type Component
- type File
- type Folder
- func GetAPIFolder(maker *pathmaker.SveltinPathMaker) *Folder
- func GetConfigFolder(maker *pathmaker.SveltinPathMaker) *Folder
- func GetContentFolder(maker *pathmaker.SveltinPathMaker) *Folder
- func GetLibFolder(maker *pathmaker.SveltinPathMaker) *Folder
- func GetParamsFolder(maker *pathmaker.SveltinPathMaker) *Folder
- func GetRootFolder(maker *pathmaker.SveltinPathMaker) *Folder
- func GetRoutesFolder(maker *pathmaker.SveltinPathMaker) *Folder
- func GetStaticFolder(maker *pathmaker.SveltinPathMaker) *Folder
- func GetThemesFolder(maker *pathmaker.SveltinPathMaker) *Folder
- func NewFolder(name string) *Folder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Component ¶
type Component interface { GetName() string SetName(string) SetPath(string) Create(*factory.Artifact) error }
Component describes operations common to elements of the tree.
type File ¶
type File struct { Name string TemplateID string TemplateData *config.TemplateData // contains filtered or unexported fields }
File is the main struct representing a file to be generated by sveltin cmds.
func (*File) Create ¶
Create is resposibile to execute the file template providing the info needed by the builder get the content and save the newly creted file on the file system.
func (*File) GetTemplateData ¶
func (f *File) GetTemplateData() *config.TemplateData
GetTemplateData returns a TemplateData struct the file.
func (*File) GetTemplateID ¶
GetTemplateID returns a string representing the template id for the file.
type Folder ¶
type Folder struct { Name string // contains filtered or unexported fields }
Folder is the struct representing a folder on the file system.
func GetAPIFolder ¶
func GetAPIFolder(maker *pathmaker.SveltinPathMaker) *Folder
GetAPIFolder create a Folder struct for the "src/routes/api" folder of the project.
func GetConfigFolder ¶
func GetConfigFolder(maker *pathmaker.SveltinPathMaker) *Folder
GetConfigFolder create a Folder struct for the "config" folder of the project.
func GetContentFolder ¶
func GetContentFolder(maker *pathmaker.SveltinPathMaker) *Folder
GetContentFolder create a Folder struct for the "content" folder of the project.
func GetLibFolder ¶
func GetLibFolder(maker *pathmaker.SveltinPathMaker) *Folder
GetLibFolder create a Folder struct for the "src/lib" folder of the project.
func GetParamsFolder ¶
func GetParamsFolder(maker *pathmaker.SveltinPathMaker) *Folder
GetParamsFolder create a Folder struct for the "src/params" folder of the project.
func GetRootFolder ¶
func GetRootFolder(maker *pathmaker.SveltinPathMaker) *Folder
GetRootFolder create a Folder struct for the project root folder.
func GetRoutesFolder ¶
func GetRoutesFolder(maker *pathmaker.SveltinPathMaker) *Folder
GetRoutesFolder create a Folder struct for the "src/routes" folder of the project.
func GetStaticFolder ¶
func GetStaticFolder(maker *pathmaker.SveltinPathMaker) *Folder
GetStaticFolder create a Folder struct for the "static" folder of the project.
func GetThemesFolder ¶
func GetThemesFolder(maker *pathmaker.SveltinPathMaker) *Folder
GetThemesFolder create a Folder struct for the "themes" folder of the project.
func (*Folder) Create ¶
Create is the function to create the entire folder structure on the file system.
func (*Folder) GetComponents ¶
GetComponents returns the slice of component for a Folder struct.