|
|
@@ -50,7 +50,7 @@ func (m *Manager) AddHandler(ctx context.Context, handler core.InboundHandler) e
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
-// GetHandler returns core.InboundHandlerManager.
|
|
|
+// GetHandler implements core.InboundHandlerManager.
|
|
|
func (m *Manager) GetHandler(ctx context.Context, tag string) (core.InboundHandler, error) {
|
|
|
m.access.RLock()
|
|
|
defer m.access.RUnlock()
|
|
|
@@ -62,6 +62,7 @@ func (m *Manager) GetHandler(ctx context.Context, tag string) (core.InboundHandl
|
|
|
return handler, nil
|
|
|
}
|
|
|
|
|
|
+// RemoveHandler implements core.InboundHandlerManager.
|
|
|
func (m *Manager) RemoveHandler(ctx context.Context, tag string) error {
|
|
|
if len(tag) == 0 {
|
|
|
return core.ErrNoClue
|
|
|
@@ -79,6 +80,7 @@ func (m *Manager) RemoveHandler(ctx context.Context, tag string) error {
|
|
|
return core.ErrNoClue
|
|
|
}
|
|
|
|
|
|
+// Start implements common.Runnable.
|
|
|
func (m *Manager) Start() error {
|
|
|
m.access.Lock()
|
|
|
defer m.access.Unlock()
|
|
|
@@ -99,6 +101,7 @@ func (m *Manager) Start() error {
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
+// Close implements common.Closable.
|
|
|
func (m *Manager) Close() error {
|
|
|
m.access.Lock()
|
|
|
defer m.access.Unlock()
|
|
|
@@ -115,6 +118,7 @@ func (m *Manager) Close() error {
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
+// NewHandler creates a new core.InboundHandler based on the given config.
|
|
|
func NewHandler(ctx context.Context, config *core.InboundHandlerConfig) (core.InboundHandler, error) {
|
|
|
rawReceiverSettings, err := config.ReceiverSettings.GetInstance()
|
|
|
if err != nil {
|