Documentation ¶
Overview ¶
Package generate provides an api for the domain.
Index ¶
Constants ¶
const ( MetaDataOutputKey = "output" MetaDataTemplatesKey = "templates" MetaDataValuesKey = "values" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigurationFile ¶
type ConfigurationFile struct {
// contains filtered or unexported fields
}
ConfigurationFile is the yaml file that specifies the project structure and the files that go into it.
func NewConfigurationFile ¶
func NewConfigurationFile(metadata *Metadata, directories Directories) *ConfigurationFile
NewConfigurationFile returns an instance of ConfigurationFile.
func NewTestConfigurationFile ¶
func NewTestConfigurationFile() *ConfigurationFile
NewTestConfigurationFile returns a test ConfigurationFile you can use in unit tests.
type Directory ¶
type Directory struct {
// contains filtered or unexported fields
}
Directory in the project structure.
func NewDirectory ¶
func NewDirectory(name string, files Files, directories Directories) *Directory
NewDirectory returns an instance of Directory.
type DirectoryStructureCreator ¶
type DirectoryStructureCreator interface {
CreateDirectoryStructure(ctx context.Context, output string, directories []string) error
}
DirectoryStructureCreator defines CreateDirectoryStructure.
type FileTemplates ¶
FileTemplates is a map of file and its template.
type FilesCreator ¶
type FilesCreator interface {
CreateFiles(ctx context.Context, metadata *Metadata, files FileTemplates) error
}
FilesCreator interface defines CreateFiles.
type Metadata ¶
type Metadata struct {
// contains filtered or unexported fields
}
Metadata about the project.
func NewMetadata ¶
NewMetadata returns an instance of Metadata.
func (*Metadata) GetDestinationPath ¶
GetDestinationPath returns destination path where the project will be created.
func (*Metadata) GetTemplatePath ¶
GetTemplatePath returns location of templates.
func (*Metadata) GetValuesPath ¶
GetValuesPath returns location of values.
type ProjectUseCase ¶
type ProjectUseCase struct {
// contains filtered or unexported fields
}
ProjectUseCase creates the project directory structure and files.
func NewProjectUseCase ¶
func NewProjectUseCase(structureCreator DirectoryStructureCreator, fileCreator FilesCreator) *ProjectUseCase
NewProjectUseCase returns an instance of ProjectUseCase.
func (*ProjectUseCase) ScaffoldProject ¶
func (useCase *ProjectUseCase) ScaffoldProject(ctx context.Context, configFile *ConfigurationFile) error
ScaffoldProject using the provided ConfigurationFile.