2024-07-23 09:22:53 +00:00
|
|
|
package at
|
|
|
|
|
|
|
|
type Resp string
|
|
|
|
|
|
|
|
const RespNil = Resp("")
|
|
|
|
|
|
|
|
func (resp Resp) Check() bool {
|
|
|
|
return len(resp) >= 2 && resp[len(resp)-2:] == "OK"
|
|
|
|
}
|
|
|
|
|
|
|
|
func (resp Resp) RmFront(str string) Resp {
|
|
|
|
return Resp(string(resp)[len(str):])
|
|
|
|
}
|
|
|
|
|
2024-07-23 14:26:24 +00:00
|
|
|
func (resp Resp) String() string {
|
2024-07-23 09:22:53 +00:00
|
|
|
return string(resp)
|
|
|
|
}
|
2024-07-28 18:01:18 +00:00
|
|
|
|
|
|
|
func (resp Resp) Bytes() []byte {
|
|
|
|
return []byte(resp)
|
|
|
|
}
|