compose

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2025 License: MIT Imports: 5 Imported by: 0

README

docker-compose - Go Package

A Go package that allows you to create and manage Docker Compose configurations programmatically.

Installation

go get github.com/cdvelop/compose

Basic Usage in docker-compose_test.go

Main Features

  • Programmatic creation of docker-compose.yml files
  • Support for defining services, networks and volumes
  • Automatic configuration validation
  • Dynamic configuration generation
  • Integration with other Go tools

License

This project is licensed under the MIT License - see the LICENSE file for more details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddEnvToFile added in v0.0.5

func AddEnvToFile(key string, value string, paths ...string) error

AddEnvToFile adds environment variables to .env file and ensures .gitignore is properly configured envPath and gitignorePath are optional, defaulting to ".env" and ".gitignore" respectively

func NewCompose added in v0.0.3

func NewCompose(version string, services ...service) (*composeConfig, error)

NewCompose crea una nueva configuración de docker-compose

func NewService added in v0.0.2

func NewService(name string) *service

NewService crea una nueva configuración de servicio

Types

type Volume added in v0.0.2

type Volume struct {
	Source string `yaml:"-"`
	Target string `yaml:"-"`
}

Volume representa un volumen en docker-compose

Jump to

Keyboard shortcuts

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