aboutsummaryrefslogtreecommitdiffhomepage
path: root/packages/peertube-runner/register/register.ts
blob: ca1bf0f5a9b934a4507e42007897d81f4bfd5665 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { IPCClient } from '../shared/ipc'

export async function registerRunner (options: {
  url: string
  registrationToken: string
  runnerName: string
  runnerDescription?: string
}) {
  const client = new IPCClient()
  await client.run()

  await client.askRegister(options)

  client.stop()
}

export async function unregisterRunner (options: {
  url: string
  runnerName: string
}) {
  const client = new IPCClient()
  await client.run()

  await client.askUnregister(options)

  client.stop()
}

export async function listRegistered () {
  const client = new IPCClient()
  await client.run()

  await client.askListRegistered()

  client.stop()
}