config.go 906 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. package core
  2. import (
  3. "v2ray.com/core/common"
  4. "v2ray.com/core/proxy/registry"
  5. )
  6. func (this *AllocationStrategyConcurrency) GetValue() uint32 {
  7. if this == nil {
  8. return 3
  9. }
  10. return this.Value
  11. }
  12. func (this *AllocationStrategyRefresh) GetValue() uint32 {
  13. if this == nil {
  14. return 5
  15. }
  16. return this.Value
  17. }
  18. func (this *InboundConnectionConfig) GetAllocationStrategyValue() *AllocationStrategy {
  19. if this.AllocationStrategy == nil {
  20. return &AllocationStrategy{}
  21. }
  22. return this.AllocationStrategy
  23. }
  24. func (this *InboundConnectionConfig) GetTypedSettings() (interface{}, error) {
  25. if this.GetSettings() == nil {
  26. return nil, common.ErrBadConfiguration
  27. }
  28. return this.GetSettings().GetInstance()
  29. }
  30. func (this *OutboundConnectionConfig) GetTypedSettings() (interface{}, error) {
  31. if this.GetSettings() == nil {
  32. return nil, common.ErrBadConfiguration
  33. }
  34. return this.GetSettings().GetInstance()
  35. }