docs: Improve file resource documentation

Info on how to create a directory.
Explain more parameter options.
This commit is contained in:
Carsten Thiel
2018-02-07 11:06:33 +01:00
parent adbe9c7be1
commit eb33a5a5df

View File

@@ -42,15 +42,16 @@ func init() {
RegisterResource("file", func() Res { return &FileRes{} }) RegisterResource("file", func() Res { return &FileRes{} })
} }
// FileRes is a file and directory resource. // FileRes is a file and directory resource. Dirs are defined by names ending
// in a slash.
type FileRes struct { type FileRes struct {
BaseRes `yaml:",inline"` BaseRes `yaml:",inline"`
Path string `yaml:"path"` // path variable (should default to name) Path string `yaml:"path"` // path variable (usually defaults to name)
Dirname string `yaml:"dirname"` Dirname string `yaml:"dirname"` // override the path dirname
Basename string `yaml:"basename"` Basename string `yaml:"basename"` // override the path basename
Content *string `yaml:"content"` // nil to mark as undefined Content *string `yaml:"content"` // nil to mark as undefined
Source string `yaml:"source"` // file path for source content Source string `yaml:"source"` // file path for source content
State string `yaml:"state"` // state: exists/present?, absent, (undefined?) State string `yaml:"state"` // state: exists/present?, absent, (undefined?)
Owner string `yaml:"owner"` Owner string `yaml:"owner"`
Group string `yaml:"group"` Group string `yaml:"group"`
Mode string `yaml:"mode"` Mode string `yaml:"mode"`