model

package
v0.0.0-...-b8f9f05 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2018 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Build

type Build struct {
	Time time.Time `json:"time"`
	Name string    `json:"name"`
	Body []byte    `json:"body"`
	Sign []byte    `json:"sign"`

	Version

	StartBlock uint64 `json:"start_block"`
	IsCritical bool   `json:"is_critical"`
}

Build is storing build data with needed for update params

type Version

type Version struct {
	Number string `json:"number"`
	OS     string `json:"os"`
	Arch   string `json:"arch"`
}

func GetAvailableVersions

func GetAvailableVersions() []Version

GetAvailableVersions is returning available versions

func GetLastVersion

func GetLastVersion(versions []Version, os string, arch string) (Version, error)

GetLastVersion returns the latest version for required os+arch from the version array

func NewVersion

func NewVersion(from string) (Version, error)

func VersionFilter

func VersionFilter(versions []Version, os string, arch string) []Version

VersionFilter is filtering and leaves only the necessary versions and sorting by asc

func (*Version) String

func (b *Version) String() string

String is formatting version to string

func (*Version) Validate

func (b *Version) Validate() bool

ValidateSystem is checking os+arch correctness

Jump to

Keyboard shortcuts

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