Use type uint8 to replace boolean fields in response

This commit is contained in:
2022-05-07 14:01:10 -07:00
parent b1e7ded874
commit ff5f211a83
3 changed files with 19 additions and 13 deletions

View File

@@ -26,12 +26,18 @@ type Request struct {
Arg any
}
type ResponseType uint8
const (
ResponseTypeError ResponseType = iota
ResponseTypeChannel
ResponseTypeChannelDone
)
// Response represents a response returned by the server
type Response struct {
Type ResponseType
ID string
ChannelDone bool
IsChannel bool
IsError bool
Error string
Return any
}