aboutsummaryrefslogtreecommitdiff
path: root/src/canary/testable.ts
blob: d79aa99e0672baf266304efa77fd468ac6bc33d9 (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
import type { TaskEither } from "fp-ts/lib/TaskEither";
import type { Job } from "./job";
import type { D } from "../util";

export enum TestType {
  EMAIL = "email",
  PING = "ping",
  HEALTHCHECK = "healthcheck",
  DNS = "dns",
}

export interface Schedule {
  every: D.Duration;
  jitter: D.Duration;
}

export interface Test {
  name: string;
  type: TestType;
  job: Job;
  schedule: Schedule;
}

export type Testable<T extends Job> = (job: T) => TaskEither<Error, boolean>;