Documentation ¶
Overview ¶
Package version provides functionality for FrostFS versioning.
FrostFS uses FrostFS API versioning scheme. It uses major and minor version of the API.
In most of the cases it will be enough to use the latest supported FrostFS API version in SDK:
ver := version.Current()
It is possible to specify arbitrary version by setting major and minor numbers:
var ver version.Version ver.SetMajor(2) ver.SetMinor(5)
Index ¶
- func EncodeToString(v Version) string
- type Version
- func (v Version) Equal(v2 Version) bool
- func (v *Version) Major() uint32
- func (v *Version) Minor() uint32
- func (v *Version) ReadFromV2(m refs.Version) error
- func (v *Version) SetMajor(val uint32)
- func (v *Version) SetMinor(val uint32)
- func (v Version) String() string
- func (v Version) WriteToV2(m *refs.Version)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodeToString ¶
EncodeToString encodes version according to format from specification: semver formatted value without patch and with v prefix, e.g. 'v2.1'.
Types ¶
type Version ¶
Version represents revision number in SemVer scheme.
Version is mutually compatible with github.com/TrueCloudLab/frostfs-api-go/v2/refs.Version message. See ReadFromV2 / WriteToV2 methods.
Instances can be created using built-in var declaration.
Note that direct typecast is not safe and may result in loss of compatibility:
_ = Version(refs.Version{}) // not recommended
func Current ¶
func Current() (v Version)
Current returns Version instance that initialized to the latest supported FrostFS API revision number in SDK.
func (*Version) ReadFromV2 ¶
ReadFromV2 reads Version from the refs.Version message. Checks if the message conforms to FrostFS API V2 protocol.
See also WriteToV2.