-
Notifications
You must be signed in to change notification settings - Fork 0
/
proxy_cache.go
34 lines (29 loc) · 876 Bytes
/
proxy_cache.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package proxy
var (
inboundFactories = make(map[string]InboundConnectionHandlerFactory)
outboundFactories = make(map[string]OutboundConnectionHandlerFactory)
)
func RegisterInboundConnectionHandlerFactory(name string, factory InboundConnectionHandlerFactory) error {
// TODO check name
inboundFactories[name] = factory
return nil
}
func RegisterOutboundConnectionHandlerFactory(name string, factory OutboundConnectionHandlerFactory) error {
// TODO check name
outboundFactories[name] = factory
return nil
}
func GetInboundConnectionHandlerFactory(name string) InboundConnectionHandlerFactory {
factory, found := inboundFactories[name]
if !found {
return nil
}
return factory
}
func GetOutboundConnectionHandlerFactory(name string) OutboundConnectionHandlerFactory {
factory, found := outboundFactories[name]
if !found {
return nil
}
return factory
}