v2ray-core/features/policy/default.go

38 lines
691 B
Go
Raw Normal View History

2018-10-21 08:27:13 +00:00
package policy
import (
"time"
)
2018-10-22 06:42:10 +00:00
// DefaultManager is the implementation of the Manager.
2018-10-21 08:27:13 +00:00
type DefaultManager struct{}
2018-10-22 06:42:10 +00:00
// Type implements common.HasType.
2018-10-21 08:27:13 +00:00
func (DefaultManager) Type() interface{} {
return ManagerType()
}
2018-10-22 06:42:10 +00:00
// ForLevel implements Manager.
2018-10-21 08:27:13 +00:00
func (DefaultManager) ForLevel(level uint32) Session {
p := SessionDefault()
if level == 1 {
p.Timeouts.ConnectionIdle = time.Second * 600
}
return p
}
2018-10-22 06:42:10 +00:00
// ForSystem implements Manager.
2018-10-21 08:27:13 +00:00
func (DefaultManager) ForSystem() System {
return System{}
}
2018-10-22 06:42:10 +00:00
// Start implements common.Runnable.
2018-10-21 08:27:13 +00:00
func (DefaultManager) Start() error {
return nil
}
2018-10-22 06:42:10 +00:00
// Close implements common.Closable.
2018-10-21 08:27:13 +00:00
func (DefaultManager) Close() error {
return nil
}