I think the Protocol interface should support ping tags by default to make forming and parsing responses easier. I think methods could look like these:
GetPingTags(msg string) (string, [][2]string) - I'm thinking this could return the original message with tags replaced by UUIDs, then an ordered list of [uuid,displayName] matches for easy parsing. This could make parsing tags much easier, and universal. I'm not sure how UUIDs could be typed this way, but they should be mostly safe due to loads of strict typing everywhere else.
MakePingTag(uuid UUID, displayName string) string
Instead of GetPingTags, maybe messages should just have a method for dumping post-pingtag processing? Or both? Or maybe just go right to the extreme and replace text dumping with a result akin to GetPingTags? So many options : /.
I think the Protocol interface should support ping tags by default to make forming and parsing responses easier. I think methods could look like these:
GetPingTags(msg string) (string, [][2]string)
- I'm thinking this could return the original message with tags replaced by UUIDs, then an ordered list of[uuid,displayName]
matches for easy parsing. This could make parsing tags much easier, and universal. I'm not sure how UUIDs could be typed this way, but they should be mostly safe due to loads of strict typing everywhere else.MakePingTag(uuid UUID, displayName string) string
Instead of
GetPingTags
, maybe messages should just have a method for dumping post-pingtag processing? Or both? Or maybe just go right to the extreme and replace text dumping with a result akin toGetPingTags
? So many options : /.MakePingTag
would be extremely useful.