Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func WriteDefaultForEnv ¶
func WriteDefaultForEnv(path string, mounts []DefaultMount, homeDir string) error
WriteDefaultForEnv writes a default config file for a new drop environment to path.
Types ¶
type Config ¶
type DefaultMount ¶ added in v0.1.3
type EnvVar ¶
func (*EnvVar) UnmarshalTOML ¶
type HostPort ¶
Different from PublishedPort because Pasta, contrary to its man page, doesn't seem to support HostIP for ports forwarded from host to the namespace.
func ParseHostPort ¶
ParseHostPort parses host port string. Like ParsePublishedPort, but does not allow to specify hostIP/, only HOST_PORT[:DROP_PORT] or "auto".
func (*HostPort) UnmarshalTOML ¶
Custom toml.Unmarshaler for HostPort field. Input is a string in the format hostPort[:guestPort] or "auto" for automatic port forwarding of all ports.
type Mount ¶
func ParseMountCompact ¶
ParseMountCompact parses mount configuration from a string of a form source:target:options, where target and options are optional. If target is not given or empty, it equals source. Options are comma separated and can be "rw" and "overlay". Valid strings: "~/go", "~/go:~/host-go" "~/go:~/host-go:ro", "~/go::ro,overlay
func (*Mount) UnmarshalTOML ¶
Custom toml.Unmarshaler for mount field which is of mixed type (TOML 1.0 feature). In TOML mount entry can be either a single Docker-style mount string source:target:option (like "~/go:~/host-go:ro"), or a more verbose TOML table {source = "~/go", target = "~/host-go", rw = true, overlay = false}, where target is optional and defaults to source if not specified.
type Net ¶
type Net struct {
Mode string `toml:"mode"`
TCPPublishedPorts []PublishedPort `toml:"tcp_published_ports"`
TCPHostPorts []HostPort `toml:"tcp_host_ports"`
UDPPublishedPorts []PublishedPort `toml:"udp_published_ports"`
UDPHostPorts []HostPort `toml:"udp_host_ports"`
}
type PublishedPort ¶
func ParsePublishedPort ¶
func ParsePublishedPort(spec string) (*PublishedPort, error)
ParsePublishedPort parses and validates a published port string.
To keep things simple and keep an option of using a different connectivity tool, only the simplest Pasta mapping expressions are allowed.
Supported format of forwardSpecs items:
- port (e.g., "8080") -> publishes Drop port 8080 as host port 8080 bound to 127.0.0.1 only
- hostPort:guestPort (e.g., "8080:80") -> publishes Drop port 80 as host port 8080 bound to 127.0.0.1 only
- hostIP/hostPort:guestPort (e.g., "192.168.0.3/8080:80") -> published Drop port 80 as host port 8080 bound to IP address 192.168.0.3
- "auto" -> automatically publishes all open ports and binds them to ALL available IP addresses
func (*PublishedPort) UnmarshalTOML ¶
func (p *PublishedPort) UnmarshalTOML(data any) error
Custom toml.Unmarshaler for PublishedPort field. Input entry is a string in the format [hostIP/][hostPort:]guestPort or "auto" for automatic port forwarding of all ports.