stack

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2026 License: GPL-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type ComposeConfig

type ComposeConfig struct {
	Services map[string]any `json:"services"`
}

type ComposeService

type ComposeService struct {
	Name       string      `json:"name"`
	Image      string      `json:"image,omitempty"`
	Ports      []string    `json:"ports,omitempty"`
	Containers []Container `json:"containers"`
}

type Container

type Container struct {
	Name           string             `json:"name"`
	Image          string             `json:"image"`
	State          string             `json:"state"`
	Ports          []Port             `json:"ports,omitempty"`
	Created        string             `json:"created,omitempty"`
	Started        string             `json:"started,omitempty"`
	Finished       string             `json:"finished,omitempty"`
	ExitCode       *int               `json:"exit_code,omitempty"`
	RestartPolicy  *RestartPolicy     `json:"restart_policy,omitempty"`
	ResourceLimits *ResourceLimits    `json:"resource_limits,omitempty"`
	Health         *HealthStatus      `json:"health,omitempty"`
	Command        []string           `json:"command,omitempty"`
	WorkingDir     string             `json:"working_dir,omitempty"`
	User           string             `json:"user,omitempty"`
	Labels         map[string]string  `json:"labels,omitempty"`
	Networks       []ContainerNetwork `json:"networks,omitempty"`
	Mounts         []ContainerMount   `json:"mounts,omitempty"`
}

type ContainerImageDetails

type ContainerImageDetails struct {
	ContainerName string              `json:"container_name"`
	ImageID       string              `json:"image_id"`
	ImageName     string              `json:"image_name"`
	ImageInfo     ImageInspectInfo    `json:"image_info"`
	ImageHistory  []ImageHistoryLayer `json:"image_history"`
}

type ContainerMount

type ContainerMount struct {
	Type        string `json:"type"`
	Source      string `json:"source"`
	Destination string `json:"destination"`
	Driver      string `json:"driver,omitempty"`
	Mode        string `json:"mode,omitempty"`
	RW          bool   `json:"rw"`
	Propagation string `json:"propagation,omitempty"`
}

type ContainerNetwork

type ContainerNetwork struct {
	Name       string   `json:"name"`
	NetworkID  string   `json:"network_id,omitempty"`
	IPAddress  string   `json:"ip_address,omitempty"`
	Gateway    string   `json:"gateway,omitempty"`
	MacAddress string   `json:"mac_address,omitempty"`
	Aliases    []string `json:"aliases,omitempty"`
}

type CreateStackRequest

type CreateStackRequest struct {
	Name string `json:"name" validate:"required"`
}

type CreateStackResponse

type CreateStackResponse struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
	Stack   *Stack `json:"stack,omitempty"`
}

type EnvironmentVariable

type EnvironmentVariable struct {
	Key             string `json:"key"`
	Value           string `json:"value"`
	IsSensitive     bool   `json:"is_sensitive"`
	Source          string `json:"source"`
	IsFromContainer bool   `json:"is_from_container"`
}

type Handler

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

func NewHandler

func NewHandler(service *Service, auditService *audit.Service) *Handler

func (*Handler) CreateStack

func (h *Handler) CreateStack(c echo.Context) error

func (*Handler) GetContainerImageDetails

func (h *Handler) GetContainerImageDetails(c echo.Context) error

func (*Handler) GetStackDetails

func (h *Handler) GetStackDetails(c echo.Context) error

func (*Handler) GetStackEnvironmentVariables

func (h *Handler) GetStackEnvironmentVariables(c echo.Context) error

func (*Handler) GetStackNetworks

func (h *Handler) GetStackNetworks(c echo.Context) error

func (*Handler) GetStackVolumes

func (h *Handler) GetStackVolumes(c echo.Context) error

func (*Handler) GetStacksSummary

func (h *Handler) GetStacksSummary(c echo.Context) error

func (*Handler) ListStacks

func (h *Handler) ListStacks(c echo.Context) error

