translation

package
v0.118.0 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2025 License: Apache-2.0 Imports: 10 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 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. V1 represents the fact that this struct only support the Schema Files version 1.0 - not 1.1 which contains split. todo(ankit) implement split and rest of otel schema

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. todo(ankit) investigate using generics

func (RevisionV1) Version added in v0.115.0

func (r RevisionV1) Version() *Version

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