Documentation
¶
Index ¶
- Constants
- func CompatibleFile(data1 map[string]interface{}, data2 map[string]interface{}) error
- func CompatibleTransform(data1 map[string]interface{}, data2 map[string]interface{}) error
- func CompatibleVersion(data1 map[string]interface{}, data2 map[string]interface{}) error
- func HistoryAppend(filedata map[string]interface{}, newEntry interface{})
- func HistoryClear(filedata map[string]interface{})
- func HistoryGet(filedata map[string]interface{}) (historyArray []interface{})
- func HistoryNewEntry(cmd string) map[string]interface{}
- func HistorySet(filedata map[string]interface{}, historyArray []interface{})
- func ParseFormatVersion(data map[string]interface{}) (int, int, error)
- func ToolVersionGet() (name string, version string, commit string)
- func ToolVersionSet(name string, version string, commit string)
- func ToolVersionString() string
Constants ¶
const ( VersionKey = "_format_version" TransformKey = "_transform" HistoryKey = "_ignore" // the top-level key in deck files for storing history info )
Variables ¶
This section is empty.
Functions ¶
func CompatibleFile ¶
CompatibleFile returns nil if the files are compatible. An error otherwise. see CompatibleVersion and CompatibleTransform for what compatibility means.
func CompatibleTransform ¶
CompatibleTransform checks if 2 files are compatible, by '_transform' keys. Returns nil if compatible, and error otherwise.
func CompatibleVersion ¶
CompatibleVersion checks if 2 files are compatible, by '_format_version'. Version is compatible if they are the same major. Missing versions are assumed to be compatible. Returns nil if compatible, and error otherwise.
func HistoryAppend ¶ added in v0.1.10
func HistoryAppend(filedata map[string]interface{}, newEntry interface{})
HistoryAppend appends an entry (if non-nil) to the history info array. If there is no array, it will create one.
func HistoryClear ¶ added in v0.1.10
func HistoryClear(filedata map[string]interface{})
func HistoryGet ¶ added in v0.1.10
func HistoryGet(filedata map[string]interface{}) (historyArray []interface{})
HistoryGet returns a the history info array. If there is none, or if filedata is nil, it will return an empty one.
func HistoryNewEntry ¶ added in v0.1.10
HistoryNewEntry returns a new JSONobject with tool version and command keys set.
func HistorySet ¶ added in v0.1.10
func HistorySet(filedata map[string]interface{}, historyArray []interface{})
HistorySet sets the history info array. Setting to nil will delete the history.
func ParseFormatVersion ¶
parseFormatVersion parses field `_format_version` and returns major+minor. Field must be present, a string, and have an 'x.y' format. Returns an error otherwise.
func ToolVersionGet ¶ added in v0.1.10
ToolVersionGet returns the individual components of the info
func ToolVersionSet ¶ added in v0.1.10
ToolVersionSet can be called once to set the tool info that is reported in the history.
func ToolVersionString ¶ added in v0.1.10
func ToolVersionString() string
ToolVersionString returns the info in a single formatted string. eg. "decK 1.2 (123abc)"
Types ¶
This section is empty.