add network feature for relay
This commit is contained in:
22
handler/serial/metadata.go
Normal file
22
handler/serial/metadata.go
Normal file
@ -0,0 +1,22 @@
|
||||
package serial
|
||||
|
||||
import (
|
||||
"time"
|
||||
|
||||
mdata "github.com/go-gost/core/metadata"
|
||||
mdutil "github.com/go-gost/core/metadata/util"
|
||||
)
|
||||
|
||||
const (
|
||||
defaultPort = "COM1"
|
||||
defaultBaudRate = 9600
|
||||
)
|
||||
|
||||
type metadata struct {
|
||||
timeout time.Duration
|
||||
}
|
||||
|
||||
func (h *serialHandler) parseMetadata(md mdata.Metadata) (err error) {
|
||||
h.md.timeout = mdutil.GetDuration(md, "timeout", "serial.timeout", "handler.serial.timeout")
|
||||
return
|
||||
}
|
Reference in New Issue
Block a user