clean imports

This commit is contained in:
Darien Raymond
2017-01-14 00:27:45 +01:00
parent b40a139310
commit 8b00d6fc30
26 changed files with 96 additions and 100 deletions
+8 -8
View File
@@ -3,7 +3,7 @@ package protocol
import (
"runtime"
v2net "v2ray.com/core/common/net"
"v2ray.com/core/common/net"
"v2ray.com/core/common/uuid"
)
@@ -58,16 +58,16 @@ type RequestHeader struct {
Command RequestCommand
Option RequestOption
Security Security
Port v2net.Port
Address v2net.Address
Port net.Port
Address net.Address
User *User
}
func (v *RequestHeader) Destination() v2net.Destination {
func (v *RequestHeader) Destination() net.Destination {
if v.Command == RequestCommandUDP {
return v2net.UDPDestination(v.Address, v.Port)
return net.UDPDestination(v.Address, v.Port)
}
return v2net.TCPDestination(v.Address, v.Port)
return net.TCPDestination(v.Address, v.Port)
}
type ResponseOption byte
@@ -96,8 +96,8 @@ type ResponseHeader struct {
}
type CommandSwitchAccount struct {
Host v2net.Address
Port v2net.Port
Host net.Address
Port net.Port
ID *uuid.UUID
AlterIds uint16
Level uint32
+5 -5
View File
@@ -5,7 +5,7 @@ import (
"time"
"v2ray.com/core/common/dice"
v2net "v2ray.com/core/common/net"
"v2ray.com/core/common/net"
)
type ValidationStrategy interface {
@@ -45,12 +45,12 @@ func (v *TimeoutValidStrategy) Invalidate() {
type ServerSpec struct {
sync.RWMutex
dest v2net.Destination
dest net.Destination
users []*User
valid ValidationStrategy
}
func NewServerSpec(dest v2net.Destination, valid ValidationStrategy, users ...*User) *ServerSpec {
func NewServerSpec(dest net.Destination, valid ValidationStrategy, users ...*User) *ServerSpec {
return &ServerSpec{
dest: dest,
users: users,
@@ -59,11 +59,11 @@ func NewServerSpec(dest v2net.Destination, valid ValidationStrategy, users ...*U
}
func NewServerSpecFromPB(spec ServerEndpoint) *ServerSpec {
dest := v2net.TCPDestination(spec.Address.AsAddress(), v2net.Port(spec.Port))
dest := net.TCPDestination(spec.Address.AsAddress(), net.Port(spec.Port))
return NewServerSpec(dest, AlwaysValid(), spec.User...)
}
func (v *ServerSpec) Destination() v2net.Destination {
func (v *ServerSpec) Destination() net.Destination {
return v.dest
}