MCPcopy Create free account
hub / github.com/CyCoreSystems/ari-proxy / parseEventSource

Function parseEventSource

server/application.go:49–66  ·  view source on GitHub ↗
(src string)

Source from the content-addressed store, hash-verified

47}
48
49func 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
68func (s *Server) applicationSubscribe(ctx context.Context, reply string, req *proxy.Request) {
69 err := s.ari.Application().Subscribe(req.Key, req.ApplicationSubscribe.EventSource)

Callers 1

applicationSubscribeMethod · 0.85

Calls 1

NewMethod · 0.80

Tested by

no test coverage detected