deckformat

package
v0.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 31, 2023 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	VersionKey   = "_format_version"
	TransformKey = "_transform"
)

Variables

This section is empty.

Functions

func CompatibleFile

func CompatibleFile(data1 map[string]interface{}, data2 map[string]interface{}) error

CompatibleFile returns nil if the files are compatible. An error otherwise. see CompatibleVersion and CompatibleTransform for what compatibility means.

func CompatibleTransform

func CompatibleTransform(data1 map[string]interface{}, data2 map[string]interface{}) error

CompatibleTransform checks if 2 files are compatible, by '_transform' keys. Returns nil if compatible, and error otherwise.

func CompatibleVersion

func CompatibleVersion(data1 map[string]interface{}, data2 map[string]interface{}) error

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 ParseFormatVersion

func ParseFormatVersion(data map[string]interface{}) (int, int, error)

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.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL