component

package
v4.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 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 Manager

type Manager struct {
	sync.RWMutex

	// component -> addresses
	Addresses map[string][]string `json:"address"`
	// contains filtered or unexported fields
}

Manager is used to manage components.

func NewManager

func NewManager(storage *core.Storage) *Manager

NewManager creates a new component manager.

func (*Manager) GetAllComponentAddrs

func (c *Manager) GetAllComponentAddrs() map[string][]string

GetAllComponentAddrs returns all components' addresses.

func (*Manager) GetComponent

func (c *Manager) GetComponent(addr string) string

GetComponent returns the component from a given component ID.

func (*Manager) GetComponentAddrs

func (c *Manager) GetComponentAddrs(component string) []string

GetComponentAddrs returns component addresses for a given component.

func (*Manager) Register

func (c *Manager) Register(component, addr string) error

Register is used for registering a component with an address to PD.

func (*Manager) UnRegister

func (c *Manager) UnRegister(component, addr string) error

UnRegister is used for unregistering a component with an address from PD.

Jump to

Keyboard shortcuts

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