type HealthLog

type HealthLog struct {
	Start    string `json:"start"`
	End      string `json:"end,omitempty"`
	ExitCode int    `json:"exit_code"`
	Output   string `json:"output"`
}

type HealthStatus

type HealthStatus struct {
	Status        string      `json:"status"`
	FailingStreak int         `json:"failing_streak,omitempty"`
	Log           []HealthLog `json:"log,omitempty"`
}

type ImageConfig

type ImageConfig struct {
	User         string              `json:"user,omitempty"`
	Env          []string            `json:"env,omitempty"`
	Cmd          []string            `json:"cmd,omitempty"`
	Entrypoint   []string            `json:"entrypoint,omitempty"`
	WorkingDir   string              `json:"working_dir,omitempty"`
	ExposedPorts map[string]struct{} `json:"exposed_ports,omitempty"`
	Labels       map[string]string   `json:"labels,omitempty"`
}

type ImageHistoryLayer

type ImageHistoryLayer struct {
	ID        string   `json:"id"`
	Created   int64    `json:"created"`
	CreatedBy string   `json:"created_by"`
	Size      int64    `json:"size"`
	Comment   string   `json:"comment,omitempty"`
	Tags      []string `json:"tags,omitempty"`
}

type ImageInspectInfo

type ImageInspectInfo struct {
	Architecture  string      `json:"architecture"`
	OS            string      `json:"os"`
	Size          int64       `json:"size"`
	VirtualSize   int64       `json:"virtual_size"`
	Author        string      `json:"author"`
	Created       string      `json:"created"`
	DockerVersion string      `json:"docker_version"`
	Config        ImageConfig `json:"config"`
	RootFS        RootFS      `json:"rootfs"`
	Parent        string      `json:"parent,omitempty"`
	RepoTags      []string    `json:"repo_tags,omitempty"`
	RepoDigests   []string    `json:"repo_digests,omitempty"`
}

type Network

type Network struct {
	Name       string                     `json:"name"`
	Driver     string                     `json:"driver,omitempty"`
	External   bool                       `json:"external,omitempty"`
	Labels     map[string]string          `json:"labels,omitempty"`
	Options    map[string]string          `json:"options,omitempty"`
	IPAM       *NetworkIPAM               `json:"ipam,omitempty"`
	Containers map[string]NetworkEndpoint `json:"containers,omitempty"`
	Exists     bool                       `json:"exists"`
	Created    string                     `json:"created,omitempty"`
}

type NetworkEndpoint

type NetworkEndpoint struct {
	Name        string `json:"name"`
	EndpointID  string `json:"endpoint_id,omitempty"`
	MacAddress  string `json:"mac_address,omitempty"`
	IPv4Address string `json:"ipv4_address,omitempty"`
	IPv6Address string `json:"ipv6_address,omitempty"`
}

type NetworkIPAM

type NetworkIPAM struct {
	Driver string              `json:"driver,omitempty"`
	Config []NetworkIPAMConfig `json:"config,omitempty"`
}

type NetworkIPAMConfig

type NetworkIPAMConfig struct {
	Subnet  string `json:"subnet,omitempty"`
	Gateway string `json:"gateway,omitempty"`
}

type Port

type Port struct {
	Private int    `json:"private"`
	Public  int    `json:"public,omitempty"`
	Type    string `json:"type"`
}

type ResourceLimits

type ResourceLimits struct {
	CPUShares  int64 `json:"cpu_shares,omitempty"`
	Memory     int64 `json:"memory,omitempty"`
	MemorySwap int64 `json:"memory_swap,omitempty"`
	CPUQuota   int64 `json:"cpu_quota,omitempty"`
	CPUPeriod  int64 `json:"cpu_period,omitempty"`
}

type RestartPolicy

type RestartPolicy struct {
	Name              string `json:"name"`
	MaximumRetryCount int    `json:"maximum_retry_count,omitempty"`
}

