Documentation ¶
Index ¶
- type MultiplexedPortMapping
- func (m *MultiplexedPortMapping) Add(namespace, name string, port int32) (int32, error)
- func (m *MultiplexedPortMapping) Find(namespace, name string, port int32) (int32, bool)
- func (m *MultiplexedPortMapping) Remove(namespace, name string, port int32) (int32, bool)
- func (m *MultiplexedPortMapping) Set(namespace, name string, fromPort, toPort int32) error
- type PortMapping
- func (p *PortMapping) Add(namespace, name string, port int32) (int32, error)
- func (p *PortMapping) Find(namespace, name string, port int32) (int32, bool)
- func (p *PortMapping) Remove(namespace, name string, port int32) (int32, bool)
- func (p *PortMapping) Set(namespace, name string, fromPort, toPort int32) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MultiplexedPortMapping ¶
type MultiplexedPortMapping struct {
// contains filtered or unexported fields
}
MultiplexedPortMapping is a PortMapper that maps many service ports to a single target port.
func NewMultiplexedPortMapping ¶
func NewMultiplexedPortMapping(minPort, maxPort int32) *MultiplexedPortMapping
NewMultiplexedPortMapping creates and returns a new MultiplexedPortMapping instance.
func (*MultiplexedPortMapping) Add ¶
func (m *MultiplexedPortMapping) Add(namespace, name string, port int32) (int32, error)
Add adds a new mapping between the given service port and the first port available in the range defined within minPort and maxPort. If there's no port left, an error will be returned.
func (*MultiplexedPortMapping) Find ¶
func (m *MultiplexedPortMapping) Find(namespace, name string, port int32) (int32, bool)
Find searches the port mapped to the given service port.
type PortMapping ¶
type PortMapping struct {
// contains filtered or unexported fields
}
PortMapping is a PortMapper that map one service port to one target port.
func NewPortMapping ¶
func NewPortMapping(minPort, maxPort int32) *PortMapping
NewPortMapping creates and returns a new PortMapping instance.
func (*PortMapping) Add ¶
func (p *PortMapping) Add(namespace, name string, port int32) (int32, error)
Add adds a new mapping between the given service port and the first port available in the range defined within minPort and maxPort. If there's no port left, an error will be returned.
func (*PortMapping) Find ¶
func (p *PortMapping) Find(namespace, name string, port int32) (int32, bool)
Find searches the port mapped to the given service port.