Files
orchard/pkg/client/option.go
T
Nikolay Edigaryev abcfee677d Work around Sequoia's "Local Network" permission with a helper process (#302)
* Work around Sequoia's "Local Network" permission with a helper process

* README.md: macOS 15 (Sequoia) warning

* Make "orchard dev" unix-specific too, otherwise Release fails

* Fix typo in "localNetworkHerlper"

* Slightly improve the macOS 15 (Sequoia) note

* orchard worker run: better documentation for --user

* Make sure privilege dropping is the first step we do in runWorker()
2025-04-10 18:01:19 +04:00

35 lines
757 B
Go

package client
import (
"context"
"crypto/x509"
"net"
)
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
}
}
func WithDialContext(dialContext func(ctx context.Context, network, addr string) (net.Conn, error)) Option {
return func(client *Client) {
client.dialContext = dialContext
}
}