Back to

Package servicecache

Latest Go to latest

The latest major version is .

Published: Jul 8, 2020 | License: Apache-2.0 | Module:


type ServiceCache

type ServiceCache struct {
	// 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.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier