session

package
v1.7.2 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewReport

func NewReport(progress Progress) types.Report

NewReport creates a types.Report from the supplied Progress

Types

type ContainerStatus

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

ContainerStatus contains the container state during a session

func UpdateFromContainer

func UpdateFromContainer(cont types.Container, newImage types.ImageID, state State) *ContainerStatus

UpdateFromContainer sets various status fields from their corresponding container equivalents

func (*ContainerStatus) CurrentImageID

func (u *ContainerStatus) CurrentImageID() wt.ImageID

CurrentImageID returns the image ID that the container used when the session started

func (*ContainerStatus) Error

func (u *ContainerStatus) Error() string

Error returns the error (if any) that was encountered for the container during a session

func (*ContainerStatus) ID

func (u *ContainerStatus) ID() wt.ContainerID

ID returns the container ID

func (*ContainerStatus) ImageName

func (u *ContainerStatus) ImageName() string

ImageName returns the name:tag that the container uses

func (*ContainerStatus) LatestImageID

func (u *ContainerStatus) LatestImageID() wt.ImageID

LatestImageID returns the newest image ID found during the session

func (*ContainerStatus) Name

func (u *ContainerStatus) Name() string

Name returns the container name

func (*ContainerStatus) State

func (u *ContainerStatus) State() string

State returns the current State that the container is in

type Progress

type Progress map[types.ContainerID]*ContainerStatus

Progress contains the current session container status

func (Progress) Add

func (m Progress) Add(update *ContainerStatus)

Add a container to the map using container ID as the key

func (Progress) AddScanned

func (m Progress) AddScanned(cont types.Container, newImage types.ImageID)

AddScanned adds a container to the Progress with the state set as scanned

func (Progress) AddSkipped

func (m Progress) AddSkipped(cont types.Container, err error)

AddSkipped adds a container to the Progress with the state set as skipped

func (Progress) MarkForUpdate

func (m Progress) MarkForUpdate(containerID types.ContainerID)

MarkForUpdate marks the container identified by containerID for update

func (Progress) Report

func (m Progress) Report() types.Report

Report creates a new Report from a Progress instance

func (Progress) UpdateFailed

func (m Progress) UpdateFailed(failures map[types.ContainerID]error)

UpdateFailed updates the containers passed, setting their state as failed with the supplied error

type State

type State int

State indicates what the current state is of the container

const (
	// UnknownState is only used to represent an uninitialized State value
	UnknownState State = iota
	SkippedState
	ScannedState
	UpdatedState
	FailedState
	FreshState
	StaleState
)

State enum values

Jump to

Keyboard shortcuts

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