From eb33a5a5df614d06d5f409106c767d32f5c37937 Mon Sep 17 00:00:00 2001 From: Carsten Thiel Date: Wed, 7 Feb 2018 11:06:33 +0100 Subject: [PATCH] docs: Improve file resource documentation Info on how to create a directory. Explain more parameter options. --- resources/file.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/resources/file.go b/resources/file.go index 440c119d..35fb4a92 100644 --- a/resources/file.go +++ b/resources/file.go @@ -42,15 +42,16 @@ func init() { 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 { BaseRes `yaml:",inline"` - Path string `yaml:"path"` // path variable (should default to name) - Dirname string `yaml:"dirname"` - Basename string `yaml:"basename"` - Content *string `yaml:"content"` // nil to mark as undefined - Source string `yaml:"source"` // file path for source content - State string `yaml:"state"` // state: exists/present?, absent, (undefined?) + Path string `yaml:"path"` // path variable (usually defaults to name) + Dirname string `yaml:"dirname"` // override the path dirname + Basename string `yaml:"basename"` // override the path basename + Content *string `yaml:"content"` // nil to mark as undefined + Source string `yaml:"source"` // file path for source content + State string `yaml:"state"` // state: exists/present?, absent, (undefined?) Owner string `yaml:"owner"` Group string `yaml:"group"` Mode string `yaml:"mode"`