Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BrowsedNode ¶
type BrowsedNode struct { NodeID string DataType string Description string Unit string Scale string BrowseName string }
BrowsedNode represents the details of a browsed OPC-UA node.
type Browser ¶
type Browser interface { // Browse availlable Nodes for a given URI. Browse(string, string) ([]BrowsedNode, error) }
Browser represents the OPC-UA Server Nodes browser.
type Config ¶
type Config struct { ServerURI string NodeID string Interval string Policy string Mode string CertFile string KeyFile string }
Config OPC-UA Server
type EventStore ¶
type EventStore interface { // Subscribes to a given subject and receives events. Subscribe(context.Context, string) error }
EventStore represents event source for things and channels provisioning.
type RouteMapRepository ¶
type RouteMapRepository interface { // Save stores/routes pair OPC-UA Server & Mainflux. Save(context.Context, string, string) error // Get returns the stored Mainflux route-map for a given OPC-UA pair. Get(context.Context, string) (string, error) // Remove Remove route-map from cache. Remove(context.Context, string) error }
RouteMapRepository store route-map between the OPC-UA Server and Mainflux
type Service ¶
type Service interface { // CreateThing creates thingID:OPC-UA-nodeID route-map CreateThing(ctx context.Context, thingID, nodeID string) error // UpdateThing updates thingID:OPC-UA-nodeID route-map UpdateThing(ctx context.Context, thingID, nodeID string) error // RemoveThing removes thingID:OPC-UA-nodeID route-map RemoveThing(ctx context.Context, thingID string) error // CreateChannel creates channelID:OPC-UA-serverURI route-map CreateChannel(ctx context.Context, chanID, serverURI string) error // UpdateChannel updates channelID:OPC-UA-serverURI route-map UpdateChannel(ctx context.Context, chanID, serverURI string) error // RemoveChannel removes channelID:OPC-UA-serverURI route-map RemoveChannel(ctx context.Context, chanID string) error // ConnectThing creates thingID:channelID route-map ConnectThing(ctx context.Context, chanID, thingID string) error // DisconnectThing removes thingID:channelID route-map DisconnectThing(ctx context.Context, chanID, thingID string) error // Browse browses available nodes for a given OPC-UA Server URI and NodeID Browse(ctx context.Context, serverURI, namespace, identifier string) ([]BrowsedNode, error) }
Service specifies an API that must be fullfiled by the domain service implementation, and all of its decorators (e.g. logging & metrics).
func New ¶
func New(sub Subscriber, brow Browser, thingsRM, channelsRM, connectRM RouteMapRepository, cfg Config, log logger.Logger) Service
New instantiates the OPC-UA adapter implementation.
Click to show internal directories.
Click to hide internal directories.