semver

package
v2.18.1 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Semver

type Semver struct {
	*semverlib.Version
}

Semver is struct that encapsulates semver.Semver struct so we can use it in API +k8s:deepcopy-gen=true

func NewSemver

func NewSemver(ver string) (*Semver, error)

NewSemver creates new Semver version struct and returns pointer to it

func NewSemverOrDie

func NewSemverOrDie(ver string) *Semver

NewSemverOrDie behaves similar to NewVersion, i.e. it creates new Semver version struct, but panics if an error happens

func (Semver) DeepCopy

func (s Semver) DeepCopy() Semver

DeepCopy copies value of Semver struct and returns a new struct. If passed Semver struct is nil, it is assumed zero value is being copied

func (*Semver) DeepCopyInto

func (in *Semver) DeepCopyInto(out *Semver)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Semver) Equal

func (s *Semver) Equal(b *Semver) bool

Equal compares two version structs by comparing Semver values

func (*Semver) MajorMinor

func (s *Semver) MajorMinor() string

MajorMinor returns a string like "Major.Minor"

func (Semver) MarshalJSON

func (s Semver) MarshalJSON() ([]byte, error)

MarshalJSON converts Semver struct to JSON

func (*Semver) Semver

func (s *Semver) Semver() *semverlib.Version

Semver returns library semver struct

func (*Semver) Set added in v2.17.0

func (s *Semver) Set(ver string) error

Set initializes semver struct and sets version

func (*Semver) String

func (s *Semver) String() string

String returns string representation of Semver version

func (*Semver) UnmarshalJSON

func (s *Semver) UnmarshalJSON(data []byte) error

UnmarshalJSON converts JSON to Semver struct

Jump to

Keyboard shortcuts

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