refactor: simplify port string

This commit is contained in:
Jose Diaz-Gonzalez
2024-01-22 06:40:04 -05:00
parent 2bee070e78
commit 01ec08fd79
2 changed files with 8 additions and 4 deletions

View File

@@ -261,6 +261,10 @@ type PortMap struct {
Scheme string `json:"scheme"`
}
func (p PortMap) String() string {
return fmt.Sprintf("%s-%d-%d", p.Scheme, p.HostPort, p.ContainerPort)
}
func (p PortMap) IsAllowedHttp() bool {
return p.Scheme == "http" || p.ContainerPort == 80
}