client

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2023 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IObjectSink

type IObjectSink interface {
	ObjectId() string
	OnSignal(signalId string, args core.Args)
	OnPropertyChange(propertyId string, value core.Any)
	OnInit(objectId string, props core.KWArgs, node *Node)
	OnRelease()
}

type InvokeReplyArg

type InvokeReplyArg struct {
	Identifier string
	Value      core.Any
}

type InvokeReplyFunc

type InvokeReplyFunc func(arg InvokeReplyArg)

type MockSink

type MockSink struct {
	// contains filtered or unexported fields
}

MockSink is an IObjectSink implementation

func NewMockSink added in v0.4.0

func NewMockSink(objectId string) *MockSink

func (*MockSink) ObjectId

func (m *MockSink) ObjectId() string

func (*MockSink) OnInit

func (m *MockSink) OnInit(objectId string, props core.KWArgs, node *Node)

func (*MockSink) OnPropertyChange

func (m *MockSink) OnPropertyChange(propertyId string, value core.Any)

func (*MockSink) OnRelease

func (m *MockSink) OnRelease()

func (*MockSink) OnSignal

func (m *MockSink) OnSignal(signalId string, args core.Args)

type Node

type Node struct {
	// contains filtered or unexported fields
}

func NewNode

func NewNode(registry *Registry) *Node

func (*Node) Close

func (n *Node) Close() error

func (*Node) Id

func (n *Node) Id() string

func (*Node) InvokeRemote

func (n *Node) InvokeRemote(methodId string, args core.Args, f InvokeReplyFunc)

func (*Node) LinkRemoteNode

func (n *Node) LinkRemoteNode(objectId string)

func (Node) Registry

func (n Node) Registry() *Registry

func (*Node) SendMessage

func (n *Node) SendMessage(msg core.Message)

func (*Node) SetOutput

func (n *Node) SetOutput(out io.WriteCloser)

func (*Node) SetRemoteProperty

func (n *Node) SetRemoteProperty(propertyId string, value core.Any)

func (*Node) UnlinkRemoteNode

func (n *Node) UnlinkRemoteNode(objectId string)

func (*Node) Write

func (n *Node) Write(data []byte) (int, error)

Write handles a message from the source. We handle init, property change, invoke reply, signal messages.

type Registry

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

Registry is a registry of object sinks. It is used to keep track of object sinks and their associated client nodes. It is optimized for the retrieval of object sinks by object id. A sink is always associated with zero or one client node. A node can be linked to zero or many sinks.

func NewRegistry

func NewRegistry() *Registry

func (*Registry) AddObjectSink

func (r *Registry) AddObjectSink(sink IObjectSink) error

func (*Registry) AttachClientNode

func (r *Registry) AttachClientNode(node *Node)

attach client node to registry

func (*Registry) DetachClientNode

func (r *Registry) DetachClientNode(node *Node)

detach client node from registry

func (*Registry) GetClientNode added in v0.4.0

func (r *Registry) GetClientNode(objectId string) *Node

func (*Registry) Id

func (r *Registry) Id() string

func (*Registry) IsRegistered added in v0.4.0

func (r *Registry) IsRegistered(objectId string) bool

func (*Registry) LinkClientNode

func (r *Registry) LinkClientNode(objectId string, node *Node)

func (*Registry) ObjectIds

func (r *Registry) ObjectIds() []string

func (*Registry) ObjectSink

func (r *Registry) ObjectSink(objectId string) IObjectSink

get object sink by name

func (*Registry) RemoveObjectSink

func (r *Registry) RemoveObjectSink(objectId string)

remove object sink from registry

func (*Registry) SetSinkFactory

func (r *Registry) SetSinkFactory(factory SinkFactory)

SetSinkFactory sets the sink factory.

func (*Registry) UnlinkClientNode

func (r *Registry) UnlinkClientNode(objectId string)

type SinkFactory

type SinkFactory func(objectId string) IObjectSink

type SinkToClientEntry

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

Jump to

Keyboard shortcuts

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