generate

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package generate provides an api for the domain.

Index

Constants

View Source
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 Directories

type Directories []*Directory

Directories is a collection of Directory.

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 File

type File struct {
	// contains filtered or unexported fields
}

File in the project.

func NewFile

func NewFile(name, template string) *File

NewFile returns an instance of File.

type FileTemplates

type FileTemplates map[string]string

FileTemplates is a map of file and its template.

type Files

type Files []*File

Files is a collection of File.

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

func NewMetadata(metadata map[string]string) *Metadata

NewMetadata returns an instance of Metadata.

func (*Metadata) GetDestinationPath

func (m *Metadata) GetDestinationPath() string

GetDestinationPath returns destination path where the project will be created.

func (*Metadata) GetTemplatePath

func (m *Metadata) GetTemplatePath() string

GetTemplatePath returns location of templates.

func (*Metadata) GetValuesPath

func (m *Metadata) GetValuesPath() string

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.

Jump to

Keyboard shortcuts

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