docker

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2025 License: GPL-3.0 Imports: 16 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 struct {
	ContainerID   string   `json:"container_id"`
	ContainerName string   `json:"container_name"`
	ImageName     string   `json:"image_name"`
	GitRepo       string   `json:"git_repo"`
	UserID        string   `json:"user_id"`
	Environment   []string `json:"environment"` // ["ENV=prod"]
	Ports         []Port   `json:"ports"`
}

func (Container) Status

func (c Container) Status(ctx context.Context, cli *client.Client)

type ContainerStatus

type ContainerStatus struct {
	ContainerName string `json:"container_name"`
	Status        string `json:"status"` // "running"
	State         string `json:"state"`  // "Up 4 hours"
}

type ImageTemplate

type ImageTemplate struct {
	ImageName  string `json:"image_name"` // "gocode"
	Dockerfile string `json:"dockerfile"` // "Dockerfile"
}

type Port

type Port struct {
	HostPort      string `json:"host_port"`      //  "8089"
	ContainerPort string `json:"container_port"` //  "8080/tcp"
}

type Repo

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

func NewRepo

func NewRepo(ctx context.Context, volumesPath string) *Repo

func (*Repo) Build

func (r *Repo) Build(t model.Template, tag string, env map[string]*string) error

func (*Repo) CreateContainer

func (r *Repo) CreateContainer(mc *model.Container) (string, error)

func (*Repo) DeleteContainer

func (r *Repo) DeleteContainer(containerID string) error

func (*Repo) GetContainerStatuses

func (r *Repo) GetContainerStatuses(containerID []string) ([]model.ContainerStatus, error)

func (*Repo) GetImages

func (r *Repo) GetImages() ([]model.Image, error)

func (*Repo) StartContainer

func (r *Repo) StartContainer(containerID string) error

func (*Repo) StopContainer

func (r *Repo) StopContainer(containerID string) error

Jump to

Keyboard shortcuts

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