opcua

package
v1.25.3 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2023 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectionState

type ConnectionState int

ConnectionState used for constants

const (
	// Disconnected constant State 0
	Disconnected ConnectionState = iota
	// Connecting constant State 1
	Connecting
	// Connected constant State 2
	Connected
)

type OpcUAClient

type OpcUAClient struct {
	Config *OpcUAClientConfig
	Log    telegraf.Logger

	State  ConnectionState
	Client *opcua.Client
	// contains filtered or unexported fields
}

func (*OpcUAClient) Connect

func (o *OpcUAClient) Connect() error

Connect to an OPC UA device

func (*OpcUAClient) Disconnect

func (o *OpcUAClient) Disconnect(ctx context.Context) error

func (*OpcUAClient) SetupOptions added in v1.25.1

func (o *OpcUAClient) SetupOptions() error

/ setupOptions read the endpoints from the specified server and setup all authentication

func (*OpcUAClient) StatusCodeOK

func (o *OpcUAClient) StatusCodeOK(code ua.StatusCode) bool

type OpcUAClientConfig

type OpcUAClientConfig struct {
	Endpoint       string          `toml:"endpoint"`
	SecurityPolicy string          `toml:"security_policy"`
	SecurityMode   string          `toml:"security_mode"`
	Certificate    string          `toml:"certificate"`
	PrivateKey     string          `toml:"private_key"`
	Username       string          `toml:"username"`
	Password       string          `toml:"password"`
	AuthMethod     string          `toml:"auth_method"`
	ConnectTimeout config.Duration `toml:"connect_timeout"`
	RequestTimeout config.Duration `toml:"request_timeout"`

	Workarounds OpcUAWorkarounds `toml:"workarounds"`
}

func (*OpcUAClientConfig) CreateClient

func (o *OpcUAClientConfig) CreateClient(log telegraf.Logger) (*OpcUAClient, error)

func (*OpcUAClientConfig) Validate

func (o *OpcUAClientConfig) Validate() error

type OpcUAWorkarounds

type OpcUAWorkarounds struct {
	AdditionalValidStatusCodes []string `toml:"additional_valid_status_codes"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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