updater

package
v0.0.0-...-1eeb5f6 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2019 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	WORK_MODE_SUB   = "sub"
	WORK_MODE_SCHED = "sched"
	WORK_MODE_DUAL  = "dual"
)

Variables

View Source
var (
	POST_OP_MARKER       = "/opt/.updater_post_op"
	UPDATER_SERVICE      = os.Getenv("UPDATER_SERVICE")
	UPDATER_IN_CONTAINER = os.Getenv("UPDATER_IN_CONTAINER")
	// paths on host
	UPDATER_ROOT = os.Getenv("UPDATER_ROOT")
)

Functions

This section is empty.

Types

type Daemon

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

func NewDaemon

func NewDaemon() *Daemon

func (*Daemon) Handle

func (self *Daemon) Handle(msg mqtt.Message)

MQ message handler

func (*Daemon) RunOnce

func (self *Daemon) RunOnce()

interface TimeoutHandler callback

func (*Daemon) Start

func (self *Daemon) Start()

type DockerAdapter

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

func NewDockerAdapter

func NewDockerAdapter() *DockerAdapter

func (*DockerAdapter) BackupContainer

func (self *DockerAdapter) BackupContainer(comp *manifest.Component) (*types.Container, error)

func (*DockerAdapter) CleanupContainer

func (self *DockerAdapter) CleanupContainer(cont *types.Container) error

func (*DockerAdapter) CleanupImage

func (self *DockerAdapter) CleanupImage(cont *types.Container) error

func (*DockerAdapter) CopyFromContainer

func (self *DockerAdapter) CopyFromContainer(cont *types.Container, src, dest string) error

func (*DockerAdapter) CopyToContainer

func (self *DockerAdapter) CopyToContainer(cont *types.Container, src_path, dest_path string) error

func (*DockerAdapter) DeprecateComponent

func (self *DockerAdapter) DeprecateComponent(comp *manifest.Component)

func (*DockerAdapter) FetchImage

func (self *DockerAdapter) FetchImage(comp *manifest.Component) error

func (*DockerAdapter) GetContainersByName

func (self *DockerAdapter) GetContainersByName(name string) (*types.Container, error)

func (*DockerAdapter) ListContainers

func (self *DockerAdapter) ListContainers() ([]types.Container, error)

func (*DockerAdapter) ListImages

func (self *DockerAdapter) ListImages() ([]types.ImageSummary, error)

func (*DockerAdapter) NeedUpdate

func (self *DockerAdapter) NeedUpdate(comp *manifest.Component) bool

func (*DockerAdapter) SetupContainer

func (self *DockerAdapter) SetupContainer(
	comp *manifest.Component, post_only bool, funcs ...PostSetupFn) error

func (*DockerAdapter) StartContainer

func (self *DockerAdapter) StartContainer(comp *manifest.Component) error

type DockerUpdater

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

func NewDockerUpdater

func NewDockerUpdater(sub *mq.Sub) *DockerUpdater

func (*DockerUpdater) PostSetupUpdater

func (self *DockerUpdater) PostSetupUpdater(comp *manifest.Component) error

Post Operation callback

func (*DockerUpdater) PostSetupUpdaterDeploy

func (self *DockerUpdater) PostSetupUpdaterDeploy(comp *manifest.Component) error

Post Operation callback

func (*DockerUpdater) SetupComponents

func (self *DockerUpdater) SetupComponents(mani *manifest.UpdateManifest)

type IDocker

type IDocker interface {
	SetupContainer(comp *manifest.Component, post_only bool, funcs ...PostSetupFn) error
	NeedUpdate(comp *manifest.Component) bool
	ListContainers() ([]types.Container, error)
	ListImages() ([]types.ImageSummary, error)
	GetContainersByName(name string) (*types.Container, error)
	CopyFromContainer(cont *types.Container, src, dest string) error
	CopyToContainer(cont *types.Container, src_path, dest_path string) error

	FetchImage(comp *manifest.Component) error
	CleanupImage(cont *types.Container) error
	CleanupContainer(cont *types.Container) error
	StartContainer(comp *manifest.Component) error
	DeprecateComponent(comp *manifest.Component)
	BackupContainer(comp *manifest.Component) (*types.Container, error)
}

type IUpdater

type IUpdater interface {
	SetupComponents(mani *manifest.UpdateManifest)
}

type PostSetupFn

type PostSetupFn func(comp *manifest.Component) error

Jump to

Keyboard shortcuts

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