Skip to content

Commit

Permalink
config: allows_pooling boolean defaults false
Browse files Browse the repository at this point in the history
  • Loading branch information
warrn committed Sep 20, 2024
1 parent 06fcb9a commit 11cce23
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
28 changes: 28 additions & 0 deletions config/allows_pooling.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package config

type allowsPoolingOption bool

func WithAllowsPooling(allowsPooling bool) interface {
HTTPEndpointOption
TCPEndpointOption
TLSEndpointOption
LabeledTunnelOption
} {
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)
}

func (opt allowsPoolingOption) ApplyLabeled(opts *labeledOptions) {
opts.AllowsPooling = bool(opt)
}
3 changes: 3 additions & 0 deletions config/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ type commonOpts struct {

// Enables ingress for ngrok endpoints.
Bindings []string

// Allows the endpoint to pool with other endpoints with the same host/port/binding
AllowsPooling bool
}

type CommonOptionsFunc func(cfg *commonOpts)
Expand Down

0 comments on commit 11cce23

Please sign in to comment.