config.go 632 B

123456789101112131415161718192021222324252627282930
  1. package core
  2. import (
  3. "v2ray.com/core/proxy/registry"
  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. return registry.MarshalInboundConfig(this.Protocol, this.Settings)
  25. }