mirror of
https://github.com/dokku/dokku.git
synced 2026-07-11 21:10:52 +02:00
- Move proxy-port and proxy-ssl-port properties from ports plugin to proxy plugin where they conceptually belong - Generalize proxy:set to handle any property (matching ps:set pattern) instead of only handling the type property - Fix apps:set --global flag parsing (pflag treats --global as a flag, not an argument — must be defined explicitly like ps:set does) - Add missing property-functions source to scheduler-docker-local shell scripts (scheduler-enter, scheduler-run, scheduler-deploy, check-deploy, bin/scheduler-deploy-process-container) - Update nginx-vhosts property references from ports to proxy plugin - Update tests to use proxy:set for proxy-port properties
28 lines
640 B
Go
28 lines
640 B
Go
package ports
|
|
|
|
import (
|
|
"fmt"
|
|
)
|
|
|
|
|
|
// PortMap is a struct that contains a scheme:host-port:container-port mapping
|
|
type PortMap struct {
|
|
// ContainerPort is the port on the container
|
|
ContainerPort int `json:"container_port"`
|
|
|
|
// HostPort is the port on the host
|
|
HostPort int `json:"host_port"`
|
|
|
|
// Scheme is the scheme of the port mapping
|
|
Scheme string `json:"scheme"`
|
|
}
|
|
|
|
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__"
|
|
}
|