Documentation ¶
Index ¶
- Constants
- Variables
- func NewDriver(_options ...options.WithOption) plc4go.PlcDriver
- type CertificateKeyPair
- type CommandAndArgumentsCount
- type Configuration
- type Connection
- func (c *Connection) Close() <-chan plc4go.PlcConnectionCloseResult
- func (c *Connection) ConnectWithContext(ctx context.Context) <-chan plc4go.PlcConnectionConnectResult
- func (c *Connection) GetConnection() plc4go.PlcConnection
- func (c *Connection) GetConnectionId() string
- func (c *Connection) GetMessageCodec() spi.MessageCodec
- func (c *Connection) GetMetadata() apiModel.PlcConnectionMetadata
- func (c *Connection) GetTracer() tracer.Tracer
- func (c *Connection) IsTraceEnabled() bool
- func (c *Connection) ReadRequestBuilder() apiModel.PlcReadRequestBuilder
- func (d *Connection) Serialize() ([]byte, error)
- func (d *Connection) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
- func (d *Connection) String() string
- func (c *Connection) SubscriptionRequestBuilder() apiModel.PlcSubscriptionRequestBuilder
- func (c *Connection) UnsubscriptionRequestBuilder() apiModel.PlcUnsubscriptionRequestBuilder
- func (c *Connection) WriteRequestBuilder() apiModel.PlcWriteRequestBuilder
- type Driver
- type DriverContext
- type EncryptionHandler
- type MessageCodec
- func (m *MessageCodec) Connect() error
- func (m *MessageCodec) GetCodec() spi.MessageCodec
- func (m *MessageCodec) Receive() (spi.Message, error)
- func (m *MessageCodec) Send(message spi.Message) error
- func (d *MessageCodec) Serialize() ([]byte, error)
- func (d *MessageCodec) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
- func (d *MessageCodec) String() string
- type Reader
- type SecureChannel
- type SecureChannelTransactionManager
- type SecureChannelTransactionManagerTransaction
- type Subscriber
- func (s *Subscriber) Register(consumer apiModel.PlcSubscriptionEventConsumer, ...) apiModel.PlcConsumerRegistration
- func (d *Subscriber) Serialize() ([]byte, error)
- func (d *Subscriber) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
- func (d *Subscriber) String() string
- func (s *Subscriber) Subscribe(_ context.Context, subscriptionRequest apiModel.PlcSubscriptionRequest) <-chan apiModel.PlcSubscriptionRequestResult
- func (s *Subscriber) Unregister(registration apiModel.PlcConsumerRegistration)
- func (s *Subscriber) Unsubscribe(ctx context.Context, unsubscriptionRequest apiModel.PlcUnsubscriptionRequest) <-chan apiModel.PlcUnsubscriptionRequestResult
- type SubscriptionHandle
- type Tag
- type TagHandler
- type Writer
Constants ¶
View Source
const ( VERSION = uint32(0) DEFAULT_MAX_CHUNK_COUNT = 64 DEFAULT_MAX_MESSAGE_SIZE = uint32(2097152) DEFAULT_RECEIVE_BUFFER_SIZE = uint32(65535) DEFAULT_SEND_BUFFER_SIZE = uint32(65535) REQUEST_TIMEOUT = 10 * time.Second REQUEST_TIMEOUT_LONG = 10000 PASSWORD_ENCRYPTION_ALGORITHM = "http://www.w3.org/2001/04/xmlenc#rsa-oaep" EPOCH_OFFSET = 116444736000000000 //Offset between OPC UA epoch time and linux epoch time. )
Variables ¶
View Source
var ( SECURITY_POLICY_NONE = readWriteModel.NewPascalString(utils.ToPtr("http://opcfoundation.org/UA/SecurityPolicy#None")) NULL_STRING = readWriteModel.NewPascalString(nil) NULL_BYTE_STRING = readWriteModel.NewPascalByteString(-1, nil) NULL_EXPANDED_NODEID = readWriteModel.NewExpandedNodeId(false, false, readWriteModel.NewNodeIdTwoByte(0), nil, nil, ) BINARY_ENCODING_MASK = readWriteModel.NewExtensionObjectEncodingMask(false, false, true) NULL_EXTENSION_OBJECT = readWriteModel.NewNullExtensionObjectWithMask(NULL_EXPANDED_NODEID, readWriteModel.NewExtensionObjectEncodingMask(false, false, false), 0, false) // Body INET_ADDRESS_PATTERN = regexp.MustCompile(`(.(?P<transportCode>tcp))?://(?P<transportHost>[\w.-]+)(:(?P<transportPort>\d*))?`) URI_PATTERN = regexp.MustCompile(`^(?P<protocolCode>opc)` + INET_ADDRESS_PATTERN.String() + `(?P<transportEndpoint>[\w/=]*)[?]?`) APPLICATION_URI = readWriteModel.NewPascalString(utils.ToPtr("urn:apache:plc4x:client")) PRODUCT_URI = readWriteModel.NewPascalString(utils.ToPtr("urn:apache:plc4x:client")) APPLICATION_TEXT = readWriteModel.NewPascalString(utils.ToPtr("OPCUA client for the Apache PLC4X:PLC4J project")) DEFAULT_CONNECTION_LIFETIME = uint32(36000000) )
Functions ¶
Types ¶
type CertificateKeyPair ¶
type CertificateKeyPair struct {
// contains filtered or unexported fields
}
func NewCertificateKeyPair ¶
func NewCertificateKeyPair(keyPair *rsa.PrivateKey, certificate *x509.Certificate) *CertificateKeyPair
type Configuration ¶
type Configuration struct { Code string Host string Port string Endpoint string TransportEndpoint string Params string IsEncrypted bool Thumbprint readWriteModel.PascalByteString SenderCertificate []byte Discovery bool Username string Password string SecurityPolicy string KeyStoreFile string CertDirectory string KeyStorePassword string Ckp *CertificateKeyPair // contains filtered or unexported fields }
func ParseFromOptions ¶
func (*Configuration) Serialize ¶
func (d *Configuration) Serialize() ([]byte, error)
func (*Configuration) SerializeWithWriteBuffer ¶
func (d *Configuration) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
func (*Configuration) String ¶
func (d *Configuration) String() string
type Connection ¶
type Connection struct { _default.DefaultConnection // contains filtered or unexported fields }
func NewConnection ¶
func NewConnection(messageCodec *MessageCodec, configuration Configuration, driverContext DriverContext, tagHandler spi.PlcTagHandler, connectionOptions map[string][]string, _options ...options.WithOption) *Connection
func (*Connection) Close ¶
func (c *Connection) Close() <-chan plc4go.PlcConnectionCloseResult
func (*Connection) ConnectWithContext ¶
func (c *Connection) ConnectWithContext(ctx context.Context) <-chan plc4go.PlcConnectionConnectResult
func (*Connection) GetConnection ¶
func (c *Connection) GetConnection() plc4go.PlcConnection
func (*Connection) GetConnectionId ¶
func (c *Connection) GetConnectionId() string
func (*Connection) GetMessageCodec ¶
func (c *Connection) GetMessageCodec() spi.MessageCodec
func (*Connection) GetMetadata ¶
func (c *Connection) GetMetadata() apiModel.PlcConnectionMetadata
func (*Connection) GetTracer ¶
func (c *Connection) GetTracer() tracer.Tracer
func (*Connection) IsTraceEnabled ¶
func (c *Connection) IsTraceEnabled() bool
func (*Connection) ReadRequestBuilder ¶
func (c *Connection) ReadRequestBuilder() apiModel.PlcReadRequestBuilder
func (*Connection) Serialize ¶
func (d *Connection) Serialize() ([]byte, error)
func (*Connection) SerializeWithWriteBuffer ¶
func (d *Connection) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
func (*Connection) String ¶
func (d *Connection) String() string
func (*Connection) SubscriptionRequestBuilder ¶
func (c *Connection) SubscriptionRequestBuilder() apiModel.PlcSubscriptionRequestBuilder
func (*Connection) UnsubscriptionRequestBuilder ¶
func (c *Connection) UnsubscriptionRequestBuilder() apiModel.PlcUnsubscriptionRequestBuilder
func (*Connection) WriteRequestBuilder ¶
func (c *Connection) WriteRequestBuilder() apiModel.PlcWriteRequestBuilder
type Driver ¶
type Driver struct { _default.DefaultDriver // contains filtered or unexported fields }
func (*Driver) GetConnectionWithContext ¶
func (*Driver) SetAwaitDisconnectComplete ¶
func (*Driver) SetAwaitSetupComplete ¶
type DriverContext ¶
type DriverContext struct {
// contains filtered or unexported fields
}
func NewDriverContext ¶
func NewDriverContext(configuration Configuration) DriverContext
func (*DriverContext) Serialize ¶
func (d *DriverContext) Serialize() ([]byte, error)
func (*DriverContext) SerializeWithWriteBuffer ¶
func (d *DriverContext) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
func (*DriverContext) String ¶
func (d *DriverContext) String() string
type EncryptionHandler ¶
type EncryptionHandler struct {
// contains filtered or unexported fields
}
func NewEncryptionHandler ¶
func NewEncryptionHandler(log zerolog.Logger, ckp *CertificateKeyPair, senderCertificate []byte, securityPolicy string) *EncryptionHandler
func (*EncryptionHandler) String ¶
func (h *EncryptionHandler) String() string
type MessageCodec ¶
type MessageCodec struct { _default.DefaultCodec // contains filtered or unexported fields }
func NewMessageCodec ¶
func NewMessageCodec(transportInstance transports.TransportInstance, _options ...options.WithOption) *MessageCodec
func (*MessageCodec) Connect ¶
func (m *MessageCodec) Connect() error
func (*MessageCodec) GetCodec ¶
func (m *MessageCodec) GetCodec() spi.MessageCodec
func (*MessageCodec) Serialize ¶
func (d *MessageCodec) Serialize() ([]byte, error)
func (*MessageCodec) SerializeWithWriteBuffer ¶
func (d *MessageCodec) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
func (*MessageCodec) String ¶
func (d *MessageCodec) String() string
type Reader ¶
type Reader struct {
// contains filtered or unexported fields
}
func NewReader ¶
func NewReader(connection *Connection, _options ...options.WithOption) *Reader
func (*Reader) Read ¶
func (m *Reader) Read(ctx context.Context, readRequest apiModel.PlcReadRequest) <-chan apiModel.PlcReadRequestResult
type SecureChannel ¶
type SecureChannel struct {
// contains filtered or unexported fields
}
func NewSecureChannel ¶
func NewSecureChannel(log zerolog.Logger, ctx DriverContext, configuration Configuration) *SecureChannel
func (*SecureChannel) Serialize ¶
func (d *SecureChannel) Serialize() ([]byte, error)
func (*SecureChannel) SerializeWithWriteBuffer ¶
func (d *SecureChannel) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
func (*SecureChannel) String ¶
func (d *SecureChannel) String() string
type SecureChannelTransactionManager ¶
type SecureChannelTransactionManager struct {
// contains filtered or unexported fields
}
func NewSecureChannelTransactionManager ¶
func NewSecureChannelTransactionManager(log zerolog.Logger) *SecureChannelTransactionManager
func (*SecureChannelTransactionManager) Serialize ¶
func (d *SecureChannelTransactionManager) Serialize() ([]byte, error)
func (*SecureChannelTransactionManager) SerializeWithWriteBuffer ¶
func (d *SecureChannelTransactionManager) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
func (*SecureChannelTransactionManager) String ¶
func (d *SecureChannelTransactionManager) String() string
type SecureChannelTransactionManagerTransaction ¶
type SecureChannelTransactionManagerTransaction struct {
// contains filtered or unexported fields
}
type Subscriber ¶
type Subscriber struct {
// contains filtered or unexported fields
}
func NewSubscriber ¶
func NewSubscriber(addSubscriber func(subscriber *Subscriber), connection *Connection, _options ...options.WithOption) *Subscriber
func (*Subscriber) Register ¶
func (s *Subscriber) Register(consumer apiModel.PlcSubscriptionEventConsumer, handles []apiModel.PlcSubscriptionHandle) apiModel.PlcConsumerRegistration
func (*Subscriber) Serialize ¶
func (d *Subscriber) Serialize() ([]byte, error)
func (*Subscriber) SerializeWithWriteBuffer ¶
func (d *Subscriber) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error
func (*Subscriber) String ¶
func (d *Subscriber) String() string
func (*Subscriber) Subscribe ¶
func (s *Subscriber) Subscribe(_ context.Context, subscriptionRequest apiModel.PlcSubscriptionRequest) <-chan apiModel.PlcSubscriptionRequestResult
func (*Subscriber) Unregister ¶
func (s *Subscriber) Unregister(registration apiModel.PlcConsumerRegistration)
func (*Subscriber) Unsubscribe ¶
func (s *Subscriber) Unsubscribe(ctx context.Context, unsubscriptionRequest apiModel.PlcUnsubscriptionRequest) <-chan apiModel.PlcUnsubscriptionRequestResult
type SubscriptionHandle ¶
type SubscriptionHandle struct { *spiModel.DefaultPlcSubscriptionHandle // contains filtered or unexported fields }
func NewSubscriptionHandle ¶
func NewSubscriptionHandle(log zerolog.Logger, subscriber *Subscriber, connection *Connection, subscriptionRequest apiModel.PlcSubscriptionRequest, subscriptionId uint32, cycleTime time.Duration) *SubscriptionHandle
type Tag ¶
type Tag interface { apiModel.PlcTag GetIdentifierType() readWriteModel.OpcuaIdentifierType GetIdentifier() string GetNamespace() int }
func NewTag ¶
func NewTag(namespace int, identifier string, identifierType readWriteModel.OpcuaIdentifierType, dataType readWriteModel.OpcuaDataType) Tag
type TagHandler ¶
type TagHandler struct {
// contains filtered or unexported fields
}
func NewTagHandler ¶
func NewTagHandler() TagHandler
func (TagHandler) ParseQuery ¶
func (m TagHandler) ParseQuery(_ string) (apiModel.PlcQuery, error)
type Writer ¶
type Writer struct {
// contains filtered or unexported fields
}
func NewWriter ¶
func NewWriter(connection *Connection, _options ...options.WithOption) *Writer
func (*Writer) Write ¶
func (m *Writer) Write(ctx context.Context, writeRequest apiModel.PlcWriteRequest) <-chan apiModel.PlcWriteRequestResult
func (*Writer) WriteSync ¶
func (m *Writer) WriteSync(ctx context.Context, writeRequest apiModel.PlcWriteRequest, result chan apiModel.PlcWriteRequestResult)
Source Files ¶
- CertificateGenerator.go
- CertificateKeyPair.go
- Configuration.go
- Configuration_plc4xgen.go
- Connection.go
- Connection_plc4xgen.go
- Driver.go
- DriverContext.go
- DriverContext_plc4xgen.go
- EncryptionHandler.go
- MessageCodec.go
- MessageCodec_plc4xgen.go
- Reader.go
- SecureChannel.go
- SecureChannelTransactionManager.go
- SecureChannelTransactionManager_plc4xgen.go
- SecureChannel_plc4xgen.go
- Subscriber.go
- Subscriber_plc4xgen.go
- SubscriptionHandle.go
- Tag.go
- TagHandler.go
- Writer.go
- common.go
Click to show internal directories.
Click to hide internal directories.