|
@@ -25,6 +25,12 @@ func RegisterInboundConnectionHandlerFactory(name string, creator InboundConnect
|
|
|
return nil
|
|
return nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+func MustRegisterInboundConnectionHandlerCreator(name string, creator InboundConnectionHandlerCreator) {
|
|
|
|
|
+ if err := RegisterInboundConnectionHandlerFactory(name, creator); err != nil {
|
|
|
|
|
+ panic(err)
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
func RegisterOutboundConnectionHandlerFactory(name string, creator OutboundConnectionHandlerCreator) error {
|
|
func RegisterOutboundConnectionHandlerFactory(name string, creator OutboundConnectionHandlerCreator) error {
|
|
|
if _, found := outboundFactories[name]; found {
|
|
if _, found := outboundFactories[name]; found {
|
|
|
return ErrorNameExists
|
|
return ErrorNameExists
|
|
@@ -33,6 +39,12 @@ func RegisterOutboundConnectionHandlerFactory(name string, creator OutboundConne
|
|
|
return nil
|
|
return nil
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+func MustRegisterOutboundConnectionHandlerCreator(name string, creator OutboundConnectionHandlerCreator) {
|
|
|
|
|
+ if err := RegisterOutboundConnectionHandlerFactory(name, creator); err != nil {
|
|
|
|
|
+ panic(err)
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
func CreateInboundConnectionHandler(name string, space app.Space, rawConfig []byte) (proxy.InboundConnectionHandler, error) {
|
|
func CreateInboundConnectionHandler(name string, space app.Space, rawConfig []byte) (proxy.InboundConnectionHandler, error) {
|
|
|
creator, found := inboundFactories[name]
|
|
creator, found := inboundFactories[name]
|
|
|
if !found {
|
|
if !found {
|