Documentation ¶
Index ¶
- type File
- func (f *File) Changelog() string
- func (f *File) Condition(source string, scm scm.ScmHandler, resultCondition *result.Condition) error
- func (f *File) Read() error
- func (f *File) Source(workingDir string, resultSource *result.Source) error
- func (f *File) Target(source string, scm scm.ScmHandler, dryRun bool, resultTarget *result.Target) error
- func (f *File) UpdateAbsoluteFilePath(workDir string)
- type Spec
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type File ¶
type File struct {
// contains filtered or unexported fields
}
File defines a resource of kind "file"
func New ¶
New returns a reference to a newly initialized File object from a Spec or an error if the provided Filespec triggers a validation error.
func (*File) Changelog ¶
Changelog returns the changelog for this resource, or an empty string if not supported
func (*File) Condition ¶
func (f *File) Condition(source string, scm scm.ScmHandler, resultCondition *result.Condition) error
ConditionFromSCM test if a file content from SCM match the content provided via configuration. If the configuration doesn't specify a value then it fall back to the source output
func (*File) Read ¶
Read puts the content of the file(s) as value of the f.files map if the file(s) exist(s) or log the non existence of the file
func (*File) Target ¶
func (f *File) Target(source string, scm scm.ScmHandler, dryRun bool, resultTarget *result.Target) error
Target creates or updates a file from a source control management system. The default content is the value retrieved from source
func (*File) UpdateAbsoluteFilePath ¶ added in v0.50.0
type Spec ¶
type Spec struct { // File contains the file path(s) to take in account and is incompatible with Files File string `yaml:",omitempty"` // Files contains the file path(s) to take in account and is incompatible with File Files []string `yaml:",omitempty"` // Line contains the line of the file(s) to take in account Line int `yaml:",omitempty"` // Content specifies the content to take in account instead of the file content Content string `yaml:",omitempty"` // ForceCreate specifies if nonexistent file(s) should be created if they are targets ForceCreate bool `yaml:",omitempty"` // MatchPattern specifies the regexp pattern to match on the file(s) MatchPattern string `yaml:",omitempty"` // ReplacePattern specifies the regexp replace pattern to apply on the file(s) content ReplacePattern string `yaml:",omitempty"` }
Spec defines a specification for a "file" resource parsed from an updatecli manifest file