mirror of
https://github.com/dokku/dokku.git
synced 2025-12-29 00:25:08 +01:00
This change makes interacting with port mappings more clear - folks might previously set the port mapping to the proxy type or vice-versa. The existing proxy:ports* commands still exist but will show a deprecation warning for a single minor release.
22 lines
461 B
Go
22 lines
461 B
Go
package ports
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
// PortMap is a struct that contains a scheme:host-port:container-port mapping
|
|
type PortMap struct {
|
|
ContainerPort int
|
|
HostPort int
|
|
Scheme string
|
|
}
|
|
|
|
func (p PortMap) String() string {
|
|
return fmt.Sprintf("%s:%d:%d", p.Scheme, p.HostPort, p.ContainerPort)
|
|
}
|
|
|
|
// AllowsPersistence returns true if the port map is not to be persisted
|
|
func (p PortMap) AllowsPersistence() bool {
|
|
return p.Scheme == "__internal__"
|
|
}
|