Documentation
¶
Overview ¶
Package version provides functionality for NeoFS versioning.
NeoFS uses NeoFS API versioning scheme. It uses major and minor version of the API.
Index ¶
- func EncodeToString(v Version) string
- type Version
- func (v *Version) DecodeString(s string) error
- func (v *Version) FromProtoMessage(m *refs.Version) error
- func (v Version) Major() uint32
- func (v Version) MarshalJSON() ([]byte, error)
- func (v Version) Minor() uint32
- func (v Version) ProtoMessage() *refs.Version
- func (v *Version) SetMajor(val uint32)
- func (v *Version) SetMinor(val uint32)
- func (v Version) String() string
- func (v *Version) UnmarshalJSON(data []byte) error
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 ¶
type Version struct {
// contains filtered or unexported fields
}
Version represents revision number in SemVer scheme.
ID implements built-in comparable interface.
Version is mutually compatible with refs.Version message. See Version.FromProtoMessage / Version.ProtoMessage methods.
Instances should be created using one of the constructors.
func Current ¶
func Current() (v Version)
Current returns Version instance that initialized to the latest supported NeoFS API revision number in SDK.
func UnmarshalJSON ¶
UnmarshalJSON creates new Version and makes Version.UnmarshalJSON.
func (*Version) DecodeString ¶
DecodeString is the inverse of [String], it parses string representation of Version and sets the value accordingly.
func (*Version) FromProtoMessage ¶
FromProtoMessage validates m according to the NeoFS API protocol and restores v from it.
See also Version.ProtoMessage.
func (Version) MarshalJSON ¶
MarshalJSON encodes Version into a JSON format of the NeoFS API protocol (Protocol Buffers JSON).
See also UnmarshalJSON.
func (Version) ProtoMessage ¶
ProtoMessage converts v into message to transmit using the NeoFS API protocol.
See also Version.FromProtoMessage.
func (Version) String ¶
String implements fmt.Stringer.
String is designed to be human-readable, and its format MAY differ between SDK versions.
func (*Version) UnmarshalJSON ¶
UnmarshalJSON decodes NeoFS API protocol JSON format into the Version (Protocol Buffers JSON). Returns an error describing a format violation. Use UnmarshalJSON to decode data into a new Version.
See also MarshalJSON.