types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container interface {
	ContainerInfo() *dc.InspectResponse
	ID() ContainerID
	IsRunning() bool
	Name() string
	ImageID() ImageID
	SafeImageID() ImageID
	ImageName() string
	Enabled() (bool, bool)
	IsMonitorOnly(UpdateParams) bool
	Scope() (string, bool)
	Links() []string
	ToRestart() bool
	IsDockwatch() bool
	StopSignal() string
	HasImageInfo() bool
	ImageInfo() *di.InspectResponse
	GetLifecyclePreCheckCommand() string
	GetLifecyclePostCheckCommand() string
	GetLifecyclePreUpdateCommand() string
	GetLifecyclePostUpdateCommand() string
	VerifyConfiguration() error
	SetStale(bool)
	IsStale() bool
	IsNoPull(UpdateParams) bool
	SetLinkedToRestarting(bool)
	IsLinkedToRestarting() bool
	PreUpdateTimeout() int
	PostUpdateTimeout() int
	IsRestarting() bool
	GetCreateConfig() *dc.Config
	GetCreateHostConfig() *dc.HostConfig
}

Container is a docker container running an image

type ContainerID

type ContainerID string

ContainerID is a hash string representing a container instance

func (ContainerID) ShortID

func (id ContainerID) ShortID() (short string)

ShortID returns the 12-character (hex) short version of a container ID hash, removing any "sha256:" prefix if present

type ContainerReport

type ContainerReport interface {
	ID() ContainerID
	Name() string
	CurrentImageID() ImageID
	LatestImageID() ImageID
	ImageName() string
	Error() string
	State() string
}

ContainerReport represents a container that was included in dockwatch session

type Filter

type Filter func(FilterableContainer) bool

A Filter is a prototype for a function that can be used to filter the results from a call to the ListContainers() method on the Client.

type FilterableContainer

type FilterableContainer interface {
	Name() string
	IsDockwatch() bool
	Enabled() (bool, bool)
	Scope() (string, bool)
	ImageName() string
}

A FilterableContainer is the interface which is used to filter containers.

type ImageID

type ImageID string

ImageID is a hash string representing a container image

func (ImageID) ShortID

func (id ImageID) ShortID() (short string)

ShortID returns the 12-character (hex) short version of an image ID hash, removing any "sha256:" prefix if present

type RegistryCredentials

type RegistryCredentials struct {
	Username string
	Password string // usually a token rather than an actual password
}

RegistryCredentials is a credential pair used for basic auth

type Report

type Report interface {
	Scanned() []ContainerReport
	Updated() []ContainerReport
	Failed() []ContainerReport
	Skipped() []ContainerReport
	Stale() []ContainerReport
	Fresh() []ContainerReport
	All() []ContainerReport
}

Report contains reports for all the containers processed during a session

type TokenResponse

type TokenResponse struct {
	Token string `json:"token"`
	// AccessToken is what the OAuth2 form of the token endpoint returns. Azure ACR
	// and some GitLab configurations send only this field, and reading just "token"
	// left the bearer empty -- which surfaced as every digest check failing over to
	// a full pull, silently, on every poll.
	AccessToken string `json:"access_token"`
}

TokenResponse is returned by the registry on successful authentication

func (TokenResponse) Bearer added in v1.0.0

func (r TokenResponse) Bearer() string

Bearer returns the token the registry issued, whichever field it used.

type UpdateParams

type UpdateParams struct {
	Filter          Filter
	Cleanup         bool
	NoRestart       bool
	Timeout         time.Duration
	MonitorOnly     bool
	NoPull          bool
	LifecycleHooks  bool
	RollingRestart  bool
	LabelPrecedence bool
}

UpdateParams contains all different options available to alter the behavior of the Update func

Jump to

Keyboard shortcuts

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