config.go 873 B

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