proxy

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package proxy implements the Modbus caching proxy.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Proxy

type Proxy struct {
	// contains filtered or unexported fields
}

Proxy is a caching Modbus proxy server.

func New

func New(cfg *config.Config, logger *slog.Logger) (*Proxy, error)

New creates a new proxy instance.

func (*Proxy) HandleRequest

func (p *Proxy) HandleRequest(ctx context.Context, req *modbus.Request) ([]byte, error)

HandleRequest implements modbus.Handler interface.

func (*Proxy) HealthReport added in v1.3.0

func (p *Proxy) HealthReport() (string, map[string]any, error)

HealthReport returns reliability diagnostics and availability from one snapshot.

func (*Proxy) HealthStatus added in v1.3.0

func (p *Proxy) HealthStatus() (string, map[string]any)

HealthStatus returns optional upstream reliability diagnostics.

func (*Proxy) Healthy added in v1.1.0

func (p *Proxy) Healthy() error

Healthy reports whether the proxy's upstream connection is healthy.

func (*Proxy) Run

func (p *Proxy) Run(ctx context.Context) error

Run starts the proxy server.

func (*Proxy) Shutdown

func (p *Proxy) Shutdown(timeout time.Duration) error

Shutdown gracefully shuts down the proxy.

Jump to

Keyboard shortcuts

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