clientVersion

package
v5.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: BSD-2-Clause, BSD-2-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Store stores the version of the client's storage.

func LoadStore

func LoadStore(kv *versioned.KV) (*Store, error)

LoadStore loads the clientVersion storage object.

func NewStore

func NewStore(newVersion version.Version, kv *versioned.KV) (*Store, error)

NewStore returns a new clientVersion store.

func (*Store) CheckUpdateRequired

func (s *Store) CheckUpdateRequired(newVersion version.Version) (bool, version.Version, error)

CheckUpdateRequired determines if the storage needs to be upgraded to the new client version. It returns true if an update is required (new > stored) and false otherwise. The old stored version is returned to be used to determine how to upgrade storage. If the new version is older than the stored version, an error is returned.

func (*Store) Get

func (s *Store) Get() version.Version

Get returns the stored version.

Jump to

Keyboard shortcuts

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