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

Massive refactoring for better code structure

This commit is contained in:
V2Ray
2015-09-19 23:54:36 +02:00
parent 5eee1b97aa
commit 075753c030
34 changed files with 107 additions and 115 deletions

View File

@@ -4,7 +4,7 @@ import (
"bytes"
"github.com/v2ray/v2ray-core"
v2net "github.com/v2ray/v2ray-core/net"
v2net "github.com/v2ray/v2ray-core/common/net"
)
type InboundConnectionHandler struct {

View File

@@ -1,21 +1,21 @@
package mocks
import (
"github.com/v2ray/v2ray-core"
"github.com/v2ray/v2ray-core/proxy/vmess/protocol"
)
type MockUserSet struct {
UserIds []core.ID
UserIds []protocol.ID
UserHashes map[string]int
Timestamps map[string]int64
}
func (us *MockUserSet) AddUser(user core.User) error {
func (us *MockUserSet) AddUser(user protocol.User) error {
us.UserIds = append(us.UserIds, user.Id)
return nil
}
func (us *MockUserSet) GetUser(userhash []byte) (*core.ID, int64, bool) {
func (us *MockUserSet) GetUser(userhash []byte) (*protocol.ID, int64, bool) {
idx, found := us.UserHashes[string(userhash)]
if found {
return &us.UserIds[idx], us.Timestamps[string(userhash)], true

View File

@@ -4,7 +4,7 @@ import (
"bytes"
"github.com/v2ray/v2ray-core"
v2net "github.com/v2ray/v2ray-core/net"
v2net "github.com/v2ray/v2ray-core/common/net"
)
type OutboundConnectionHandler struct {