View Source Wireguardex (Wireguardex v0.1.1)
Wireguardex is an Elixir library for configuring WireGuard interfaces. It uses Rust NIFs for performance and safety.
This is the main module, providing the API for interface configuration and utilities such as key generation.
Link to this section Summary
Functions
Add a peer to a Device
.
Delete a Device
by its interface name.
Generates a random preshared key. It is returned as a base64 string.
Generates a random private key. It is returned as a base64 string.
Get a Device
by its interface name.
Return a private key's public key as a base64 string.
Get a list of interfaces from wireguard.
Remove a peer from a Device
by the peer's public key.
Set a Device
by its interface name using a DeviceConfig
.
Link to this section Functions
Add a peer to a Device
.
Returns :ok
if successful. {:error, error_info}
will be returned if adding
the peer to the device fails.
Delete a Device
by its interface name.
Returns :ok
if successful. {:error, error_info}
will be returned if deleting
the device fails.
Generates a random private key. It is returned as a base64 string.
Get a Device
by its interface name.
Returns Device
if successful. {:error, error_info}
will be returned
if getting the device fails.
Return a private key's public key as a base64 string.
Get a list of interfaces from wireguard.
Returns [...]
if successful. {:error, error_info}
will be returned
if listing the devices fails.
Remove a peer from a Device
by the peer's public key.
Returns :ok
if successful. {:error, error_info}
will be returned if removing
the peer from the device fails.
Set a Device
by its interface name using a DeviceConfig
.
Note if no device is present, a new one will be created for the given interface name.
Returns :ok
if successful. {:error, error_info}
will be returned if setting
the device fails.