You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This proposal aims to remove much of the business logic/logical conditions from our template files and move them into go functions. This aims to make the code more testable and easier to expand.
Example of current template file for custom listeners:
{{ if not $s.CustomListeners }}
listen 80{{ if$s.ProxyProtocol }} proxy_protocol{{ end }};
{{ if not $s.DisableIPV6 }}listen [::]:80{{ if$s.ProxyProtocol }} proxy_protocol{{ end }};{{ end }}
{{ else }}
{{ if (gt $s.HTTPPort 0) }}
listen {{ $s.HTTPPort }}{{ if$s.ProxyProtocol }} proxy_protocol{{ end }};
{{ if not $s.DisableIPV6 }}listen [::]:{{ $s.HTTPPort }}{{ if$s.ProxyProtocol }} proxy_protocol{{ end }};{{ end }}
{{ end }}
{{ end }}
Example of template file for customer listeners after adding template helper function:
This proposal aims to remove much of the business logic/logical conditions from our template files and move them into go functions. This aims to make the code more testable and easier to expand.
Example of current template file for custom listeners:
Example of template file for customer listeners after adding template helper function:
The code for
makeListener
will reside in a function ininternal/configs/version1/template_helper.go
The text was updated successfully, but these errors were encountered: