You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to a discussion on whether it would be desirable to refactor some of the code located at the root of the project into packages. The upstream tailscale repository makes extensive use of packages and it might be nice to do the same here.
Why
Moving these files from the root of the repository could make make the project a little be "cleaner" and allow for more obvious separation of concerns (i.e what is/isn't related to the API?).
It might also be nice to move some of the html templates from static Go strings to HTML files embedded with //go:embed, as they would be more discoverable and easier to edit.
There are currently 78 files, 48 of which are Go files, at the root of the repository. Reducing this number may make the repository easier to quickly view.
Just quickly, some ideas on what could move where:
noise.go could move into a package noise. It has a single dependency on the Headscale struct but should be otherwise safe to move around.
@uhthomas hey, first and foremost, thanks for offering to help :)
@kradalby and I have talked about this exact same topic already a couple of times, and we are planning an in-person meeting in the next few weeks to iterate faster in some stuff - including this.
We can have a talk on other topics that need help, if you would like to :)
Hey!
I'd like to a discussion on whether it would be desirable to refactor some of the code located at the root of the project into packages. The upstream tailscale repository makes extensive use of packages and it might be nice to do the same here.
Why
//go:embed
, as they would be more discoverable and easier to edit.Just quickly, some ideas on what could move where:
noise.go could move into a package
noise
. It has a single dependency on theHeadscale
struct but should be otherwise safe to move around.machine.go could move into its own package.
integration tests could move into their own package as not to pollute the main API package.
swagger.go has no dependency on headscale at all and should be fine to live in its own package.
utils.go could be split into multiple packages as it seems to cover quite a wide surface area.
... etc.
What are your thoughts? Happy to lead this if you're interested, or we can close this an forget about it if not.
The text was updated successfully, but these errors were encountered: