Thanks again, I am looking at https://github.com/recobe182/gohub/blob/master/filter_anno.patch, let me know if that is not the right patch.
I think all your ideas are good, and you've pointed out some other flaws I will address regarding detailed AMQP protocol support. Here's my thinking so far, please let me know if this makes sense and suits your needs or if you have other ideas:
1. Filter goes TerminusSettings, not directly on LinkSettings. A link's Source and Target can both have filters.
2. `type Filter map[Symbol]interface{}` rather than `map[string]string` to follow AMQP spec.
`Symbol` is just `type Symbol string` so converts to or from string but is encoded as AMQP symbol. The AMQP spec allows other types (not just string) to be used as values in filter maps: you can still use `string` for your application and the encoding will be the same, but interface{} allows other types in future.
3. Annotations: your patch points out a bug here - AMQP annotation keys can be symbol OR ulong, so map[string] is not accurate. Your patch fixes the encoding correctly, but the API is still wrong since you can't set or get ulong keys. I propose to leave the existing Annotation method (with your encoding fix) for backwards compatibility and add new methods like:
func (Message) MessageAnnotations() map[AnnotationKey]interface{}
My proposal for the AnnotationKey type is at: https://groups.google.com/forum/#!topic/golang-nuts/SsjSEqVcVqQ
So code that uses the old Annotation methods will still work (with the correct encoding) but the new method will be recommended for the future.
As an added bonus, the new methods are more consistent with C++ and other bindings.
Thoughts?
Side note: The AMQP spec says filter values should be "described types" - if Azure is happy with plain strings then don't change anything, but it might come up in future. The go library doesn't have described type support yet: https://issues.apache.org/jira/browse/PROTON-1456
Many thanks for this! I haven't had a chance to look at your patch yet but I definitely want to include this feature. Will get back to you ASAP.