constvar/const.go
@@ -20,3 +20,14 @@ PlcAddressDataKeyFileName = "plc_address_key" PlcAddressDataValueFileName = "plc_address_value" ) type PlcMethod string const ( PlcMethodModbusTCP PlcMethod = "modbusTCP" PlcMethodSerial PlcMethod = "serial" ) func (slf PlcMethod) Valid() bool { return slf == PlcMethodModbusTCP || slf == PlcMethodSerial }