compose

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jul 3, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddService

func AddService(filePath, name, image string, port int) error

func Init

func Init(path, name string) error

func ListServices

func ListServices(filePath string) ([]string, error)

func RemoveService

func RemoveService(filePath, name string) error

func SetEnv

func SetEnv(filePath, service, key, value string) error

func UnsetEnv

func UnsetEnv(filePath, service, key string) error

func Validate

func Validate(filePath string) error

func Write

func Write(path string, f *File) error

Types

type File

type File struct {
	Services map[string]*Service `yaml:"services" json:"services"`
	Volumes  map[string]any      `yaml:"volumes,omitempty" json:"volumes,omitempty"`
}

func Read

func Read(path string) (*File, error)

type Service

type Service struct {
	Image       string            `yaml:"image,omitempty" json:"image,omitempty"`
	Build       string            `yaml:"build,omitempty" json:"build,omitempty"`
	Ports       []string          `yaml:"ports,omitempty" json:"ports,omitempty"`
	Environment map[string]string `yaml:"environment,omitempty" json:"environment,omitempty"`
	Volumes     []string          `yaml:"volumes,omitempty" json:"volumes,omitempty"`
	DependsOn   []string          `yaml:"depends_on,omitempty" json:"depends_on,omitempty"`
	Restart     string            `yaml:"restart,omitempty" json:"restart,omitempty"`
}

Jump to

Keyboard shortcuts

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