mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-05-28 14:59:07 -04:00
prototype of commander
This commit is contained in:
@@ -73,6 +73,21 @@ func (m *Manager) AddHandler(ctx context.Context, handler core.OutboundHandler)
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *Manager) RemoveHandler(ctx context.Context, tag string) error {
|
||||
if len(tag) == 0 {
|
||||
return core.ErrNoClue
|
||||
}
|
||||
m.Lock()
|
||||
defer m.Unlock()
|
||||
|
||||
delete(m.taggedHandler, tag)
|
||||
if m.defaultHandler.Tag() == tag {
|
||||
m.defaultHandler = nil
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func init() {
|
||||
common.Must(common.RegisterConfig((*proxyman.OutboundConfig)(nil), func(ctx context.Context, config interface{}) (interface{}, error) {
|
||||
return New(ctx, config.(*proxyman.OutboundConfig))
|
||||
|
||||
Reference in New Issue
Block a user