composeutil

package
v0.0.0-...-b7a57f2 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyPortMapping

func ApplyPortMapping(p *types.Project, mapping PortConfigs)

func HasPortConflicts

func HasPortConflicts(cfgs PortConfigs) bool

HasPortConflicts returns true if there are two services using the same host port

func PortAvailable

func PortAvailable(port string, proto string) bool

PortAvailable returns true if the port is not currently in use by the host

func ProjectFromConfig

func ProjectFromConfig(composePath string) (p *types.Project, err error)

ProjectFromConfig loads a docker-compose config file into a compose Project

Types

type PortConfig

type PortConfig struct {
	Port         string
	OriginalPort string
	Protocol     string
	Services     []string
}

type PortConfigs

type PortConfigs []PortConfig

func PortConflicts

func PortConflicts(cfgs PortConfigs) PortConfigs

PortConflicts returns all PortConfigs that have a port conflict

func ProjectPortConfigs

func ProjectPortConfigs(p *types.Project) PortConfigs

ProjectPortConfigs returns a slice of associations of port/proto to services, for a specific protocol, sorted by port

func ResolvePortConflicts

func ResolvePortConflicts(conflicts PortConfigs) (PortConfigs, error)

ResolvePortConflicts mutates the project and returns the port configs with any conflicting ports remapped

func (PortConfigs) String

func (c PortConfigs) String() string

Jump to

Keyboard shortcuts

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