static_userset.go 443 B

1234567891011121314151617181920
  1. package mocks
  2. import (
  3. "github.com/v2ray/v2ray-core/common/protocol"
  4. "github.com/v2ray/v2ray-core/common/uuid"
  5. )
  6. type StaticUserSet struct {
  7. }
  8. func (us *StaticUserSet) Add(user *protocol.User) error {
  9. return nil
  10. }
  11. func (us *StaticUserSet) Get(userhash []byte) (*protocol.User, protocol.Timestamp, bool) {
  12. id, _ := uuid.ParseString("703e9102-eb57-499c-8b59-faf4f371bb21")
  13. return &protocol.User{
  14. ID: protocol.NewID(id),
  15. }, 0, true
  16. }