noop.go 712 B

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