noop.go 625 B

123456789101112131415161718192021222324252627
  1. package noop
  2. import (
  3. "v2ray.com/core/common/alloc"
  4. "v2ray.com/core/common/loader"
  5. "v2ray.com/core/transport/internet"
  6. )
  7. type NoOpAuthenticator struct{}
  8. func (this NoOpAuthenticator) Overhead() int {
  9. return 0
  10. }
  11. func (this NoOpAuthenticator) Open(payload *alloc.Buffer) bool {
  12. return true
  13. }
  14. func (this NoOpAuthenticator) Seal(payload *alloc.Buffer) {}
  15. type NoOpAuthenticatorFactory struct{}
  16. func (this NoOpAuthenticatorFactory) Create(config interface{}) internet.Authenticator {
  17. return NoOpAuthenticator{}
  18. }
  19. func init() {
  20. internet.RegisterAuthenticator(loader.GetType(new(Config)), NoOpAuthenticatorFactory{})
  21. }