Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidFamily = errors.New("invalid schema family") ErrInvalidVersion = errors.New("invalid schema version") )
Functions ¶
This section is empty.
Types ¶
type RevisionV1 ¶ added in v0.78.0
type RevisionV1 struct {
// contains filtered or unexported fields
}
RevisionV1 represents all changes that are to be applied to a signal at a given version.
func NewRevision ¶ added in v0.78.0
func NewRevision(ver *Version, def ast.VersionDef) *RevisionV1
NewRevision processes the VersionDef and assigns the version to this revision to allow sorting within a slice. Since VersionDef uses custom types for various definitions, it isn't possible to cast those values into the primitives so each has to be processed together. Generics would be handy here.
type Version ¶
type Version struct {
Major, Minor, Patch int
}
Version is a machine readable version of the string schema identifier that can assist in making indexing easier
func GetFamilyAndVersion ¶
GetFamilyAndVersion takes a schemaURL and separates the family from the identifier.
func NewVersion ¶
NewVersion converts a near semver like string (ie 1.4.0) into a schema identifier that is comparable for a machine. The expected string format can be matched by the following regex: [0-9]+\.[0-9]+\.[0-9]+
func ReadVersionFromPath ¶
ReadVersionFromPath allows for parsing paths that end in a schema version number string
func (*Version) Compare ¶
Compare returns a digit to represent if the v is equal, less than, or greater than o. The values are 0, -1 and 1 respectively.