Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type VersionInfo ¶
type VersionInfo struct {
Name string // abci, p2p, app, block, etc.
Version string // semver.
Optional bool // default required.
}
VersionInfo is used to negotiate between clients.
type VersionSet ¶
type VersionSet []VersionInfo
func (VersionSet) CompatibleWith ¶
func (pvs VersionSet) CompatibleWith(other VersionSet) (res VersionSet, err error)
Returns an error if not compatible. Otherwise, returns the set of compatible interfaces. Only the Major and Minor versions are returned; Patch, Prerelease, and Build portions of Semver2.0 are discarded in the resulting intersection VersionSet. Where both sides carry an entry, the lower of the two major.minors is the negotiated one. The error quotes entries of both sets, so a set from a peer must pass Validate first, as NodeInfo.Validate does.
func (VersionSet) Get ¶
func (pvs VersionSet) Get(name string) (pv VersionInfo, ok bool)
func (*VersionSet) Set ¶
func (pvs *VersionSet) Set(pv VersionInfo)
func (VersionSet) Sort ¶
func (pvs VersionSet) Sort()
func (VersionSet) Validate ¶
func (pvs VersionSet) Validate() error
Validate returns an error if pvs holds more than maxVersionSetLen entries, or an entry whose name or version is longer than maxVersionInfoLen bytes. The error names no entry, since pvs can come from a peer.