forked from CyCoreSystems/ari
-
Notifications
You must be signed in to change notification settings - Fork 0
/
keyfilter.go
78 lines (63 loc) · 2.22 KB
/
keyfilter.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
package keyfilter
import "github.com/CyCoreSystems/ari"
// Kind filters a list of keys by a particular Kind
func Kind(kind string, in []*ari.Key) (out []*ari.Key) {
for _, k := range in {
if k.Kind == kind {
out = append(out, k)
}
}
return
}
// Applications returns the Application keys from the given list of keys
func Applications(in []*ari.Key) (out []*ari.Key) {
return Kind(ari.ApplicationKey, in)
}
// Bridges returns the Bridge keys from the given list of keys
func Bridges(in []*ari.Key) (out []*ari.Key) {
return Kind(ari.BridgeKey, in)
}
// Channels returns the Channel keys from the given list of keys
func Channels(in []*ari.Key) (out []*ari.Key) {
return Kind(ari.ChannelKey, in)
}
// DeviceStates returns the DeviceState keys from the given list of keys
func DeviceStates(in []*ari.Key) (out []*ari.Key) {
return Kind(ari.DeviceStateKey, in)
}
// Endpoints returns the Endpoint keys from the given list of keys
func Endpoints(in []*ari.Key) (out []*ari.Key) {
return Kind(ari.EndpointKey, in)
}
// LiveRecordings returns the LiveRecording keys from the given list of keys
func LiveRecordings(in []*ari.Key) (out []*ari.Key) {
return Kind(ari.LiveRecordingKey, in)
}
// Loggings returns the Logging keys from the given list of keys
func Loggings(in []*ari.Key) (out []*ari.Key) {
return Kind(ari.LoggingKey, in)
}
// Mailboxes returns the Mailbox keys from the given list of keys
func Mailboxes(in []*ari.Key) (out []*ari.Key) {
return Kind(ari.MailboxKey, in)
}
// Modules returns the Module keys from the given list of keys
func Modules(in []*ari.Key) (out []*ari.Key) {
return Kind(ari.ModuleKey, in)
}
// Playbacks returns the Playback keys from the given list of keys
func Playbacks(in []*ari.Key) (out []*ari.Key) {
return Kind(ari.PlaybackKey, in)
}
// Sounds returns the Sound keys from the given list of keys
func Sounds(in []*ari.Key) (out []*ari.Key) {
return Kind(ari.SoundKey, in)
}
// StoredRecordings returns the StoredRecording keys from the given list of keys
func StoredRecordings(in []*ari.Key) (out []*ari.Key) {
return Kind(ari.StoredRecordingKey, in)
}
// Variables returns the Variable keys from the given list of keys
func Variables(in []*ari.Key) (out []*ari.Key) {
return Kind(ari.VariableKey, in)
}