Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrMalformedEntity indicates malformed entity specification. ErrMalformedEntity = errors.New("malformed entity specification") )
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(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(string, string) error
// Get returns the stored Mainflux route-map for a given OPC-UA pair.
Get(string) (string, error)
// Remove Remove route-map from cache.
Remove(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(thingID, nodeID string) error
// UpdateThing updates thingID:OPC-UA-nodeID route-map
UpdateThing(thingID, nodeID string) error
// RemoveThing removes thingID:OPC-UA-nodeID route-map
RemoveThing(thingID string) error
// CreateChannel creates channelID:OPC-UA-serverURI route-map
CreateChannel(chanID, serverURI string) error
// UpdateChannel updates channelID:OPC-UA-serverURI route-map
UpdateChannel(chanID, serverURI string) error
// RemoveChannel removes channelID:OPC-UA-serverURI route-map
RemoveChannel(chanID string) error
// ConnectThing creates thingID:channelID route-map
ConnectThing(chanID, thingID string) error
// DisconnectThing removes thingID:channelID route-map
DisconnectThing(chanID, thingID string) error
// Browse browses available nodes for a given OPC-UA Server URI and NodeID
Browse(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.
type Subscriber ¶
type Subscriber interface {
// Subscribes to given NodeID and receives events.
Subscribe(Config) error
}
Subscriber represents the OPC-UA Server client.
Click to show internal directories.
Click to hide internal directories.