manager

package
v0.0.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildPayload added in v0.0.8

type BuildPayload struct {
	CallbackURL string     `json:"callback_url"`
	PushData    PushData   `json:"push_data"`
	Repository  Repository `json:"repository"`
}

type Config added in v0.0.8

type Config struct {
	ContainerConfig *container.Config         `json:"container_config"`
	HostConfig      *container.HostConfig     `json:"host_config"`
	NetworkConfig   *network.NetworkingConfig `json:"network_config"`
}

type ImageContainer

type ImageContainer struct {
	ImageName   string
	ImageId     string
	ContainerID string
	Config      Config
}

ImageContainer represents a Docker image and its running container

type Manager

type Manager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

Manager handles the lifecycle of Docker images and their containers

func NewManager

func NewManager() (*Manager, error)

NewManager creates a new ImageManager instance

func (*Manager) AddImage

func (m *Manager) AddImage(ctx context.Context, config Config) error

AddImage adds a new image to manage and ensures its container is running

func (*Manager) RemoveImage

func (m *Manager) RemoveImage(ctx context.Context, imageName string) error

RemoveImage removes an image and stops its container

func (*Manager) UpgradeImage

func (m *Manager) UpgradeImage(ctx context.Context, build BuildPayload) error

UpgradeImage pulls the latest version of the image and replaces the running container

type PushData added in v0.0.8

type PushData struct {
	Images   []string `json:"images"`
	PushedAt float32  `json:"pushed_at"`
	Pusher   string   `json:"pusher"`
	Tag      string   `json:"tag"`
}

type RemoveRequest added in v0.0.8

type RemoveRequest struct {
	ImageName string `json:"image_name"`
}

type Repository added in v0.0.8

type Repository struct {
	CommentCount    int     `json:"comment_count"`
	DateCreated     float32 `json:"date_created"`
	Description     string  `json:"description"`
	Dockerfile      string  `json:"dockerfile"`
	FullDescription string  `json:"full_description"`
	IsOfficial      bool    `json:"is_official"`
	IsPrivate       bool    `json:"is_private"`
	IsTrusted       bool    `json:"is_trusted"`
	Name            string  `json:"name"`
	Namespace       string  `json:"namespace"`
	Owner           string  `json:"owner"`
	RepoName        string  `json:"repo_name"`
	RepoURL         string  `json:"repo_url"`
	StarCount       int     `json:"star_count"`
	Status          string  `json:"status"`
}

Jump to

Keyboard shortcuts

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