(src string)
| 47 | } |
| 48 | |
| 49 | func parseEventSource(src string) (string, string, error) { |
| 50 | var err error |
| 51 | |
| 52 | pieces := strings.Split(src, ":") |
| 53 | if len(pieces) != 2 { |
| 54 | return "", "", errors.New("Invalid EventSource") |
| 55 | } |
| 56 | |
| 57 | switch pieces[0] { |
| 58 | case "channel": |
| 59 | case "bridge": |
| 60 | case "endpoint": |
| 61 | case "deviceState": |
| 62 | default: |
| 63 | err = errors.New("Unhandled EventSource type") |
| 64 | } |
| 65 | return pieces[0], pieces[1], err |
| 66 | } |
| 67 | |
| 68 | func (s *Server) applicationSubscribe(ctx context.Context, reply string, req *proxy.Request) { |
| 69 | err := s.ari.Application().Subscribe(req.Key, req.ApplicationSubscribe.EventSource) |
no test coverage detected