This is the first in a series of PRs that are meant to make the internals of the package a bit more modular and easier to work with. The long term plan is described in the GIN projects restructuring project.
This PR includes the following changes:
Go routine call pattern: Previously, a function that runs asynchronously required a channel as an argument and needed to be started as a go routine externally. Now, async functions are called normally, start the routine internally as an anonymous function, and return the channel. This is much more conventional for Go packages.
Subpackage decoupling:
web no longer imports log: Logging should only happen at the top level, not from a package that could be imported from other projects.
git no longer imports log (same reason as above).
web no longer imports ginclient: The web package should be simpler and only implement low level web calls and functionality. Token and configuration management has been moved up to ginclient, which can pass configuration options down to the web client accordingly.
All git and annex commands are methods of a git client called Runner in the git subpackage that assumes no external file for configuration. The external ginclient is responsible for loading configuration options from the user's file and passing them to the git client.
Other changes:
Contributing guide with links to resources (such as project structure) and contact information has been added.
Documentation of command internals (translation from gin commands to git and git-annex commands).
This is the first in a series of PRs that are meant to make the internals of the package a bit more modular and easier to work with. The long term plan is described in the GIN projects restructuring project.
This PR includes the following changes:
web
no longer importslog
: Logging should only happen at the top level, not from a package that could be imported from other projects.git
no longer importslog
(same reason as above).web
no longer importsginclient
: Theweb
package should be simpler and only implement low level web calls and functionality. Token and configuration management has been moved up toginclient
, which can pass configuration options down to theweb
client accordingly.git
client calledRunner
in thegit
subpackage that assumes no external file for configuration. The externalginclient
is responsible for loading configuration options from the user's file and passing them to the git client.Other changes: