2015-11-09 18:05:25 -05:00
|
|
|
package mocks
|
|
|
|
|
|
|
|
import (
|
2015-12-12 15:40:16 -05:00
|
|
|
"github.com/v2ray/v2ray-core/common/uuid"
|
2015-12-07 14:32:38 -05:00
|
|
|
"github.com/v2ray/v2ray-core/proxy/vmess"
|
2016-01-12 05:38:43 -05:00
|
|
|
"github.com/v2ray/v2ray-core/proxy/vmess/protocol/user"
|
2015-11-09 18:05:25 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
type StaticUser struct {
|
2015-12-07 14:32:38 -05:00
|
|
|
id *vmess.ID
|
2015-11-09 18:05:25 -05:00
|
|
|
}
|
|
|
|
|
2015-12-07 14:32:38 -05:00
|
|
|
func (this *StaticUser) ID() *vmess.ID {
|
2015-11-09 18:05:25 -05:00
|
|
|
return this.id
|
|
|
|
}
|
|
|
|
|
2015-12-07 14:32:38 -05:00
|
|
|
func (this *StaticUser) Level() vmess.UserLevel {
|
|
|
|
return vmess.UserLevelUntrusted
|
2015-11-09 18:05:25 -05:00
|
|
|
}
|
|
|
|
|
2016-01-08 18:10:57 -05:00
|
|
|
func (this *StaticUser) AlterIDs() []*vmess.ID {
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
func (this *StaticUser) AnyValidID() *vmess.ID {
|
|
|
|
return this.id
|
|
|
|
}
|
|
|
|
|
2015-11-09 18:05:25 -05:00
|
|
|
type StaticUserSet struct {
|
|
|
|
}
|
|
|
|
|
2015-12-07 14:32:38 -05:00
|
|
|
func (us *StaticUserSet) AddUser(user vmess.User) error {
|
2015-11-09 18:05:25 -05:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
2016-01-12 05:38:43 -05:00
|
|
|
func (us *StaticUserSet) GetUser(userhash []byte) (vmess.User, user.Timestamp, bool) {
|
2015-12-12 15:40:16 -05:00
|
|
|
id, _ := uuid.ParseString("703e9102-eb57-499c-8b59-faf4f371bb21")
|
|
|
|
return &StaticUser{id: vmess.NewID(id)}, 0, true
|
2015-11-09 18:05:25 -05:00
|
|
|
}
|