Documentation ¶
Index ¶
Constants ¶
View Source
const ( DirPath = PathType(false) FilePath = PathType(true) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileNodeProvider ¶
type FileNodeProvider interface {
// contains filtered or unexported methods
}
func Dir ¶
func Dir(name NodeName, alias string, children ...FileNodeProvider) FileNodeProvider
func File ¶
func File(name NodeName, alias string) FileNodeProvider
func OptionalDir ¶
func OptionalDir(name NodeName, children ...FileNodeProvider) FileNodeProvider
type LayoutSpec ¶
type LayoutSpec interface { FileNodeProvider CreateDirectoryStructure(root string, values TemplateValues, includeOptional bool) error RootDirName(values TemplateValues) string Paths(values TemplateValues, includeOptional bool) []string // Validate validates the provided root directory against this specification using the provided template values. If the // provided directory matches the specification, the function returns nil. If the function encounters an error while // trying to perform a verification or if the provided structure does not match the specification, an error is returned. Validate(root string, values TemplateValues) error // contains filtered or unexported methods }
LayoutSpec represents the specification of a layout.
func NewLayoutSpec ¶
func NewLayoutSpec(root FileNodeProvider, rootPartOfSpec bool) LayoutSpec
type Mode ¶
type Mode int
const ( // SpecOnly specifies that a specification should be created without performing validation or creating paths. SpecOnly Mode = iota // Validate specifies that an existing directory should be validated using the specification. Validate // Create specifies that the specification should create a directory structure that matches the specification. Create )
type NodeName ¶
type NodeName interface {
// contains filtered or unexported methods
}
NodeName represents the name of a node and returns a value for its name given a TemplateValues object. An empty string is returned if a name cannot be generated based on the input.
func CompositeName ¶
func LiteralName ¶
func TemplateName ¶
type SpecDir ¶
SpecDir is a concrete application of a LayoutSpec. It is rooted at a directory and has TemplateValues specified.
func New ¶
func New(rootDir string, spec LayoutSpec, values TemplateValues, mode Mode) (SpecDir, error)
type TemplateValues ¶
Click to show internal directories.
Click to hide internal directories.