_default

package
v0.0.0-...-00939be Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package _default contains default implementations for interfaces defined within the spi

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WithCustomMessageHandler

func WithCustomMessageHandler(customMessageHandler CustomMessageHandler) options.WithOption

func WithPlcTagHandler

func WithPlcTagHandler(tagHandler spi.PlcTagHandler) options.WithOption

func WithPlcValueHandler

func WithPlcValueHandler(plcValueHandler spi.PlcValueHandler) options.WithOption

Types

type CustomMessageHandler

type CustomMessageHandler func(ctx context.Context, codec DefaultCodecRequirements, message spi.Message) bool

type DefaultBrowser

type DefaultBrowser interface {
	spi.PlcBrowser
}

func NewDefaultBrowser

func NewDefaultBrowser(defaultBrowserRequirements DefaultBrowserRequirements, _options ...options.WithOption) DefaultBrowser

type DefaultBrowserRequirements

type DefaultBrowserRequirements interface {
	BrowseQuery(ctx context.Context, interceptor func(result apiModel.PlcBrowseItem) bool, queryName string, query apiModel.PlcQuery) (apiModel.PlcResponseCode, []apiModel.PlcBrowseItem)
}

DefaultBrowserRequirements adds required methods to Browser that are needed when using DefaultBrowser

type DefaultCodec

DefaultCodec is a default codec implementation which has so sensitive defaults for message handling and a built-in worker

func NewDefaultCodec

func NewDefaultCodec(requirements DefaultCodecRequirements, transportInstance transports.TransportInstance, options ...options.WithOption) DefaultCodec

NewDefaultCodec is the factory for a DefaultCodec

type DefaultCodecRequirements

type DefaultCodecRequirements interface {
	GetCodec() spi.MessageCodec
	Send(ctx context.Context, interactionInfo string, message spi.Message) error
	Receive(ctx context.Context) (spi.Message, error)
}

DefaultCodecRequirements adds required methods to MessageCodec that are needed when using DefaultCodec

type DefaultConnection

type DefaultConnection interface {
	utils.Serializable
	plc4go.PlcConnection
	spi.TransportInstanceExposer
	spi.HandlerExposer
	SetConnected(connected bool)
}

DefaultConnection should be used as an embedded struct. All defined methods here have default implementations

func NewDefaultConnection

func NewDefaultConnection(requirements DefaultConnectionRequirements, options ...options.WithOption) DefaultConnection

NewDefaultConnection is the factory for a DefaultConnection

type DefaultConnectionMetadata

type DefaultConnectionMetadata struct {
	ConnectionAttributes map[string]string
	ProvidesReading      bool
	ProvidesWriting      bool
	ProvidesSubscribing  bool
	ProvidesBrowsing     bool
}

DefaultConnectionMetadata implements the model.PlcConnectionMetadata interface

func (*DefaultConnectionMetadata) CanBrowse

func (m *DefaultConnectionMetadata) CanBrowse() bool

func (*DefaultConnectionMetadata) CanRead

func (m *DefaultConnectionMetadata) CanRead() bool

func (*DefaultConnectionMetadata) CanSubscribe

func (m *DefaultConnectionMetadata) CanSubscribe() bool

func (*DefaultConnectionMetadata) CanWrite

func (m *DefaultConnectionMetadata) CanWrite() bool

func (*DefaultConnectionMetadata) GetConnectionAttributes

func (m *DefaultConnectionMetadata) GetConnectionAttributes() map[string]string

func (*DefaultConnectionMetadata) Serialize

func (d *DefaultConnectionMetadata) Serialize() ([]byte, error)

func (*DefaultConnectionMetadata) SerializeWithWriteBuffer

func (d *DefaultConnectionMetadata) SerializeWithWriteBuffer(ctx context.Context, writeBuffer utils.WriteBuffer) error

func (*DefaultConnectionMetadata) String

func (d *DefaultConnectionMetadata) String() string

type DefaultConnectionRequirements

type DefaultConnectionRequirements interface {
	// IsConnected should return the implementing connection check when using DefaultConnection
	IsConnected() bool
	// GetMessageCodec should return the spi.MessageCodec in use
	GetMessageCodec() spi.MessageCodec
}

DefaultConnectionRequirements defines the required at a implementing connection when using DefaultConnection additional options can be set using the functions returning WithOption (e.g. WithDefaultTtl, WithPlcTagHandler...)

type DefaultDriver

type DefaultDriver interface {
	fmt.Stringer
	plc4go.PlcDriver
	spi.PlcDiscoverer
	GetPlcTagHandler() spi.PlcTagHandler
}

func NewDefaultDriver

func NewDefaultDriver(defaultDriverRequirements DefaultDriverRequirements, protocolCode string, protocolName string, defaultTransport string, plcTagHandler spi.PlcTagHandler) DefaultDriver

type DefaultDriverRequirements

type DefaultDriverRequirements interface {
	GetConnection(ctx context.Context, transportUrl url.URL, transports map[string]transports.Transport, driverOptions map[string][]string) (plc4go.PlcConnection, error)
	Discover(ctx context.Context, eventCallback func(event apiModel.PlcDiscoveryItem), discoveryOptions ...options.WithDiscoveryOption) error
}

type Expectation deprecated

type Expectation interface {
	spi.Expectation
}

Deprecated: don't use it in productive code

type Message deprecated

type Message interface {
	spi.Message
}

Deprecated: don't use it in productive code

type MessageCodec deprecated

type MessageCodec interface {
	spi.MessageCodec
	spi.TransportInstanceExposer
}

Deprecated: don't use it in productive code

type PlcConnection deprecated

type PlcConnection interface {
	plc4go.PlcConnection
}

Deprecated: don't use it in productive code

type PlcQuery deprecated

type PlcQuery interface {
	apiModel.PlcQuery
}

Deprecated: don't use it in productive code

type PlcTagHandler deprecated

type PlcTagHandler interface {
	spi.PlcTagHandler
}

Deprecated: don't use it in productive code

type TransportInstance deprecated

type TransportInstance interface {
	transports.TransportInstance
}

Deprecated: don't use it in productive code

Jump to

Keyboard shortcuts

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