Skip to content

Commit

Permalink
feat(rust): change portal sub command to tcp-inlet and tcp-outlet
Browse files Browse the repository at this point in the history
* move portal/* commands to tcp-inlet/* and tcp-outlet/*
* change options for create commands to --at, --from, --to
* move api helper code into the command
  • Loading branch information
mrinalwadhwa authored and mergify[bot] committed Aug 14, 2022
1 parent a4b08e7 commit f12c604
Show file tree
Hide file tree
Showing 9 changed files with 337 additions and 306 deletions.
22 changes: 14 additions & 8 deletions implementations/rust/ockam/ockam_command/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ mod forwarder;
mod identity;
mod message;
mod node;
mod portal;
mod project;
mod secure_channel;
mod secure_channel_listener;
Expand All @@ -23,12 +22,14 @@ use enroll::EnrollCommand;
use forwarder::ForwarderCommand;
use message::MessageCommand;
use node::NodeCommand;
use portal::PortalCommand;
use project::ProjectCommand;
use secure_channel::SecureChannelCommand;
use secure_channel_listener::SecureChannelListenerCommand;
use space::SpaceCommand;
use tcp::{connection::TcpConnectionCommand, listener::TcpListenerCommand};
use tcp::connection::TcpConnectionCommand;
use tcp::inlet::TcpInletCommand;
use tcp::listener::TcpListenerCommand;
use tcp::outlet::TcpOutletCommand;

// to be removed
mod old;
Expand Down Expand Up @@ -158,10 +159,18 @@ pub enum OckamSubcommand {
#[clap(display_order = 900, help_template = HELP_TEMPLATE)]
TcpConnection(TcpConnectionCommand),

/// Manage TCP Inlets
#[clap(display_order = 900, help_template = HELP_TEMPLATE)]
TcpInlet(TcpInletCommand),

/// Create, update, or delete tcp listeners
#[clap(display_order = 900, help_template = HELP_TEMPLATE)]
TcpListener(TcpListenerCommand),

/// Manage TCP Outlets
#[clap(display_order = 900, help_template = HELP_TEMPLATE)]
TcpOutlet(TcpOutletCommand),

/// Manage Identities
#[clap(display_order = 900, help_template = HELP_TEMPLATE)]
Identity(IdentityCommand),
Expand Down Expand Up @@ -197,10 +206,6 @@ pub enum OckamSubcommand {
#[clap(display_order = 900, help_template = HELP_TEMPLATE, name = "token", hide = hide())]
GenerateEnrollmentToken(GenerateEnrollmentTokenCommand),

/// Create, update, or delete portal endpoints
#[clap(display_order = 900, help_template = HELP_TEMPLATE, hide = hide())]
Portal(PortalCommand),

/// Create, update or delete projects
#[clap(display_order = 900, help_template = HELP_TEMPLATE, hide = hide())]
Project(ProjectCommand),
Expand Down Expand Up @@ -327,8 +332,9 @@ pub fn run() {
OckamSubcommand::Project(command) => ProjectCommand::run(opts, command),
OckamSubcommand::Space(command) => SpaceCommand::run(opts, command),
OckamSubcommand::TcpConnection(command) => TcpConnectionCommand::run(opts, command),
OckamSubcommand::TcpInlet(command) => TcpInletCommand::run(opts, command),
OckamSubcommand::TcpListener(command) => TcpListenerCommand::run(opts, command),
OckamSubcommand::Portal(command) => PortalCommand::run(opts, command),
OckamSubcommand::TcpOutlet(command) => TcpOutletCommand::run(opts, command),
OckamSubcommand::Vault(command) => VaultCommand::run(opts, command),
OckamSubcommand::Identity(command) => IdentityCommand::run(opts, command),
OckamSubcommand::SecureChannel(command) => SecureChannelCommand::run(opts, command),
Expand Down
214 changes: 0 additions & 214 deletions implementations/rust/ockam/ockam_command/src/portal/create.rs

This file was deleted.

28 changes: 0 additions & 28 deletions implementations/rust/ockam/ockam_command/src/portal/mod.rs

This file was deleted.

Loading

0 comments on commit f12c604

Please sign in to comment.