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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
use containerd_shim_protos::{events::task::*, protobuf::MessageDyn};

pub trait Event: MessageDyn {
    fn topic(&self) -> String;
}

impl Event for TaskCreate {
    fn topic(&self) -> String {
        "/tasks/create".to_string()
    }
}

impl Event for TaskStart {
    fn topic(&self) -> String {
        "/tasks/start".to_string()
    }
}

impl Event for TaskExecAdded {
    fn topic(&self) -> String {
        "/tasks/exec-added".to_string()
    }
}

impl Event for TaskExecStarted {
    fn topic(&self) -> String {
        "/tasks/exec-started".to_string()
    }
}

impl Event for TaskPaused {
    fn topic(&self) -> String {
        "/tasks/paused".to_string()
    }
}

impl Event for TaskResumed {
    fn topic(&self) -> String {
        "/tasks/resumed".to_string()
    }
}

impl Event for TaskExit {
    fn topic(&self) -> String {
        "/tasks/exit".to_string()
    }
}

impl Event for TaskDelete {
    fn topic(&self) -> String {
        "/tasks/delete".to_string()
    }
}

impl Event for TaskOOM {
    fn topic(&self) -> String {
        "/tasks/oom".to_string()
    }
}

impl Event for TaskCheckpointed {
    fn topic(&self) -> String {
        "/tasks/checkpointed".to_string()
    }
}