version

package
v0.0.0-...-dab54ce Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2017 License: LGPL-3.0 Imports: 6 Imported by: 6

Documentation

Overview

Package version holds spores version management internal logic.

Index

Constants

View Source
const VersionBytes = sha512.Size

VersionBytes is the space used by the version when marshalled.

Variables

View Source
var ErrVersionMismatch = errors.New("the stored version does not match with required version")

ErrVersionMismatch is returned when two versions are not matching.

View Source
var NoVersion = &V{}

NoVersion is the default version that should be returned when no version is available in one store for a specific key.

Functions

This section is empty.

Types

type V

type V struct {
	Hash []byte `protobuf:"bytes,1,opt,name=hash,proto3" json:"hash,omitempty"`
}

func New

func New(data []byte) *V

New returns a new version from some data.

func (*V) Descriptor

func (*V) Descriptor() ([]byte, []int)

func (*V) GetHash

func (m *V) GetHash() []byte

func (*V) MarshalBinary

func (v *V) MarshalBinary() (data []byte, err error)

MarshalBinary converts the version to a VersionBytes-sized bytes slice.

func (*V) Matches

func (v *V) Matches(v2 *V) error

Matches returns an error is two versions are not matching.

func (*V) ProtoMessage

func (*V) ProtoMessage()

func (*V) Reset

func (m *V) Reset()

func (*V) String

func (m *V) String() string

func (*V) UnmarshalBinary

func (v *V) UnmarshalBinary(data []byte) error

UnmarshalBinary converts the input to a version.

Jump to

Keyboard shortcuts

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