Skip to content
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

Mobile prerefactor #680

Merged
merged 20 commits into from
Feb 13, 2023
Merged

Mobile prerefactor #680

merged 20 commits into from
Feb 13, 2023

Conversation

pappz
Copy link
Contributor

@pappz pappz commented Feb 9, 2023

Describe your changes

Small code cleaning in the iface package. These changes necessary to get a clean code in case if we involve more platforms.
The OS related functions has been distributed into separate files and it has been mixed with not OS related logic. The goal is to get a clear picture of the layer between Wirequard and business logic.

Main problem

Unfortunately the Android implementation of Wrieguard tool does not fit with the original Wireguard approach.
Until now the service communicated with the wireguard device via wgctrl package on every OS. In Android it is not possible so we have to create some new function what doing almost the same what the wgctrl did. I would like to provide a well layered solution.

Changes

  • Remove unused variables
  • Set to private some variables what is not used externally
  • We have OS related implementations so remove the 'if runtime.GOOS != "windows"' expression
  • Eliminate spagetti style function calls inside WGIface struct across several files.

Issue ticket number and link

Checklist

  • Is it a bug fix
  • Is a typo/documentation fix
  • Is a feature enhancement
  • It is a refactor
  • Created tests that fail without the change (if possible)
  • Extended the README / documentation, if necessary

- replace \" to `
- use %w instead of %v
gigovich
gigovich previously approved these changes Feb 10, 2023
Copy link
Contributor

@gigovich gigovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but there is one proposal that can be done in that PR.

@pappz pappz requested a review from gigovich February 10, 2023 13:56
@pappz pappz merged commit b64f5ff into main Feb 13, 2023
@pappz pappz deleted the mobile_prerefactor branch February 13, 2023 17:34
pulsastrix pushed a commit to pulsastrix/netbird that referenced this pull request Dec 24, 2023
Small code cleaning in the iface package. These changes necessary to 
get a clean code in case if we involve more platforms. The OS related 
functions has been distributed into separate files and it has been 
mixed with not OS related logic. The goal is to get a clear picture 
of the layer between WireGuard and business logic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants