github.com/v2fly/v2ray-core/v4@v4.45.2/features/policy/default.go (about)

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