feat(components): components introduction #52
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So, basically we have dropped missy file and changed our service configuration implementation, but still it really looks odd to me and somehow not convenient. I think that really we should just be just using an
environment variables
as a configuration part for our services. On the other hand I heard aboutmissy controller
that needs to get information about those configurations...This is my proposition how we can achieve similar functionality with easy testing (Environment is an interface) and very convenient components introduction and usage.
New flow will looks:
init()
function (for consistent should be in acomponent.go
file). There it should register a component and set any default configuration variables. I have drop ped theinternal
name and info aboutoptional/mandatory
because I can't se any needs for that really. Please give a feedback if this is really needed for us (can be introduced). Imo each new component should register default variables in case that os env. var is not set.I have added
Info
func and use it at end of componentinit()
just for a nice print of component info. This way at service start we will have a nice description about components.Service is a
component
too. Probably it should be calledserver
and be used as component...options
func and new way for creating serviceservice.NewWithOptions(name string, options ...OptionFunc)
. This way we are be able to implement any arbitrary option as afunc
and use it.. It is more extensible this way.I really want to improve our work with a missy and it's configuration. I know that components and it's configurations (env. variables really) are needed for our
missy controller
that is not implemented yet. I can not have a full spectrum of it, so this implementation will be lack of important stuff. If so, please give a feedback for me.Any feedback and discussion is appreciated. Please @microdevs/core let's have a talk and improve missy. It is our core component in our services. We should try to implement it in right way.