Files
orchard/pkg/client/option.go
T
Nikolay Edigaryev dcc954631b TLS improvements (#90)
* Fix typo when passing arguments to tls.LoadX509KeyPair()

* Support TLS 1.2 too

* Do not require a controller to only present a single certificate

* No need to set ServerName since we use InsecureSkipVerify

* Use host's root CA set by default and support normal SNI scenarios
2023-06-07 15:31:55 +04:00

27 lines
558 B
Go

package client
import (
"crypto/x509"
)
type Option func(*Client)
func WithAddress(address string) Option {
return func(client *Client) {
client.address = address
}
}
func WithTrustedCertificate(trustedCertificate *x509.Certificate) Option {
return func(client *Client) {
client.trustedCertificate = trustedCertificate
}
}
func WithCredentials(serviceAccountName string, serviceAccountToken string) Option {
return func(client *Client) {
client.serviceAccountName = serviceAccountName
client.serviceAccountToken = serviceAccountToken
}
}