Documentation ¶
Index ¶
- Constants
- Variables
- type Boot
- func (b *Boot) Current() (FListEvent, error)
- func (b *Boot) CurrentBins() (map[string]RepoFList, error)
- func (b Boot) DetectBootMethod() BootMethod
- func (b *Boot) MustVersion() semver.Version
- func (b *Boot) Name() string
- func (b *Boot) Set(c FListEvent) error
- func (b *Boot) SetBins(current map[string]RepoFList) error
- func (b *Boot) Version() (semver.Version, error)
- type BootMethod
- type Event
- type EventType
- type FListEvent
- type FListRepoWatcher
- type FListSemverWatcher
- type RepoEvent
- type RepoFList
- type Upgrader
- type Watcher
Constants ¶
const ( // FlistNameFile file contains boot flist repo/name FlistNameFile = "/tmp/flist.name" // FlistInfoFile file container boot flist infor FlistInfoFile = "/tmp/flist.info" // BinariesFile file contains binaries database BinariesFile = "/tmp/bins.info" )
Variables ¶
var ( // ErrRestartNeeded is returned if upgraded requires a restart ErrRestartNeeded = fmt.Errorf("restart needed") )
Functions ¶
This section is empty.
Types ¶
type Boot ¶
type Boot struct{}
Boot struct
func (*Boot) Current ¶
func (b *Boot) Current() (FListEvent, error)
Current returns current flist information
func (*Boot) CurrentBins ¶
CurrentBins returns a list of current binaries installed
func (Boot) DetectBootMethod ¶
func (b Boot) DetectBootMethod() BootMethod
DetectBootMethod tries to detect the boot method of the node
func (*Boot) MustVersion ¶
MustVersion must returns the current version or panic
func (*Boot) Name ¶
Name always return name of the boot flist. If name file does not exist, an empty string is returned
type BootMethod ¶
type BootMethod string
BootMethod defines the node boot method
const ( // BootMethodFList booted from an flist BootMethodFList BootMethod = "flist" // BootMethodOther booted with other methods BootMethodOther BootMethod = "other" )
type FListEvent ¶
type FListEvent struct {
// contains filtered or unexported fields
}
FListEvent struct
func (*FListEvent) TryVersion ¶
func (f *FListEvent) TryVersion() semver.Version
TryVersion will try to parse the version from flist other wise return empty version 0.0.0
type FListRepoWatcher ¶
type FListRepoWatcher struct { Repo string Current map[string]RepoFList Duration time.Duration // contains filtered or unexported fields }
FListRepoWatcher type
type FListSemverWatcher ¶
type FListSemverWatcher struct { FList string Duration time.Duration Current semver.Version // contains filtered or unexported fields }
FListSemverWatcher watches a single FList for changes in it's semver the semver to change without the flist name itself changes, means that this flist is mostly a symlink
type RepoFList ¶
type RepoFList struct {
// contains filtered or unexported fields
}
RepoFList holds information of flist from a repo list operation
func (*RepoFList) Absolute ¶
func (b *RepoFList) Absolute() string
Absolute returns the actual flist name
type Upgrader ¶
type Upgrader struct { FLister pkg.Flister Zinit *zinit.Client NoSelfUpdate bool // contains filtered or unexported fields }
Upgrader is the component that is responsible to keep 0-OS up to date
func (*Upgrader) InstallBinary ¶
InstallBinary from a single flist.
func (*Upgrader) UninstallBinary ¶
UninstallBinary from a single flist.
func (*Upgrader) Upgrade ¶
func (u *Upgrader) Upgrade(from, to FListEvent) error
Upgrade is the method that does a full upgrade flow first check if a new version is available if yes, applies the upgrade on a successfully update, upgrade WILL NOT RETURN instead the upgraded daemon will be completely stopped