rwx-yxu / weather

A weather bonzai branch that will gather met office weather info.
Apache License 2.0
0 stars 0 forks source link

Refactor into packages #3

Closed rwx-yxu closed 1 year ago

rwx-yxu commented 1 year ago

The current implementation of the weather application is all under one package of weather. Whilst it has worked out okay so far, the organisation would improve drastically if I separate the application in to the following packages: region and site. This will so avoid the prefix with Region and sites for site.go and region.go.

rwx-yxu commented 1 year ago

version bump on the help branch to 0.7 required as well

rwx-yxu commented 1 year ago

Have to rethink on the refactor because there is a circular import problem whereby I cannot do weather ->region->weather. Theres some things in weather that are needed for region and weather has to import back region for cmd.go. One solution is probs to separate out cmd.go?

rwx-yxu commented 1 year ago

One solution is to have an 'app' package which will contain the contents of weather.go. Seems to be appropriate because weather.go provides a client and formats URLs. This means that I can keep cmd.go in the weather package and this can avoid the circular dependency I was getting into.

rwx-yxu commented 1 year ago

Done