mirror of
https://github.com/v2fly/v2ray-core
synced 2024-02-27 03:18:06 +00:00
prefer interface over struct
This commit is contained in:
@@ -19,7 +19,7 @@ func (handler *InboundConnectionHandler) Listen(port uint16) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (handler *InboundConnectionHandler) Communicate(dest *v2net.Destination) error {
|
||||
func (handler *InboundConnectionHandler) Communicate(dest v2net.Destination) error {
|
||||
ray := handler.Server.NewInboundConnectionAccepted(dest)
|
||||
|
||||
input := ray.InboundInput()
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
type OutboundConnectionHandler struct {
|
||||
Data2Send *bytes.Buffer
|
||||
Data2Return []byte
|
||||
Destination *v2net.Destination
|
||||
Destination v2net.Destination
|
||||
}
|
||||
|
||||
func (handler *OutboundConnectionHandler) Start(ray core.OutboundRay) error {
|
||||
@@ -32,7 +32,7 @@ func (handler *OutboundConnectionHandler) Start(ray core.OutboundRay) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (handler *OutboundConnectionHandler) Create(point *core.Point, config []byte, dest *v2net.Destination) (core.OutboundConnectionHandler, error) {
|
||||
func (handler *OutboundConnectionHandler) Create(point *core.Point, config []byte, dest v2net.Destination) (core.OutboundConnectionHandler, error) {
|
||||
handler.Destination = dest
|
||||
return handler, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user