servicecache

package
v10.174.10+incompatible Latest Latest
Warning

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

Go to latest
Published: May 30, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ServiceCache

type ServiceCache struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

ServiceCache is a new service cache

func NewTable

func NewTable() *ServiceCache

NewTable creates a new table

func (*ServiceCache) Add

func (s *ServiceCache) Add(e *common.Service, id string, data interface{}, local bool) error

Add adds a service into the cache. Returns error of if any overlap has been detected.

func (*ServiceCache) DeleteByID

func (s *ServiceCache) DeleteByID(id string, local bool)

DeleteByID will delete all entries related to this ID from all references.

func (*ServiceCache) Find

func (s *ServiceCache) Find(ip net.IP, port int, host string, local bool) interface{}

Find searches for a matching service, given an IP and port. Caller must specify the local or remote context.

func (*ServiceCache) FindListeningServicesForPU

func (s *ServiceCache) FindListeningServicesForPU(id string) (interface{}, *portspec.PortSpec)

FindListeningServicesForPU returns a service that is found and the associated portSpecifications that refer to this service.

Jump to

Keyboard shortcuts

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