(section *ini.Section)
| 468 | } |
| 469 | |
| 470 | func parseUDPProxyTunnelConfig(section *ini.Section) (RoutineSpawner, error) { |
| 471 | config := &UDPProxyTunnelConfig{} |
| 472 | |
| 473 | bindAddress, err := parseString(section, "BindAddress") |
| 474 | if err != nil { |
| 475 | return nil, err |
| 476 | } |
| 477 | config.BindAddress = bindAddress |
| 478 | |
| 479 | target, err := parseString(section, "Target") |
| 480 | if err != nil { |
| 481 | return nil, err |
| 482 | } |
| 483 | config.Target = target |
| 484 | |
| 485 | inactivityTimeout := 0 |
| 486 | if sectionKey, err := section.GetKey("InactivityTimeout"); err == nil { |
| 487 | timeoutVal, err := sectionKey.Int() |
| 488 | if err != nil { |
| 489 | return nil, err |
| 490 | } |
| 491 | inactivityTimeout = timeoutVal |
| 492 | } |
| 493 | config.InactivityTimeout = inactivityTimeout |
| 494 | |
| 495 | return config, nil |
| 496 | } |
| 497 | |
| 498 | // Takes a function that parses an individual section into a config, and apply it on all |
| 499 | // specified sections |
nothing calls this directly
no test coverage detected