Skip to content

Commit 90594b2

Browse files
committed
feat: define mikrotik ssh client interface
1 parent 481ed76 commit 90594b2

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/lib/MikrotikSSHClient.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import {executeSSHCommand} from "../utils/ssh";
2+
3+
export interface SSHClient {
4+
executeCommand(command: string): Promise<string>;
5+
}
6+
7+
export class MikroTikSSHClient implements SSHClient {
8+
private readonly host: string;
9+
private readonly port: number;
10+
private readonly username: string;
11+
private readonly password: string;
12+
13+
constructor(host: string, port: number, username: string, password: string) {
14+
this.host = host;
15+
this.port = port;
16+
this.username = username;
17+
this.password = password;
18+
}
19+
20+
public async executeCommand(command: string): Promise<string> {
21+
return await executeSSHCommand(command, this.host, this.port, this.username, this.password);
22+
}
23+
}

0 commit comments

Comments
 (0)