Documentation
¶
Index ¶
- Constants
- Variables
- type CSV
- func (c *CSV) Changelog() string
- func (c *CSV) Condition(source string) (bool, error)
- func (c *CSV) ConditionFromSCM(source string, scm scm.ScmHandler) (bool, error)
- func (c *CSV) Read() error
- func (c *CSV) ReadFromFile() error
- func (c *CSV) Source(workingDir string) (string, error)
- func (c *CSV) Target(source string, dryRun bool) (changed bool, err error)
- func (c *CSV) TargetFromSCM(source string, scm scm.ScmHandler, dryRun bool) (changed bool, files []string, message string, err error)
- func (c *CSV) Validate() (err error)
- func (c *CSV) WriteToFile(resourceFile string) error
- type Spec
Constants ¶
View Source
const ( // DEFAULTSEPARATOR defines the default csv separator DEFAULTSEPARATOR rune = ',' // DEFAULTCOMMENT defines the default comment character DEFAULTCOMMENT rune = '#' )
Variables ¶
View Source
var ( // ErrDaselFailedParsingJSONByteFormat is returned if dasel couldn't parse the byteData ErrDaselFailedParsingJSONByteFormat error = errors.New("fail to parse Json data") // ErrWrongSpec is returned when the Spec has wrong content ErrWrongSpec error = errors.New("wrong spec content") )
View Source
var ( ErrSpecFileUndefined = errors.New("csv file not specified") ErrSpecKeyUndefined = errors.New("csv key undefined") )
Functions ¶
This section is empty.
Types ¶
type CSV ¶
type CSV struct {
// contains filtered or unexported fields
}
CSV stores configuration about the file and the key value which needs to be updated.
func (*CSV) Changelog ¶
Changelog returns the changelog for this resource, or an empty string if not supported
func (*CSV) ConditionFromSCM ¶
func (*CSV) ReadFromFile ¶
func (*CSV) TargetFromSCM ¶
func (c *CSV) TargetFromSCM(source string, scm scm.ScmHandler, dryRun bool) (changed bool, files []string, message string, err error)
TargetFromSCM updates a scm repository based on the modified yaml file.
func (*CSV) WriteToFile ¶
type Spec ¶
type Spec struct {
// [s][c][t] File specifies the csv file
File string `yaml:",omitempty"`
// [s][c][t] Key specifies the csv query
Key string `yaml:",omitempty"`
// [s][c][t] Key specifies the csv value, default to source output
Value string `yaml:",omitempty"`
// [s][c][t] Comma specifies the csv separator character, default ","
Comma rune `yaml:",omitempty"`
// [s][c][t] Comma specifies the csv comment character, default "#"
Comment rune `yaml:",omitempty"`
// [c][t] Multiple allows to query multiple values at once
Multiple bool `yaml:",omitempty"`
}
Click to show internal directories.
Click to hide internal directories.