ports

package
v0.8.0-alpha3 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	RouterPortDef = v1.PortDef{
		Publish:    true,
		Port:       80,
		Protocol:   v1.ProtocolHTTP,
		TargetPort: 8080,
	}
)

Functions

func ByProtocol

func ByProtocol(ports []v1.PortDef, protocols ...v1.Protocol) (result []v1.PortDef)

func CollectContainerPorts

func CollectContainerPorts(container *v1.Container, devMode bool) (result []v1.PortDef)

func CopyServicePorts

func CopyServicePorts(ports []corev1.ServicePort) (result []corev1.ServicePort)

func DedupPorts

func DedupPorts(ports []corev1.ServicePort) (result []corev1.ServicePort)

func FilterDevPorts

func FilterDevPorts(ports []v1.PortDef, devMode bool) (result []v1.PortDef)

func IsLinked

func IsLinked(app *v1.AppInstance, name string) bool

func LinkService

func LinkService(app *v1.AppInstance, name string) string

func PortPublishForService

func PortPublishForService(serviceName string, bindings []v1.PortBinding) (result []v1.PortPublish)

func ToServicePort

func ToServicePort(port v1.PortDef) corev1.ServicePort

func ToServicePorts

func ToServicePorts(ports []v1.PortDef) []corev1.ServicePort

Types

type BoundPorts

type BoundPorts map[ListenDef][]v1.PortDef

func ApplyBindings

func ApplyBindings(mode v1.PublishMode, bindings []v1.PortPublish, ports []v1.PortDef) (result BoundPorts)

func (BoundPorts) ByHostname

func (b BoundPorts) ByHostname() map[string][]v1.PortDef

func (BoundPorts) ServicePorts

func (b BoundPorts) ServicePorts() (result []corev1.ServicePort, err error)

type ListenDef

type ListenDef struct {
	// Hostname is empty if Protocol is not http
	Hostname string
	// Port if tcp or udp, for http this should always be 0
	Port     int32
	Protocol v1.Protocol
}

Jump to

Keyboard shortcuts

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