progress

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2018 License: Apache-2.0 Imports: 1 Imported by: 4 modules, 18 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ImageFetch

type ImageFetch struct {
	ContainerID string
	Image       string
	Resolved    bool
	Failed      bool
	// contains filtered or unexported fields
}

ImageFetch stores container pull status

func CreateImageFetch

func CreateImageFetch(containerID, image string, resolved bool, layers map[string]*Status) *ImageFetch

CreateImageFetch creates new ImageFetch for given name

func NewImageFetch

func NewImageFetch(containerID, image string) *ImageFetch

NewImageFetch creates new ImageFetch for given name

func (*ImageFetch) Add

func (s *ImageFetch) Add(ref, digest string)

Add new layer ref to the progress list

func (*ImageFetch) AllDone

func (s *ImageFetch) AllDone()

AllDone marks all layers downloaded

func (*ImageFetch) GetLayers

func (s *ImageFetch) GetLayers() (result []Status)

GetLayers return list of layers

func (*ImageFetch) GetProgress

func (s *ImageFetch) GetProgress() (current, total int64)

GetProgress calculates current and total bytes of all layers

func (*ImageFetch) IsDone

func (s *ImageFetch) IsDone() bool

IsDone return true if all bytes of all layers are downloaded

func (*ImageFetch) SetToDone

func (s *ImageFetch) SetToDone(ref string)

SetToDone updates layer ref to the done state

func (*ImageFetch) SetToDownloading

func (s *ImageFetch) SetToDownloading(ref string, offset, total int64)

SetToDownloading updates layer ref to the waiting state

func (*ImageFetch) SetToFailed

func (s *ImageFetch) SetToFailed()

SetToFailed marks fetch to be failed

func (*ImageFetch) SetToWaiting

func (s *ImageFetch) SetToWaiting(ref string)

SetToWaiting updates layer ref to the waiting state

type Status

type Status struct {
	Ref    string
	Digest string
	Status string
	Offset int64
	Total  int64
}

Status represents single layer ref current progress

func NewStatus

func NewStatus(ref, digest string) *Status

NewStatus creates new status in waiting state

func (*Status) Done

func (s *Status) Done()

Done marks Status to done state

func (*Status) Downloading

func (s *Status) Downloading(offset, total int64)

Downloading updates Status to downloading

func (*Status) Waiting

func (s *Status) Waiting()

Waiting marks status to be in waiting state

Jump to

Keyboard shortcuts

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