translation

package
v0.76.2 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidFamily  = errors.New("invalid schema family")
	ErrInvalidVersion = errors.New("invalid schema version")
)

Functions

This section is empty.

Types

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

func GetFamilyAndVersion(schemaURL string) (family string, version *Version, err error)

GetFamilyAndVersion takes a schemaURL and separates the family from the identifier.

func NewVersion

func NewVersion(s string) (*Version, error)

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

func ReadVersionFromPath(p string) (*Version, error)

ReadVersionFromPath allows for parsing paths that end in a schema version number string

func (*Version) Compare

func (v *Version) Compare(o *Version) int

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.

func (*Version) Equal

func (v *Version) Equal(o *Version) bool

func (*Version) GreaterThan

func (v *Version) GreaterThan(o *Version) bool

func (*Version) LessThan

func (v *Version) LessThan(o *Version) bool

func (*Version) String

func (v *Version) String() string

Jump to

Keyboard shortcuts

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