slack icon indicating copy to clipboard operation
slack copied to clipboard

blocks: implements objects.Block

Open zchee opened this issue 6 years ago • 4 comments

Implements objects.Block. The Block interface impl might be ugly, pls advice how to implements it 🙏


TODO:

  • [x] implements each Blocks []interface field

zchee avatar Aug 28 '19 04:08 zchee

  • 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.Elements as []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 into Block.Elements

lestrrat avatar Aug 28 '19 06:08 lestrrat

@lestrrat Thanks for advice. will fix and implements more structs.

zchee avatar Aug 28 '19 08:08 zchee

@lestrrat I have almost implemented the Slack block feature. but uses interface on some types. What do you think about this?

zchee avatar Oct 16 '19 01:10 zchee

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.

lestrrat avatar Oct 16 '19 01:10 lestrrat