Skip to content

Commit

Permalink
rename allows_pooling to pooling_enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
rkolavo committed Jan 16, 2025
1 parent f7c015f commit 7771142
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 46 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 1.12.0

Breaking changes:

- Renames pre-release option `WithAllowsPooling` to `WithPoolingEnabled`
-

## 1.11.0

Enhancements:
Expand Down
23 changes: 0 additions & 23 deletions config/allows_pooling.go

This file was deleted.

2 changes: 1 addition & 1 deletion config/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
10 changes: 5 additions & 5 deletions config/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand Down
23 changes: 23 additions & 0 deletions config/pooling_enabled.go
Original file line number Diff line number Diff line change
@@ -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)
}
10 changes: 5 additions & 5 deletions config/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand Down
10 changes: 5 additions & 5 deletions config/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

Expand Down
14 changes: 7 additions & 7 deletions internal/tunnel/proto/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7771142

Please sign in to comment.