Files
threshold/internal/daemon/worker/proxy/options.go
T

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

35 lines
801 B
Go
Raw Normal View History

package proxy
import (
2021-12-17 11:26:42 -08:00
serverpb "github.com/hashicorp/boundary/internal/gen/controller/servers/services"
)
// Option - how Options are passed as arguments.
type Option func(*Options)
// GetOpts - iterate the inbound Options and return a struct.
func GetOpts(opt ...Option) Options {
opts := getDefaultOptions()
for _, o := range opt {
o(&opts)
}
return opts
}
// Options = how options are represented
type Options struct {
2021-12-17 11:26:42 -08:00
WithEgressCredentials []*serverpb.Credential
}
func getDefaultOptions() Options {
return Options{
WithEgressCredentials: nil,
}
}
// WithEgressCredentials provides an optional egress credentials to use when establishing a proxy
2021-12-17 11:26:42 -08:00
func WithEgressCredentials(creds []*serverpb.Credential) Option {
return func(o *Options) {
o.WithEgressCredentials = creds
}
}