-
Notifications
You must be signed in to change notification settings - Fork 36
/
modality.go
42 lines (40 loc) · 1.05 KB
/
modality.go
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
package models
type Modality int
const (
AUDIO_MODALITY Modality = iota
VIDEO_MODALITY
VIDEOBASEDSCREENSHARING_MODALITY
DATA_MODALITY
UNKNOWNFUTUREVALUE_MODALITY
)
func (i Modality) String() string {
return []string{"audio", "video", "videoBasedScreenSharing", "data", "unknownFutureValue"}[i]
}
func ParseModality(v string) (any, error) {
result := AUDIO_MODALITY
switch v {
case "audio":
result = AUDIO_MODALITY
case "video":
result = VIDEO_MODALITY
case "videoBasedScreenSharing":
result = VIDEOBASEDSCREENSHARING_MODALITY
case "data":
result = DATA_MODALITY
case "unknownFutureValue":
result = UNKNOWNFUTUREVALUE_MODALITY
default:
return nil, nil
}
return &result, nil
}
func SerializeModality(values []Modality) []string {
result := make([]string, len(values))
for i, v := range values {
result[i] = v.String()
}
return result
}
func (i Modality) isMultiValue() bool {
return false
}