Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename allows_pooling to pooling_enabled #197

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading