1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-01-04 00:05:21 -05:00

rename proxy interfaces

This commit is contained in:
Darien Raymond
2017-01-26 20:57:18 +01:00
parent d2764d8776
commit 7f36a5d1d3
8 changed files with 19 additions and 19 deletions

View File

@@ -7,26 +7,26 @@ import (
"v2ray.com/core/common/errors"
)
func CreateInboundHandler(ctx context.Context, config interface{}) (InboundHandler, error) {
func CreateInboundHandler(ctx context.Context, config interface{}) (Inbound, error) {
handler, err := common.CreateObject(ctx, config)
if err != nil {
return nil, err
}
switch h := handler.(type) {
case InboundHandler:
case Inbound:
return h, nil
default:
return nil, errors.New("Proxy: Not a InboundHandler.")
}
}
func CreateOutboundHandler(ctx context.Context, config interface{}) (OutboundHandler, error) {
func CreateOutboundHandler(ctx context.Context, config interface{}) (Outbound, error) {
handler, err := common.CreateObject(ctx, config)
if err != nil {
return nil, err
}
switch h := handler.(type) {
case OutboundHandler:
case Outbound:
return h, nil
default:
return nil, errors.New("Proxy: Not a OutboundHandler.")

View File

@@ -9,15 +9,15 @@ import (
"v2ray.com/core/transport/ray"
)
// An InboundHandler handles inbound network connections to V2Ray.
type InboundHandler interface {
// An Inbound processes inbound connections.
type Inbound interface {
Network() net.NetworkList
Process(context.Context, net.Network, internet.Connection) error
}
// An OutboundHandler handles outbound network connection for V2Ray.
type OutboundHandler interface {
// An Outbound process outbound connections.
type Outbound interface {
Process(context.Context, ray.OutboundRay) error
}