constvar/const.go
@@ -11,7 +11,8 @@ type PlcStartAddressType string const ( PlcStartAddressTypeFinishNumber = "1" PlcStartAddressTypeFinishNumber = 1 PlcStartAddressTypeTotalNumber = 2 ) const ( @@ -19,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 }