mirror of
https://github.com/cirruslabs/orchard.git
synced 2026-10-18 13:21:00 +02:00
* 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()
35 lines
757 B
Go
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
|
|
}
|
|
}
|