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

Add quick_connect style functions similar to vintage_net_wifi #23

Open
fhunleth opened this issue Jun 27, 2021 · 0 comments
Open

Add quick_connect style functions similar to vintage_net_wifi #23

fhunleth opened this issue Jun 27, 2021 · 0 comments

Comments

@fhunleth
Copy link
Member

VintageNetWiFi's quick_connect functions have become super convenient and I reach for them all of the time when I need to configure WiFi. Even though wired Ethernet is simpler to configure, I still forget how to do it and have to copy/paste from the cookbook. I think it would be really nice to have a VintageNetEthernet.quick_connect/2 function that takes keyword arguments. Something like:

# configure eth0 for DHCP
iex> VintageNetEthernet("eth0")

and

iex> VintageNetEthernet("eth0", ip: "192.168.1.10", subnet: "255.255.255.0", default_gateway: "192.168.1.1", name_servers: ["1.1.1.1", "8.8.8.8"])

I'm not 100% sure on the static IP address case. This might be fine since the goal of the quick_* functions isn't to cover all of the use cases. It's just supposed to cover the most common ones so that people don't have to struggle with the map config.

See the VintageNetWiFi source since it would be good to implement this similarly. I.e., with a VintageNetEthernet.Cookbook module that comes up with the config maps and can be unit tested. And then the VintageNetEthernet.quick_configure function that calls into the Cookbook and then to VintageNet.configure

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

No branches or pull requests

1 participant