blocks: implements objects.Block
Implements objects.Block.
The Block interface impl might be ugly, pls advice how to implements it 🙏
TODO:
- [x] implements each Blocks
[]interfacefield
- This is a judgement call, but I want structure definitions to live in objects/interface.go (think of it as a .h file in C), so I'd like to see stuff in blocks.go like
type XXX struct { }to be moved to that file. - I don't know exactly how block elements work, but once we publish
Block.Elementsas[]interface{}we will be stuck with that type declaration onwards. I haven't analyzed it yet myself, but I think there should be at least an attempt that trying to define what Go type can go intoBlock.Elements
@lestrrat Thanks for advice. will fix and implements more structs.
@lestrrat I have almost implemented the Slack block feature. but uses interface on some types.
What do you think about this?
One thing that might be good to have: an actual consumer code of your data objects. For example, how do you actually create/consume Block elements? This will tell you if it's a good idea to use interfaces and/or if you have the adequate methods to properly use them.