container

package
v0.0.0-...-5861326 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LABEL_ENABLE         string         = "yacu.enable"
	LABEL_IMAGE_AGE      string         = "yacu.image_age"
	LABEL_STOP_TIMEOUT   string         = "yacu.stop_timeout"
	LABEL_DEPENDS_ON     string         = "com.docker.compose.depends_on"
	DEPENDENCY_STARTED   DependencyType = "service_started"
	DEPENDENCY_COMPLETED DependencyType = "service_completed_successfully"
	DEPENDENCY_HEALTHY   DependencyType = "service_healthy"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Container

type Container struct {
	Raw    *types.ContainerJSON
	ID     string
	Name   string
	Labels map[string]string

	Image       *image.ImageData
	Repository  reference.NamedTagged
	StopTimeout int
	MinImageAge int
}

func New

func New(client *client.Client, data *types.ContainerJSON, stopTimeout, minImageAge int) (*Container, error)

func (*Container) CleanImageId

func (c *Container) CleanImageId() string

func (*Container) HasRepoDigest

func (c *Container) HasRepoDigest(digest digest.Digest) bool

func (*Container) IsOutdated

func (c *Container) IsOutdated() (bool, error)

func (*Container) IsRunning

func (c *Container) IsRunning() bool

func (*Container) IsYacu

func (c *Container) IsYacu() bool

func (*Container) RepositoryFamiliarized

func (c *Container) RepositoryFamiliarized() string

func (*Container) ShouldScan

func (c *Container) ShouldScan(all, stopped bool) bool

func (*Container) Start

func (c *Container) Start(ctx context.Context, client *client.Client) error

func (*Container) Stop

func (c *Container) Stop(ctx context.Context, client *client.Client) error

type Containers

type Containers []*Container

type DependantContainer

type DependantContainer struct {
	Data *types.Container
	Name string // Data.Names[0]

	StopTimeout    int
	DependsOn      *types.ContainerJSON
	DependencyType DependencyType
}

func NewDependant

func NewDependant(data *types.Container, stopTimeout int, dependsOn *types.ContainerJSON, dependencyType DependencyType) *DependantContainer

func (*DependantContainer) Start

func (c *DependantContainer) Start(ctx context.Context, client *client.Client) error

func (*DependantContainer) Stop

func (c *DependantContainer) Stop(ctx context.Context, client *client.Client) error

type DependantContainers

type DependantContainers []*DependantContainer

func (DependantContainers) Start

func (c DependantContainers) Start(ctx context.Context, client *client.Client) []string

func (DependantContainers) Stop

func (c DependantContainers) Stop(ctx context.Context, client *client.Client) []string

type DependencyType

type DependencyType string

Jump to

Keyboard shortcuts

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