Documentation ¶
Index ¶
- type IObjectSource
- type MockSource
- func (s *MockSource) CollectProperties() (core.KWArgs, error)
- func (s *MockSource) Invoke(methodId string, args core.Args) (core.Any, error)
- func (s *MockSource) Linked(objectId string, node *Node) error
- func (s *MockSource) ObjectId() string
- func (s *MockSource) SetProperty(propertyId string, value core.Any) error
- type MockWriteCloser
- type Node
- func (n *Node) Close() error
- func (n *Node) Id() string
- func (n *Node) IncomingPump()
- func (n *Node) NotifyPropertyChange(propertyId string, value core.Any)
- func (n *Node) NotifySignal(signalId string, args core.Args)
- func (n *Node) Registry() *Registry
- func (n *Node) RemoveNode()
- func (n *Node) SendMessage(msg core.Message)
- func (n *Node) SetOutput(out io.WriteCloser)
- func (n *Node) Write(data []byte) (int, error)
- type Registry
- func (r *Registry) AddObjectSource(source IObjectSource) error
- func (r *Registry) AttachRemoteNode(node *Node)
- func (r *Registry) DetachRemoteNode(node *Node)
- func (r *Registry) GetObjectSource(objectId string) IObjectSource
- func (r *Registry) GetRemoteNodes(objectId string) []*Node
- func (r *Registry) Id() string
- func (r *Registry) IsRegistered(objectId string) bool
- func (r *Registry) LinkRemoteNode(objectId string, node *Node)
- func (r *Registry) NotifyPropertyChange(objectId string, kwargs core.KWArgs)
- func (r *Registry) NotifySignal(objectId string, name string, args core.Args)
- func (r *Registry) RemoveObjectSource(source IObjectSource)
- func (r *Registry) SetSourceFactory(factory SourceFactory)
- func (r *Registry) UnlinkRemoteNode(objectId string, node *Node)
- type SourceFactory
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IObjectSource ¶
type MockSource ¶ added in v0.4.0
type MockSource struct { Id string Messages core.Message InvokeHandler func(methodId string, args core.Args) (core.Any, error) SetPropertyHandler func(propertyId string, value core.Any) error LinkedHandler func(objectId string, node *Node) error CollectPropertiesHandler func() (core.KWArgs, error) }
func NewMockSource ¶ added in v0.4.0
func NewMockSource(id string) *MockSource
func (*MockSource) CollectProperties ¶ added in v0.4.0
func (s *MockSource) CollectProperties() (core.KWArgs, error)
func (*MockSource) Linked ¶ added in v0.4.0
func (s *MockSource) Linked(objectId string, node *Node) error
func (*MockSource) ObjectId ¶ added in v0.4.0
func (s *MockSource) ObjectId() string
func (*MockSource) SetProperty ¶ added in v0.4.0
func (s *MockSource) SetProperty(propertyId string, value core.Any) error
type MockWriteCloser ¶ added in v0.4.0
type MockWriteCloser struct { Messages [][]byte WriteHandler func(p []byte) (n int, err error) Closed bool CloseHandler func() error }
func NewMockWriteCloser ¶ added in v0.4.0
func NewMockWriteCloser() *MockWriteCloser
func (*MockWriteCloser) Close ¶ added in v0.4.0
func (m *MockWriteCloser) Close() error
type Node ¶
func (*Node) IncomingPump ¶
func (n *Node) IncomingPump()
func (*Node) NotifyPropertyChange ¶
func (*Node) RemoveNode ¶
func (n *Node) RemoveNode()
func (*Node) SendMessage ¶
func (*Node) SetOutput ¶
func (n *Node) SetOutput(out io.WriteCloser)
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is the registry of remote objects. It is optimized for the retrieval of object sources A object source is registered in the registry and can be retrieved by the object id. The source can have one or more remote nodes linked to it.
func (*Registry) AddObjectSource ¶
func (r *Registry) AddObjectSource(source IObjectSource) error
AddObjectSource adds the object source to the registry.
func (*Registry) AttachRemoteNode ¶
AttachRemoteNode attaches the node to the registry.
func (*Registry) DetachRemoteNode ¶
DetachRemoteNode removes the link between the object and the node.
func (*Registry) GetObjectSource ¶
func (r *Registry) GetObjectSource(objectId string) IObjectSource
GetObjectSource returns the object source by name.
func (*Registry) GetRemoteNodes ¶
GetRemoteNode returns the node that is linked to the object.
func (*Registry) IsRegistered ¶
Checks if the object is registered.
func (*Registry) LinkRemoteNode ¶
LinkRemoteNode adds a link between the object and the node.
func (*Registry) NotifyPropertyChange ¶
NotifyPropertyChange notifies the property change to the nodes.
func (*Registry) NotifySignal ¶ added in v0.3.0
NotifySignal notifies the signal to the nodes that are linked to the object.
func (*Registry) RemoveObjectSource ¶
func (r *Registry) RemoveObjectSource(source IObjectSource)
RemoveObjectSource removes the object source from the registry.
func (*Registry) SetSourceFactory ¶
func (r *Registry) SetSourceFactory(factory SourceFactory)
SetSourceFactory sets the source factory.
func (*Registry) UnlinkRemoteNode ¶
UnlinkRemoteNode removes the link between the object and the node.
type SourceFactory ¶
type SourceFactory func(objectId string) IObjectSource