default.go 691 B

12345678910111213141516171819202122232425262728293031323334353637
  1. package policy
  2. import (
  3. "time"
  4. )
  5. // DefaultManager is the implementation of the Manager.
  6. type DefaultManager struct{}
  7. // Type implements common.HasType.
  8. func (DefaultManager) Type() interface{} {
  9. return ManagerType()
  10. }
  11. // ForLevel implements Manager.
  12. func (DefaultManager) ForLevel(level uint32) Session {
  13. p := SessionDefault()
  14. if level == 1 {
  15. p.Timeouts.ConnectionIdle = time.Second * 600
  16. }
  17. return p
  18. }
  19. // ForSystem implements Manager.
  20. func (DefaultManager) ForSystem() System {
  21. return System{}
  22. }
  23. // Start implements common.Runnable.
  24. func (DefaultManager) Start() error {
  25. return nil
  26. }
  27. // Close implements common.Closable.
  28. func (DefaultManager) Close() error {
  29. return nil
  30. }