proxy

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeout = time.Second * 5
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Codec

type Codec interface {
	Encode(v interface{}) ([]byte, error)
	Decode(data []byte, v interface{}) error
}

func NewCodec

func NewCodec(codec string) Codec

type JsonCodec

type JsonCodec struct {
}

func (*JsonCodec) Decode

func (c *JsonCodec) Decode(data []byte, v interface{}) error

func (*JsonCodec) Encode

func (c *JsonCodec) Encode(v interface{}) ([]byte, error)

type MetaSink

type MetaSink struct {
	Properties core.KWArgs
	Change     func(name string, value core.Any)
	Signal     func(name string, args core.Args)
	// contains filtered or unexported fields
}

func NewMetaSink

func NewMetaSink(id string) *MetaSink

func (*MetaSink) Invoke

func (s *MetaSink) Invoke(methodId string, args core.Args, cb func(v core.Any))

func (*MetaSink) ObjectId

func (s *MetaSink) ObjectId() string

func (*MetaSink) OnInit

func (s *MetaSink) OnInit(objectId string, props core.KWArgs, node *client.Node)

func (*MetaSink) OnPropertyChange

func (s *MetaSink) OnPropertyChange(propertyId string, value core.Any)

func (*MetaSink) OnRelease

func (s *MetaSink) OnRelease()

func (*MetaSink) OnSignal

func (s *MetaSink) OnSignal(signalId string, args core.Args)

type MetaSource

type MetaSource struct {
	Properties core.KWArgs
	OnInvoke   map[string]func(args core.Args) core.Any
	// contains filtered or unexported fields
}

func (*MetaSource) CollectProperties

func (m *MetaSource) CollectProperties() (core.KWArgs, error)

func (*MetaSource) Invoke

func (m *MetaSource) Invoke(methodId string, args core.Args) (core.Any, error)

func (*MetaSource) Linked

func (m *MetaSource) Linked(objectId string, node *remote.Node) error

func (*MetaSource) ObjectId

func (m *MetaSource) ObjectId() string

func (*MetaSource) SetProperty

func (m *MetaSource) SetProperty(propertyId string, value core.Any) error

type Proxy

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

func NewProxy

func NewProxy() *Proxy

NewProxy creates a new proxy instance.

func (*Proxy) Codec

func (p *Proxy) Codec() Codec

func (*Proxy) CreateClientNode

func (p *Proxy) CreateClientNode() *client.Node

func (*Proxy) CreateRemoteNode

func (p *Proxy) CreateRemoteNode() *remote.Node

func (*Proxy) SinkRegistry

func (p *Proxy) SinkRegistry() *client.Registry

func (*Proxy) SourceRegistry

func (p *Proxy) SourceRegistry() *remote.Registry

type RelaySource

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

func NewRelaySource

func NewRelaySource(id string, conn *nats.Conn, codec Codec) *RelaySource

func (*RelaySource) CollectProperties

func (s *RelaySource) CollectProperties() (core.KWArgs, error)

func (*RelaySource) Invoke

func (s *RelaySource) Invoke(methodId string, args core.Args) (core.Any, error)

func (*RelaySource) Linked

func (s *RelaySource) Linked(objectId string, node *remote.Node) error

func (*RelaySource) ObjectId

func (s *RelaySource) ObjectId() string

func (*RelaySource) SetProperty

func (s *RelaySource) SetProperty(propertyId string, value core.Any) error

Jump to

Keyboard shortcuts

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