aboutsummaryrefslogtreecommitdiffhomepage
path: root/apps/peertube-runner/src/register/register.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-08-17 08:59:21 +0200
committerChocobozzz <me@florianbigard.com>2023-08-17 08:59:21 +0200
commitc380e3928517eb5311b38cf257816642617d7a33 (patch)
tree2ea9b70ebca16b5d109bcce98fe7f944dad89319 /apps/peertube-runner/src/register/register.ts
parenta8ca6190fb462bf6eb5685cfc1d8ae444164a487 (diff)
parent3a4992633ee62d5edfbb484d9c6bcb3cf158489d (diff)
downloadPeerTube-c380e3928517eb5311b38cf257816642617d7a33.tar.gz
PeerTube-c380e3928517eb5311b38cf257816642617d7a33.tar.zst
PeerTube-c380e3928517eb5311b38cf257816642617d7a33.zip
Merge branch 'feature/esm-and-nx' into develop
Diffstat (limited to 'apps/peertube-runner/src/register/register.ts')
-rw-r--r--apps/peertube-runner/src/register/register.ts36
1 files changed, 36 insertions, 0 deletions
diff --git a/apps/peertube-runner/src/register/register.ts b/apps/peertube-runner/src/register/register.ts
new file mode 100644
index 000000000..e8af21661
--- /dev/null
+++ b/apps/peertube-runner/src/register/register.ts
@@ -0,0 +1,36 @@
1import { IPCClient } from '../shared/ipc/index.js'
2
3export async function registerRunner (options: {
4 url: string
5 registrationToken: string
6 runnerName: string
7 runnerDescription?: string
8}) {
9 const client = new IPCClient()
10 await client.run()
11
12 await client.askRegister(options)
13
14 client.stop()
15}
16
17export async function unregisterRunner (options: {
18 url: string
19 runnerName: string
20}) {
21 const client = new IPCClient()
22 await client.run()
23
24 await client.askUnregister(options)
25
26 client.stop()
27}
28
29export async function listRegistered () {
30 const client = new IPCClient()
31 await client.run()
32
33 await client.askListRegistered()
34
35 client.stop()
36}