docs: Improve file resource documentation
Info on how to create a directory. Explain more parameter options.
This commit is contained in:
@@ -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"`
|
||||||
|
|||||||
Reference in New Issue
Block a user