Open darluc opened 2 years ago
This is an interesting feature, but will requires reflect
to parse the structure and get its tags.
another idea is that might a dsl is a good idea even better than struct tag
1: instead of spreading of all the dependencies around the code base, all the dependencies are defined in a dsl. it's very clear from the point of architecture. ( java ecosystem springboot supports xml configuration)
2: dsl is more expressive
3: building a dsl from scratch is not simple task, we can build it base on https://github.com/hashicorp/hcl
The DSL option is nice when you have existing tooling. This library should be dead simple, with no IDE plugin or CLI.
I will create a small PR with a proposal.
I used some other framework that could auto inject with struct tags.
Something like this: