New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Context implementation #83

Merged
merged 4 commits into from Jun 13, 2017

Conversation

Projects
None yet
2 participants
@furusiyya
Collaborator

furusiyya commented Jun 11, 2017

#75 #82 fixed!

Previously I selected cli for two reasons:
1)- Flags management
2)- It provides context that can travels to all handler functions of application so we can use
context for sending values and signal across different goroutines.
3)- Flags can be accessed and set at any level of application with the help of context.

While exploring docs of cli I found that we cannot add value in cli.Context structure but it is designed to be only used for carrying context of application flags throughout the hierarchy, mostly used by cli application having a lot flags and sub commands for their management.
So I decided to use docopt for flag management and native context package of golang for passing application context to goroutines. For passing flags down to any level of application context can be used because it support for carrying values.

Show outdated Hide outdated app/server.go Outdated
Show outdated Hide outdated glutton.go Outdated
Show outdated Hide outdated glutton.go Outdated
Show outdated Hide outdated logger.go Outdated
Show outdated Hide outdated protocols.go Outdated
Show outdated Hide outdated protocols.go Outdated
Show outdated Hide outdated protocols.go Outdated
@@ -81,6 +83,8 @@ imports:
version: 645ef00459ed84a119197bfb8d8205042c6df63d
- name: github.com/satori/go.uuid
version: b061729afc07e77a8aa4fad0a2fd840958f1942a
- name: github.com/Sirupsen/logrus

This comment has been minimized.

@glaslos

glaslos Jun 12, 2017

Member

hm, where is that coming from?

@glaslos

glaslos Jun 12, 2017

Member

hm, where is that coming from?

This comment has been minimized.

@furusiyya

furusiyya Jun 12, 2017

Collaborator

It is coming from freki.

@furusiyya

furusiyya Jun 12, 2017

Collaborator

It is coming from freki.

@glaslos glaslos merged commit b9cf8c2 into mushorg:master Jun 13, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@furusiyya furusiyya deleted the furusiyya:context_implementation branch Aug 27, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment