1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-05-16 01:19:07 -04:00
Files
v2fly/proxy/vmess/protocol/user/testing/mocks/static_userset.go

30 lines
541 B
Go
Raw Normal View History

2015-11-10 00:05:25 +01:00
package mocks
import (
2015-12-07 19:32:38 +00:00
"github.com/v2ray/v2ray-core/proxy/vmess"
2015-11-10 00:05:25 +01:00
)
type StaticUser struct {
2015-12-07 19:32:38 +00:00
id *vmess.ID
2015-11-10 00:05:25 +01:00
}
2015-12-07 19:32:38 +00:00
func (this *StaticUser) ID() *vmess.ID {
2015-11-10 00:05:25 +01:00
return this.id
}
2015-12-07 19:32:38 +00:00
func (this *StaticUser) Level() vmess.UserLevel {
return vmess.UserLevelUntrusted
2015-11-10 00:05:25 +01:00
}
type StaticUserSet struct {
}
2015-12-07 19:32:38 +00:00
func (us *StaticUserSet) AddUser(user vmess.User) error {
2015-11-10 00:05:25 +01:00
return nil
}
2015-12-07 19:32:38 +00:00
func (us *StaticUserSet) GetUser(userhash []byte) (vmess.User, int64, bool) {
id, _ := vmess.NewID("703e9102-eb57-499c-8b59-faf4f371bb21")
2015-11-10 00:05:25 +01:00
return &StaticUser{id: id}, 0, true
}