portcache

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

portcache maintains the state about all current NodePortLocal port mappings for this Node and takes care of configuring the host accordingly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Closeable added in v1.2.0

type Closeable interface {
	Close() error
}

Using Closeable instead of net.Listener makes writing tests easier

type LocalPortOpener added in v1.2.0

type LocalPortOpener interface {
	OpenLocalPort(port int) (Closeable, error)
}

type NodePortData

type NodePortData struct {
	NodePort int
	PodPort  int
	PodIP    string
	// contains filtered or unexported fields
}

type PortTable

type PortTable struct {
	Table           map[int]NodePortData
	StartPort       int
	EndPort         int
	PodPortRules    rules.PodPortRules
	LocalPortOpener LocalPortOpener
	// contains filtered or unexported fields
}

func NewPortTable

func NewPortTable(start, end int) (*PortTable, error)

func (*PortTable) AddRule

func (pt *PortTable) AddRule(podIP string, podPort int) (int, error)

func (*PortTable) CleanupAllEntries

func (pt *PortTable) CleanupAllEntries()

func (*PortTable) DeleteRule

func (pt *PortTable) DeleteRule(podIP string, podPort int) error

func (*PortTable) GetDataForPodIP

func (pt *PortTable) GetDataForPodIP(ip string) []NodePortData

func (*PortTable) GetEntry

func (pt *PortTable) GetEntry(nodeport int) *NodePortData

func (*PortTable) GetEntryByPodIPPort

func (pt *PortTable) GetEntryByPodIPPort(ip string, port int) *NodePortData

func (*PortTable) RuleExists

func (pt *PortTable) RuleExists(podIP string, podPort int) bool

func (*PortTable) SyncRules added in v1.2.0

func (pt *PortTable) SyncRules(allNPLPorts []rules.PodNodePort) error

Directories

Path Synopsis
Package testing is a generated GoMock package.
Package testing is a generated GoMock package.

Jump to

Keyboard shortcuts

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