model

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2025 License: MIT 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 struct {
	ID     string   `json:"id"`
	Image  string   `json:"image"`
	Status string   `json:"status"`
	Names  []string `json:"names"`
}

Container represents basic container information

type ContainerConfig

type ContainerConfig struct {
	Image string   `json:"image"`
	Name  string   `json:"name"`
	Env   []string `json:"env,omitempty"`
	Cmd   []string `json:"cmd,omitempty"`
}

ContainerConfig holds configuration for creating a container

type ContainerHealthCheck

type ContainerHealthCheck struct {
	Test        []string `yaml:"test,omitempty"`
	Interval    string   `yaml:"interval,omitempty"`
	Timeout     string   `yaml:"timeout,omitempty"`
	Retries     int      `yaml:"retries,omitempty"`
	StartPeriod string   `yaml:"start_period,omitempty"`
}

ContainerHealthCheck defines the health check configuration for a container

type ContainerInfo

type ContainerInfo struct {
	ID      string    `json:"id"`
	Name    string    `json:"name"`
	Image   string    `json:"image"`
	Status  string    `json:"status"`
	State   string    `json:"state"`
	Created time.Time `json:"created"`
	Ports   []Port    `json:"ports,omitempty"`
	ImageID string    `json:"image_id,omitempty"`
}

ContainerInfo represents detailed information about a container

type Deployment

type Deployment struct {
	Server        ServerStruct          `yaml:"server"`
	ContainerName string                `yaml:"container_name"`
	Image         string                `yaml:"image"`
	Tag           string                `yaml:"tag"`
	EnvFile       string                `yaml:"env_file"`
	Environment   map[string]string     `yaml:"environment,omitempty"`
	Ports         map[string]string     `yaml:"ports,omitempty"`
	Volumes       []string              `yaml:"volumes,omitempty"`
	RestartPolicy string                `yaml:"restart_policy,omitempty"`
	HealthCheck   *ContainerHealthCheck `yaml:"health_check,omitempty"`
}

Deployment represents a deployment configuration

type Port

type Port struct {
	IP          string `json:"ip,omitempty"`
	PrivatePort uint16 `json:"private_port"`
	PublicPort  uint16 `json:"public_port,omitempty"`
	Type        string `json:"type"`
}

Port represents a network port mapping

type Response

type Response struct {
	Command string `json:"command,omitempty"` // For debugging/logs
	Status  bool   `json:"status"`            // Success/failure flag
	Message string `json:"message,omitempty"` // Readable summary
	Output  string `json:"output,omitempty"`  // Raw terminal output

	StatusCode int       `json:"status-code"`
	Error      string    `json:"error,omitempty"` // Raw error (stderr)
	Time       time.Time `json:"time"`
}

type ServerStruct

type ServerStruct struct {
	Name     string            `yaml:"name"`
	Host     string            `yaml:"host"`
	Port     int               `yaml:"port"`
	User     string            `yaml:"user"`
	KeyPath  string            `yaml:"key_path"`
	Password string            `yaml:"password,omitempty"`
	Env      map[string]string `yaml:"env,omitempty"`
}

func (*ServerStruct) Address

func (s *ServerStruct) Address() string

Address returns the server address in host:port format

func (*ServerStruct) SSHConfig

func (s *ServerStruct) SSHConfig() (*ssh.ClientConfig, error)

SSHConfig returns the SSH client configuration

Jump to

Keyboard shortcuts

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