updates

package
v0.31.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2018 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

type Engine struct {
	// contains filtered or unexported fields
}

Engine is the deamon updates check engine which fetches updates status from Torus repository. It can be asked for the latest version available upstream and if it's higher than the current one.

func NewEngine

func NewEngine(cfg *config.Config, t *http.Transport, options ...func(*Engine)) *Engine

NewEngine creates a new Engine based on the provided config structure. It can be extended by passing specific options which alter the initialization of the Engine itself.

func (*Engine) SetTimeManager

func (e *Engine) SetTimeManager(manager TimeManager) func(*Engine)

SetTimeManager is a configuration function for `NewEngine` which sets the Engine's TimeManager instance to the `manager` argument.

func (*Engine) Start

func (e *Engine) Start() error

Start starts the update checking loop.

func (*Engine) Stop

func (e *Engine) Stop() error

Stop stops the update checking loop.

func (*Engine) VersionInfo

func (e *Engine) VersionInfo() (bool, string)

VersionInfo returns a boolean representing if the current version is behind the latest one available for download and the latest version available.

type TimeManager

type TimeManager interface {
	Now() time.Time
}

TimeManager is a proxy interface with a Now() method which returns the current time with the appropriate conventions.

type VersionInfo

type VersionInfo struct {
	Version  string `json:"version"`
	Released string `json:"released"`
}

VersionInfo maps the JSON returned from the `url` endpoint, containing the latest version available info.

Jump to

Keyboard shortcuts

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