diff --git a/CHANGELOG.md b/CHANGELOG.md index 93af4f57..075576a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +## 1.12.0 + +Breaking changes: + +- Renames pre-release option `WithAllowsPooling` to `WithPoolingEnabled` +- + ## 1.11.0 Enhancements: diff --git a/config/allows_pooling.go b/config/allows_pooling.go deleted file mode 100644 index 493c9ae0..00000000 --- a/config/allows_pooling.go +++ /dev/null @@ -1,23 +0,0 @@ -package config - -type allowsPoolingOption bool - -func WithAllowsPooling(allowsPooling bool) interface { - HTTPEndpointOption - TCPEndpointOption - TLSEndpointOption -} { - return allowsPoolingOption(allowsPooling) -} - -func (opt allowsPoolingOption) ApplyHTTP(opts *httpOptions) { - opts.AllowsPooling = bool(opt) -} - -func (opt allowsPoolingOption) ApplyTLS(opts *tlsOptions) { - opts.AllowsPooling = bool(opt) -} - -func (opt allowsPoolingOption) ApplyTCP(opts *tcpOptions) { - opts.AllowsPooling = bool(opt) -} diff --git a/config/common.go b/config/common.go index 7e478869..ee0ba3bb 100644 --- a/config/common.go +++ b/config/common.go @@ -38,7 +38,7 @@ type commonOpts struct { Bindings []string // Allows the endpoint to pool with other endpoints with the same host/port/binding - AllowsPooling bool + PoolingEnabled bool } type CommonOptionsFunc func(cfg *commonOpts) diff --git a/config/http.go b/config/http.go index 53118387..36f5bb88 100644 --- a/config/http.go +++ b/config/http.go @@ -147,11 +147,11 @@ func (cfg *httpOptions) WithForwardsTo(url *url.URL) { func (cfg httpOptions) Extra() proto.BindExtra { return proto.BindExtra{ - Name: cfg.Name, - Metadata: cfg.Metadata, - Description: cfg.Description, - Bindings: cfg.Bindings, - AllowsPooling: cfg.AllowsPooling, + Name: cfg.Name, + Metadata: cfg.Metadata, + Description: cfg.Description, + Bindings: cfg.Bindings, + PoolingEnabled: cfg.PoolingEnabled, } } diff --git a/config/pooling_enabled.go b/config/pooling_enabled.go new file mode 100644 index 00000000..eb0b0ac6 --- /dev/null +++ b/config/pooling_enabled.go @@ -0,0 +1,23 @@ +package config + +type poolingEnabledOption bool + +func WithPoolingEnabled(poolingEnabled bool) interface { + HTTPEndpointOption + TCPEndpointOption + TLSEndpointOption +} { + return poolingEnabledOption(poolingEnabled) +} + +func (opt poolingEnabledOption) ApplyHTTP(opts *httpOptions) { + opts.PoolingEnabled = bool(opt) +} + +func (opt poolingEnabledOption) ApplyTLS(opts *tlsOptions) { + opts.PoolingEnabled = bool(opt) +} + +func (opt poolingEnabledOption) ApplyTCP(opts *tcpOptions) { + opts.PoolingEnabled = bool(opt) +} diff --git a/config/tcp.go b/config/tcp.go index 64c7a7d0..f422964b 100644 --- a/config/tcp.go +++ b/config/tcp.go @@ -71,11 +71,11 @@ func (cfg *tcpOptions) WithForwardsTo(url *url.URL) { func (cfg tcpOptions) Extra() proto.BindExtra { return proto.BindExtra{ - Name: cfg.Name, - Metadata: cfg.Metadata, - Description: cfg.Description, - Bindings: cfg.Bindings, - AllowsPooling: cfg.AllowsPooling, + Name: cfg.Name, + Metadata: cfg.Metadata, + Description: cfg.Description, + Bindings: cfg.Bindings, + PoolingEnabled: cfg.PoolingEnabled, } } diff --git a/config/tls.go b/config/tls.go index 170bbe36..7e91bdec 100644 --- a/config/tls.go +++ b/config/tls.go @@ -99,11 +99,11 @@ func (cfg *tlsOptions) WithForwardsTo(url *url.URL) { func (cfg tlsOptions) Extra() proto.BindExtra { return proto.BindExtra{ - Name: cfg.Name, - Metadata: cfg.Metadata, - Description: cfg.Description, - Bindings: cfg.Bindings, - AllowsPooling: cfg.AllowsPooling, + Name: cfg.Name, + Metadata: cfg.Metadata, + Description: cfg.Description, + Bindings: cfg.Bindings, + PoolingEnabled: cfg.PoolingEnabled, } } diff --git a/internal/tunnel/proto/msg.go b/internal/tunnel/proto/msg.go index 014941d4..1b70056b 100644 --- a/internal/tunnel/proto/msg.go +++ b/internal/tunnel/proto/msg.go @@ -221,13 +221,13 @@ type Bind struct { } type BindExtra struct { - Name string - Token string - IPPolicyRef string - Metadata string - Description string - Bindings []string - AllowsPooling bool + Name string + Token string + IPPolicyRef string + Metadata string + Description string + Bindings []string + PoolingEnabled bool } // The server responds with a BindResp message to notify the client of the