memory

package
v0.0.0-...-edd91d0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2019 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MemDiscovery

type MemDiscovery struct {
	Mutex sync.Mutex

	Looping bool
	Logger  *log.Logger

	Listeners []chan *qtiny.Message

	// local nanos
	LocalsMutex sync.RWMutex
	Locals      map[string]*qtiny.Nano

	// remote nanos
	RemotesMutex sync.RWMutex
	Remotes      map[string]*qtiny.Nano

	// local gateway
	GatewaysMutex sync.RWMutex
	Gateways      map[string]qtiny.Gateway

	// remote portal
	PortalsMutex sync.RWMutex
	Portals      map[string]*qtiny.Portal

	LocalAsRemote bool
	// contains filtered or unexported fields
}

func (*MemDiscovery) GatewayGet

func (o *MemDiscovery) GatewayGet(gatekey string) qtiny.Gateway

func (*MemDiscovery) GatewayPublish

func (o *MemDiscovery) GatewayPublish(gatekey string, gateway qtiny.Gateway) error

func (*MemDiscovery) GatewayUnpublish

func (o *MemDiscovery) GatewayUnpublish(gatekey string) error

func (*MemDiscovery) GetLogger

func (o *MemDiscovery) GetLogger() *log.Logger

func (*MemDiscovery) GetNodeId

func (o *MemDiscovery) GetNodeId() string

func (*MemDiscovery) GetTag

func (o *MemDiscovery) GetTag() string

func (*MemDiscovery) NanoLocalAdd

func (o *MemDiscovery) NanoLocalAdd(nano *qtiny.Nano)

func (*MemDiscovery) NanoLocalAll

func (o *MemDiscovery) NanoLocalAll() map[string]*qtiny.Nano

func (*MemDiscovery) NanoLocalGet

func (o *MemDiscovery) NanoLocalGet(address string) (*qtiny.Nano, error)

func (*MemDiscovery) NanoLocalRegister

func (o *MemDiscovery) NanoLocalRegister(nano *qtiny.Nano) error

func (*MemDiscovery) NanoLocalRemove

func (o *MemDiscovery) NanoLocalRemove(address string)

func (*MemDiscovery) NanoLocalUnregister

func (o *MemDiscovery) NanoLocalUnregister(nano *qtiny.Nano) error

func (*MemDiscovery) NanoRemoteGet

func (o *MemDiscovery) NanoRemoteGet(address string) (*qtiny.Nano, error)

func (*MemDiscovery) NanoRemoteRegister

func (o *MemDiscovery) NanoRemoteRegister(nano *qtiny.Nano) error

func (*MemDiscovery) NanoRemoteUnregister

func (o *MemDiscovery) NanoRemoteUnregister(nano *qtiny.Nano) error

func (*MemDiscovery) PortalCreate

func (o *MemDiscovery) PortalCreate(addresss string) *qtiny.Portal

func (*MemDiscovery) PortalGet

func (o *MemDiscovery) PortalGet(address string) qtiny.PortalKind

func (*MemDiscovery) PortalRemove

func (o *MemDiscovery) PortalRemove(address string)

func (*MemDiscovery) PortalSet

func (o *MemDiscovery) PortalSet(portal *qtiny.Portal)

func (*MemDiscovery) SetLogger

func (o *MemDiscovery) SetLogger(logger *log.Logger)

func (*MemDiscovery) SetNodeId

func (o *MemDiscovery) SetNodeId(id string)

func (*MemDiscovery) Start

func (o *MemDiscovery) Start(config map[string]interface{}) error

func (*MemDiscovery) Stop

func (o *MemDiscovery) Stop(map[string]interface{}) error

type MemGateway

type MemGateway struct {
	Id     string
	IdHash uint32

	NodeId     string
	NodeIdHash uint32

	Type     string
	TypeHash uint32

	Tag string

	Mutex sync.Mutex

	Looping bool
	Logger  *log.Logger

	QueueLimit int
	Queue      chan *qtiny.Message

	Listeners []chan *qtiny.Message

	Meta map[string]interface{}

	Config map[string]interface{}

	EventChannelsMutex sync.RWMutex
	EventChannels      map[string]chan *qtiny.GatewayEventBox

	Publisher PublishHandler

	Verbose int
}

func (*MemGateway) Broadcast

func (o *MemGateway) Broadcast(message *qtiny.Message, discovery qtiny.Discovery) error

func (*MemGateway) DispatchLoop

func (o *MemGateway) DispatchLoop()

func (*MemGateway) EventChannelClose

func (o *MemGateway) EventChannelClose(channelId string) error

func (*MemGateway) EventChannelGet

func (o *MemGateway) EventChannelGet(channelId string) (<-chan *qtiny.GatewayEventBox, error)

func (*MemGateway) EventChannelSend

func (o *MemGateway) EventChannelSend(event qtiny.GatewayEvent, meta map[string]interface{})

func (*MemGateway) GetConfig

func (o *MemGateway) GetConfig() map[string]interface{}

func (*MemGateway) GetId

func (o *MemGateway) GetId() string

func (*MemGateway) GetIdHash

func (o *MemGateway) GetIdHash() uint32

func (*MemGateway) GetLogger

func (o *MemGateway) GetLogger() *log.Logger

func (*MemGateway) GetMeta

func (o *MemGateway) GetMeta() map[string]interface{}

func (*MemGateway) GetNodeId

func (o *MemGateway) GetNodeId() string

func (*MemGateway) GetNodeIdHash

func (o *MemGateway) GetNodeIdHash() uint32

func (*MemGateway) GetTag

func (o *MemGateway) GetTag() string

func (*MemGateway) GetType

func (o *MemGateway) GetType() string

func (*MemGateway) GetTypeHash

func (o *MemGateway) GetTypeHash() uint32

func (*MemGateway) IsPortalValid

func (o *MemGateway) IsPortalValid(portal qtiny.PortalKind) bool

func (*MemGateway) Multicast

func (o *MemGateway) Multicast(message *qtiny.Message, discovery qtiny.Discovery) error

func (*MemGateway) Poll

func (o *MemGateway) Poll(limit int) (chan *qtiny.Message, error)

func (*MemGateway) Post

func (o *MemGateway) Post(message *qtiny.Message, discovery qtiny.Discovery) error

func (*MemGateway) Publish

func (o *MemGateway) Publish(message *qtiny.Message, discovery qtiny.Discovery) (err error)

func (*MemGateway) SetConfig

func (o *MemGateway) SetConfig(config map[string]interface{})

func (*MemGateway) SetId

func (o *MemGateway) SetId(id string)

func (*MemGateway) SetLogger

func (o *MemGateway) SetLogger(logger *log.Logger)

func (*MemGateway) SetNodeId

func (o *MemGateway) SetNodeId(nodeId string)

func (*MemGateway) Start

func (o *MemGateway) Start(config map[string]interface{}) error

func (*MemGateway) Stop

func (o *MemGateway) Stop(map[string]interface{}) error

type PublishHandler

type PublishHandler func(messageType qtiny.MessageType,
	portalAddress string, portal qtiny.PortalKind,
	remote *qtiny.Nano, message *qtiny.Message,
	discovery qtiny.Discovery, gateway qtiny.Gateway, data []byte) error

Jump to

Keyboard shortcuts

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