tunnel

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 14, 2024 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PollerOptions

type PollerOptions struct {
	PollerPeriod   uint `json:"poller_period,omitempty"`   //采集周期
	PollerInterval uint `json:"poller_interval,omitempty"` //采集间隔
}

type ProtocolOptions

type ProtocolOptions struct {
	ProtocolName    string         `json:"protocol_name,omitempty"`    //协议 rtu tcp parallel-tcp
	ProtocolOptions map[string]any `json:"protocol_options,omitempty"` //协议参数
}

type RetryOptions

type RetryOptions struct {
	RetryTimeout uint `json:"retry_timeout,omitempty"` //重试时间
	RetryMaximum uint `json:"retry_maximum,omitempty"` //最大次数
}

type Tunnel

type Tunnel struct {
	Id          string `json:"id,omitempty" xorm:"pk"` //ID
	Name        string `json:"name,omitempty"`         //名称
	Description string `json:"description,omitempty"`  //说明
	Heartbeat   string `json:"heartbeat,omitempty"`    //心跳包

	//协议
	ProtocolName    string        `json:"protocol_name,omitempty"`
	ProtocolOptions types.Options `json:"protocol_options,omitempty"`

	Disabled bool      `json:"disabled"`
	Created  time.Time `json:"created" xorm:"created"` //创建时间

	Status string `json:"status,omitempty" xorm:"-"` //状态

	Running bool `json:"-" xorm:"-"`
	Closed  bool `json:"-" xorm:"-"`

	Conn connect.Conn `json:"-" xorm:"-"`

	Adapter protocol.Adapter `json:"-" xorm:"-"`
	// contains filtered or unexported fields
}

func (*Tunnel) Close

func (l *Tunnel) Close() error

Close 关闭

func (*Tunnel) ID

func (l *Tunnel) ID() string

func (*Tunnel) Keep

func (l *Tunnel) Keep(open func() error)

func (*Tunnel) Pipe

func (l *Tunnel) Pipe(pipe io.ReadWriteCloser)

func (*Tunnel) Poll

func (l *Tunnel) Poll()

func (*Tunnel) Read

func (l *Tunnel) Read(data []byte) (int, error)

Read 读

func (*Tunnel) SetReadTimeout

func (l *Tunnel) SetReadTimeout(t time.Duration) error

func (*Tunnel) Start

func (l *Tunnel) Start() (err error)

func (*Tunnel) Write

func (l *Tunnel) Write(data []byte) (int, error)

Write 写

Jump to

Keyboard shortcuts

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