Documentation ¶
Index ¶
- func LoadClient(m *Client) error
- func LoadClients() error
- func LoadSerial(m *Serial) error
- func LoadSerials() error
- func LoadServer(m *Server) error
- func LoadServers() error
- func Offline(pid, id string)
- func Online(pid, id string)
- func Shutdown() error
- func Startup() error
- type Base
- func (l *Base) Close() error
- func (l *Base) Closed() bool
- func (l *Base) ID() string
- func (l *Base) Pipe(pipe io.ReadWriteCloser)
- func (l *Base) Read(data []byte) (int, error)
- func (l *Base) Running() bool
- func (l *Base) SetReadTimeout(t time.Duration) error
- func (l *Base) Write(data []byte) (int, error)
- type Client
- type Keeper
- type Link
- type PollerOptions
- type ProtocolOptions
- type RetryOptions
- type Serial
- type Server
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadClient ¶
func LoadClients ¶
func LoadClients() error
func LoadSerial ¶
func LoadSerials ¶
func LoadSerials() error
func LoadServer ¶
func LoadServers ¶
func LoadServers() error
Types ¶
type Base ¶
type Base 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 map[string]any `json:"protocol_options,omitempty"` Disabled bool `json:"disabled"` Created time.Time `json:"created" xorm:"created"` //创建时间 Status string `json:"status,omitempty" xorm:"-"` //状态 // contains filtered or unexported fields }
func (*Base) Pipe ¶
func (l *Base) Pipe(pipe io.ReadWriteCloser)
type Client ¶
type Client struct { Base `xorm:"extends"` Net string `json:"net,omitempty"` //类型 tcp udp Addr string `json:"addr,omitempty"` //地址,主机名或IP Port uint16 `json:"port,omitempty"` //端口号 }
Client 网络链接
type Link ¶
type Link struct { Base `xorm:"extends"` ServerId string `json:"server_id" xorm:"index"` //服务器ID Remote string `json:"remote,omitempty"` //远程地址 }
Link 网络连接
type PollerOptions ¶
type ProtocolOptions ¶
type RetryOptions ¶
type Serial ¶
type Serial struct { Base `xorm:"extends"` PortName string `json:"port_name,omitempty"` //port, e.g. COM1 "/dev/ttySerial1". BaudRate uint `json:"baud_rate,omitempty"` //9600 115200 DataBits uint `json:"data_bits,omitempty"` //5 6 7 8 StopBits uint `json:"stop_bits,omitempty"` //1 2 ParityMode int `json:"parity_mode,omitempty"` //0 1 2 NONE ODD EVEN }
Serial 串口
Click to show internal directories.
Click to hide internal directories.