59-error-when-peer-not-selected

In the CLI when the peer is not selected
as the type throwing an error stating
either client or peer must be selected
This commit is contained in:
Tim Beatham 2023-12-22 19:08:20 +00:00
parent cf4be1ccab
commit 8aab4e99d8

View File

@ -15,7 +15,6 @@ const SockAddr = "/tmp/wgmesh_ipc.sock"
type CreateMeshParams struct { type CreateMeshParams struct {
Client *ipcRpc.Client Client *ipcRpc.Client
Endpoint string Endpoint string
Role string
WgArgs ipc.WireGuardArgs WgArgs ipc.WireGuardArgs
AdvertiseRoutes bool AdvertiseRoutes bool
AdvertiseDefault bool AdvertiseDefault bool
@ -56,7 +55,6 @@ type JoinMeshParams struct {
MeshId string MeshId string
IpAddress string IpAddress string
Endpoint string Endpoint string
Role string
WgArgs ipc.WireGuardArgs WgArgs ipc.WireGuardArgs
AdvertiseRoutes bool AdvertiseRoutes bool
AdvertiseDefault bool AdvertiseDefault bool
@ -203,6 +201,7 @@ func main() {
}) })
var newMeshRole *string = newMeshCmd.Selector("r", "role", []string{"peer", "client"}, &argparse.Options{ var newMeshRole *string = newMeshCmd.Selector("r", "role", []string{"peer", "client"}, &argparse.Options{
Default: "peer",
Help: "Role in the mesh network. A value of peer means that the node is publicly routeable and thus considered" + Help: "Role in the mesh network. A value of peer means that the node is publicly routeable and thus considered" +
" in the gossip protocol. Client means that the node is not publicly routeable and is not a candidate in the gossip" + " in the gossip protocol. Client means that the node is not publicly routeable and is not a candidate in the gossip" +
" protocol", " protocol",
@ -235,7 +234,7 @@ func main() {
}) })
var joinMeshRole *string = joinMeshCmd.Selector("r", "role", []string{"peer", "client"}, &argparse.Options{ var joinMeshRole *string = joinMeshCmd.Selector("r", "role", []string{"peer", "client"}, &argparse.Options{
Default: "Peer", Default: "peer",
Help: "Role in the mesh network. A value of peer means that the node is publicly routeable and thus considered" + Help: "Role in the mesh network. A value of peer means that the node is publicly routeable and thus considered" +
" in the gossip protocol. Client means that the node is not publicly routeable and is not a candidate in the gossip" + " in the gossip protocol. Client means that the node is not publicly routeable and is not a candidate in the gossip" +
" protocol", " protocol",
@ -319,7 +318,6 @@ func main() {
fmt.Println(createMesh(&CreateMeshParams{ fmt.Println(createMesh(&CreateMeshParams{
Client: client, Client: client,
Endpoint: *newMeshEndpoint, Endpoint: *newMeshEndpoint,
Role: *newMeshRole,
WgArgs: ipc.WireGuardArgs{ WgArgs: ipc.WireGuardArgs{
Endpoint: *newMeshEndpoint, Endpoint: *newMeshEndpoint,
Role: *newMeshRole, Role: *newMeshRole,
@ -341,7 +339,6 @@ func main() {
IpAddress: *joinMeshIpAddress, IpAddress: *joinMeshIpAddress,
MeshId: *joinMeshId, MeshId: *joinMeshId,
Endpoint: *joinMeshEndpoint, Endpoint: *joinMeshEndpoint,
Role: *joinMeshRole,
WgArgs: ipc.WireGuardArgs{ WgArgs: ipc.WireGuardArgs{
Endpoint: *joinMeshEndpoint, Endpoint: *joinMeshEndpoint,
Role: *joinMeshRole, Role: *joinMeshRole,