version

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2019 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// The full version string
	Version = "1.0.9"
	// GitCommit is set with --ldflags "-X main.gitCommit=$(git rev-parse HEAD)"
	GitCommit string
	Status    *UpdateStatus
)

Functions

func CompatibleWith added in v1.0.5

func CompatibleWith(remoteVerStr string) (bool, error)

CompatibleWith checks whether the remote peer version is compatible with the node itself. RULES: | local | remote | | - | - | | 1.0.3 | same major&moinor version. | | 1.0.4 | same major version. |

Types

type UpdateStatus added in v1.0.5

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

func (*UpdateStatus) AddSeed added in v1.0.5

func (s *UpdateStatus) AddSeed(seedAddr string)

func (*UpdateStatus) CheckUpdate added in v1.0.5

func (s *UpdateStatus) CheckUpdate(localVerStr string, remoteVerStr string, remoteAddr string) error

CheckUpdate checks whether there is a newer version to update. If there is, it set the "Status" variable to a proper value.

params:
	localVerStr: the version of the node itself
	remoteVerStr: the version received from a seed node.
	remoteAddr: the version received from a seed node.

current rule:

  1. small update: seed version is higher than the node itself
  2. significant update: seed mojor version is higher than the node itself

func (*UpdateStatus) MaxVerSeen added in v1.0.5

func (s *UpdateStatus) MaxVerSeen() string

func (*UpdateStatus) VersionStatus added in v1.0.5

func (s *UpdateStatus) VersionStatus() uint16

Jump to

Keyboard shortcuts

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