-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathapi.w
47 lines (38 loc) · 1.09 KB
/
api.w
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
37
38
39
40
41
42
43
44
45
46
47
bring cloud;
pub struct ContainerOpts {
name: str;
image: str;
/** Internal container port to expose */
port: num?;
env: Map<str?>?;
readiness: str?; // http get
replicas: num?; // number of replicas
public: bool?; // whether the workload should have a public url (default: false)
args: Array<str>?; // container arguments
/**
* The glob to use in order to calculate the content hash (default: all files)
*/
sources: str?;
/**
* a hash that represents the container source. if not set,
* and `sources` is set, the hash will be calculated based on the content of the
* source files.
*/
sourceHash: str?;
}
pub struct WorkloadProps extends ContainerOpts {
}
pub struct ForwardOptions {
route: str?;
method: cloud.HttpMethod?;
}
pub interface IWorkload {
forward(opts: ForwardOptions?): IForward;
}
pub interface IForward {
fromApi(): cloud.IApiEndpointHandler;
fromQueue(): cloud.IQueueSetConsumerHandler;
fromTopic(): cloud.ITopicOnMessageHandler;
fromSchedule(): cloud.IScheduleOnTickHandler;
fromBucketEvent(): cloud.IBucketEventHandler;
}