type RootFS

type RootFS struct {
	Type   string   `json:"type"`
	Layers []string `json:"layers,omitempty"`
}

type Service

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

func NewService

func NewService(cfg *config.Config, dockerClient *docker.Client, logger *logging.Logger) *Service

func (*Service) CreateStack

func (s *Service) CreateStack(name string) (*Stack, error)

func (*Service) GetContainerImageDetails

func (s *Service) GetContainerImageDetails(stackName string) ([]ContainerImageDetails, error)

func (*Service) GetContainerInfo

func (s *Service) GetContainerInfo(stackName string) (map[string][]Container, error)

func (*Service) GetStackDetails

func (s *Service) GetStackDetails(name string) (*StackDetails, error)

func (*Service) GetStackEnvironmentVariables

func (s *Service) GetStackEnvironmentVariables(name string, unmask bool) (map[string][]ServiceEnvironment, error)

func (*Service) GetStackNetworks

func (s *Service) GetStackNetworks(name string) ([]Network, error)

func (*Service) GetStackVolumes

func (s *Service) GetStackVolumes(name string) ([]Volume, error)

func (*Service) GetStacksSummary

func (s *Service) GetStacksSummary(patterns []string) (*StackStatistics, error)

func (*Service) ListStacks

func (s *Service) ListStacks() ([]Stack, error)

type ServiceCountCache

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

func NewServiceCountCache

func NewServiceCountCache(stackLocation string) *ServiceCountCache

func (*ServiceCountCache) GetServiceCount

func (c *ServiceCountCache) GetServiceCount(stackName string) (int, bool)

func (*ServiceCountCache) Start

func (c *ServiceCountCache) Start() error

func (*ServiceCountCache) Stop

func (c *ServiceCountCache) Stop()

type ServiceEnvironment

type ServiceEnvironment struct {
	ServiceName string                `json:"service_name"`
	Variables   []EnvironmentVariable `json:"variables"`
}

type Stack

type Stack struct {
	Name              string `json:"name"`
	Path              string `json:"path"`
	ComposeFile       string `json:"compose_file"`
	IsHealthy         bool   `json:"is_healthy"`
	TotalContainers   int    `json:"total_containers"`
	RunningContainers int    `json:"running_containers"`
}

type StackDetails

type StackDetails struct {
	Name        string           `json:"name"`
	Path        string           `json:"path"`
	ComposeFile string           `json:"compose_file"`
	Services    []ComposeService `json:"services"`
}

type StackStatistics

type StackStatistics struct {
	TotalStacks     int `json:"total_stacks"`
	HealthyStacks   int `json:"healthy_stacks"`
	UnhealthyStacks int `json:"unhealthy_stacks"`
}

type Volume

type Volume struct {
	Name       string            `json:"name"`
	Driver     string            `json:"driver,omitempty"`
	External   bool              `json:"external,omitempty"`
	Labels     map[string]string `json:"labels,omitempty"`
	DriverOpts map[string]string `json:"driver_opts,omitempty"`
	Exists     bool              `json:"exists"`
	Created    string            `json:"created,omitempty"`
	Mountpoint string            `json:"mountpoint,omitempty"`
	Scope      string            `json:"scope,omitempty"`
	UsedBy     []VolumeUsage     `json:"used_by,omitempty"`
}

type VolumeMount

type VolumeMount struct {
	Type         string            `json:"type"`
	Source       string            `json:"source"`
	Target       string            `json:"target"`
	ReadOnly     bool              `json:"read_only,omitempty"`
	BindOptions  map[string]string `json:"bind_options,omitempty"`
	TmpfsOptions map[string]string `json:"tmpfs_options,omitempty"`
}

type VolumeUsage

type VolumeUsage struct {
	ContainerName string        `json:"container_name"`
	ServiceName   string        `json:"service_name"`
	Mounts        []VolumeMount `json:"mounts"`
}

Jump to

Keyboard shortcuts

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