compose

package
v0.0.0-...-dae269f Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2023 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EnvFileHeader = "# THIS FILE IS AUTOMATICALLY GENERATED. DO NOT EDIT. \n\n"

	EnvEqualChar   = '='  // assignment
	EnvReplaceChar = '#'  // replacement for invalid characters
	EnvEscapeChar  = '\\' // escaping
	EnvQuoteChar   = '"'  // quoting
)

Variables

This section is empty.

Functions

func EscapeEnvValue

func EscapeEnvValue(value string) (escaped string)

Escape escapes the given value to be written to an environment variable. If the value does not need escaping, it may return it unchanged.

EscapeEnvValue allows ASCII characters from ' ' to '~' (inclusive) as well as '\t', '\r', '\n'. Other characters are automatically replaced by EnvReplaceChar.

func WriteEnvFile

func WriteEnvFile(writer io.Writer, env map[string]string) (count int, err error)

WriteEnvFile writes a .env file to io.Writer. Variables are written in consistent order.

Variable names may only contain ascii letters, numbers or the character "_". Invalid variable names are an error.

Variables values are escaped using EscapeEnvValue.

count contains the number of bytes written to writer. In case of an error, partial content may already have been written to writer, as indicated by count.

Types

type Project

type Project = *types.Project

ComposeProject represents a compose project

func Open

func Open(path string) (project Project, err error)

Open loads a docker compose project from the given path. The returned name indicates the name, as would be found by the 'docker compose' executable. If the project could not be found, an appropriate error is returned.

NOTE: This intentionally omits using any kind of api for docker compose. This saves a *a lot* of dependencies.

Jump to

Keyboard shortcuts

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