versions

package
v2.0.37 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2024 License: Apache-2.0 Imports: 7 Imported by: 27

Documentation

Index

Constants

This section is empty.

Variables

View Source
var StdVersionEncDec = VersionEncDecImpl{}

Functions

This section is empty.

Types

type DefaultVersionProvider added in v2.0.30

type DefaultVersionProvider struct {
	SourceBranch string
	VersionInfo
}

func (DefaultVersionProvider) AsVersionInfo added in v2.0.30

func (v DefaultVersionProvider) AsVersionInfo() *VersionInfo

func (DefaultVersionProvider) Branch added in v2.0.30

func (v DefaultVersionProvider) Branch() string

func (DefaultVersionProvider) BuildDate added in v2.0.30

func (v DefaultVersionProvider) BuildDate() string

func (DefaultVersionProvider) EncoderDecoder added in v2.0.30

func (v DefaultVersionProvider) EncoderDecoder() VersionEncDec

func (DefaultVersionProvider) Revision added in v2.0.30

func (v DefaultVersionProvider) Revision() string

func (DefaultVersionProvider) Version added in v2.0.30

func (v DefaultVersionProvider) Version() string

type SemVer

type SemVer struct {
	// contains filtered or unexported fields
}

func MustParseSemVer

func MustParseSemVer(version string) *SemVer

func ParseSemVer

func ParseSemVer(version string) (*SemVer, error)

func (*SemVer) CompareTo

func (self *SemVer) CompareTo(version *SemVer) int

func (*SemVer) Equals

func (self *SemVer) Equals(version *SemVer) bool

func (*SemVer) String

func (self *SemVer) String() string

type VersionEncDec

type VersionEncDec interface {
	Encode(*VersionInfo) ([]byte, error)
	Decode([]byte) (*VersionInfo, error)
}

type VersionEncDecImpl

type VersionEncDecImpl struct{}

func (*VersionEncDecImpl) Decode

func (encDec *VersionEncDecImpl) Decode(info []byte) (*VersionInfo, error)

func (*VersionEncDecImpl) Encode

func (encDec *VersionEncDecImpl) Encode(info *VersionInfo) ([]byte, error)

type VersionInfo

type VersionInfo struct {
	Version   string
	Revision  string
	BuildDate string
	OS        string
	Arch      string
}

func (*VersionInfo) GetVersion

func (self *VersionInfo) GetVersion() (*SemVer, error)

func (*VersionInfo) HasMinimumVersion

func (self *VersionInfo) HasMinimumVersion(compareVersionStr string) (bool, error)

type VersionProvider

type VersionProvider interface {
	Version() string
	BuildDate() string
	Revision() string
	Branch() string
	AsVersionInfo() *VersionInfo
	EncoderDecoder() VersionEncDec
}

func NewDefaultVersionProvider added in v2.0.30

func NewDefaultVersionProvider() VersionProvider

Jump to

Keyboard shortcuts

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