1
0
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:
Darien Raymond
2018-02-05 23:38:24 +01:00
parent 384844f898
commit 1e6d5561cc
20 changed files with 1097 additions and 33 deletions

View File

@@ -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))