Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var PluginStructure = Dir{ "DragonInfo.toml": File{}, "commands": Dir{ "init.lua": File{}, }, "server": Dir{ "init.lua": File{}, }, "client": Dir{ "init.lua": File{}, }, "views": Dir{}, }
PluginStructure represents what a plugin is intended to look like.
var ProjectStructure = Dir{ "Dragonfile.toml": File{}, ".gitignore": File{}, "plugins": Dir{}, "commands": Dir{ "init.lua": File{}, }, "server": Dir{ "init.lua": File{}, }, "client": Dir{ "init.lua": File{}, }, "views": Dir{}, }
ProjectStructure is a skeleton of what a `DragonMUD` project should look like after `dragon init` is called.
Functions ¶
func CreateFromStructure ¶
func CreateFromStructure(params CreateStructureParams) error
CreateFromStructure takes in an fs.Item and generates the filesystem records (files and directories) according the structure provided. This is a recursive operation, calling itself for all instances of ItemTypeDir.
Types ¶
type CreateStructureParams ¶
type CreateStructureParams struct { Log logger.Log BaseName string Structure Item TemplateData interface{} }
CreateStructureParams makes it easier and more meaningful to call CreateFromStructure.
type Dir ¶
Dir is a map of Items. This allows you to define in a simplified way complex (or simple) file structure.
type File ¶
type File struct{}
File wraps a string and represents a file with that name in the given location on the file system.