flags

package
v0.0.0-...-8ff3cc7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 11 Imported by: 11

Documentation

Overview

Package flags provides a convenient way to initialize the remote client from flags.

Index

Constants

This section is empty.

Variables

View Source
var (

	// CredFile is the name of a file that contains service account credentials to use when calling
	// remote execution. Used only if --use_application_default_credentials and --use_gce_credentials
	// are false.
	CredFile = flag.String("credential_file", "", "The name of a file that contains service account credentials to use when calling remote execution. Used only if --use_application_default_credentials and --use_gce_credentials are false.")
	// UseApplicationDefaultCreds is whether to use application default credentials to connect to
	// remote execution. See
	// https://cloud.google.com/sdk/gcloud/reference/auth/application-default/login
	UseApplicationDefaultCreds = flag.Bool("use_application_default_credentials", false, "If true, use application default credentials to connect to remote execution. See https://cloud.google.com/sdk/gcloud/reference/auth/application-default/login")
	// UseGCECredentials is whether to use the default GCE credentials to authenticate with remote
	// execution. --use_application_default_credentials must be false.
	UseGCECredentials = flag.Bool("use_gce_credentials", false, "If true (and --use_application_default_credentials is false), use the default GCE credentials to authenticate with remote execution.")
	// CredentialsHelper specifies a path to a credentials helper binary which should be used to fetch credentials.
	CredentialsHelper = flag.String(credshelper.CredshelperPathFlag, "", "Path to the credentials helper binary. If given execrell://, looks for the `credshelper` binary in the same folder as the current executable.")
	// CredentialsHelperArgs specifies arguments for the credentials helper binary,
	CredentialsHelperArgs = flag.String(credshelper.CredshelperArgsFlag, "", "Arguments for the credentials helper, separated by space.")
	// UseRPCCredentials can be set to false to disable all per-RPC credentials.
	UseRPCCredentials = flag.Bool("use_rpc_credentials", true, "If false, no per-RPC credentials will be used (disables --credential_file, --use_application_default_credentials, and --use_gce_credentials.")
	// UseExternalAuthToken specifies whether to use an externally provided auth token, given via PerRPCCreds dial option, should be used.
	UseExternalAuthToken = flag.Bool("use_external_auth_token", false, "If true, se an externally provided auth token, given via PerRPCCreds when the SDK is initialized.")
	// Service represents the host (and, if applicable, port) of the remote execution service.
	Service = flag.String("service", "", "The remote execution service to dial when calling via gRPC, including port, such as 'localhost:8790' or 'remotebuildexecution.googleapis.com:443'")
	// ServiceNoSecurity can be set to connect to the gRPC service without TLS and without authentication (enables --service_no_auth).
	ServiceNoSecurity = flag.Bool("service_no_security", false, "If true, do not use TLS or authentication when connecting to the gRPC service.")
	// ServiceNoAuth can be set to disable authentication while still using TLS.
	ServiceNoAuth = flag.Bool("service_no_auth", false, "If true, do not authenticate with the service (implied by --service_no_security).")
	// CASService represents the host (and, if applicable, port) of the CAS service, if different from the remote execution service.
	CASService = flag.String("cas_service", "", "The CAS service to dial when calling via gRPC, including port, such as 'localhost:8790' or 'remotebuildexecution.googleapis.com:443'")
	// Instance gives the instance of remote execution to test (in
	// projects/[PROJECT_ID]/instances/[INSTANCE_NAME] format for Google RBE).
	Instance = flag.String("instance", "", "The instance ID to target when calling remote execution via gRPC (e.g., projects/$PROJECT/instances/default_instance for Google RBE).")
	// RemoteHeaders stores additional headers to pass with each RPC.
	RemoteHeaders map[string][]string
	// CASConcurrency specifies the maximum number of concurrent upload & download RPCs that can be in flight.
	CASConcurrency = flag.Int("cas_concurrency", client.DefaultCASConcurrency, "Num concurrent upload / download RPCs that the SDK is allowed to do.")
	// MaxConcurrentRequests denotes the maximum number of concurrent RPCs on a single gRPC connection.
	MaxConcurrentRequests = flag.Uint("max_concurrent_requests_per_conn", client.DefaultMaxConcurrentRequests, "Maximum number of concurrent RPCs on a single gRPC connection.")
	// TLSServerName overrides the server name sent in the TLS session.
	TLSServerName = flag.String("tls_server_name", "", "Override the TLS server name")
	// TLSCACert loads CA certificates from a file
	TLSCACert = flag.String("tls_ca_cert", "", "Load TLS CA certificates from this file")
	// TLSClientAuthCert sets the public key in PEM format for using mTLS auth to connect to the RBE service.
	TLSClientAuthCert = flag.String("tls_client_auth_cert", "", "Certificate to use when using mTLS to connect to the RBE service.")
	// TLSClientAuthKey sets the private key for using mTLS auth to connect to the RBE service.
	TLSClientAuthKey = flag.String("tls_client_auth_key", "", "Key to use when using mTLS to connect to the RBE service.")
	// StartupCapabilities specifies whether to self-configure based on remote server capabilities on startup.
	StartupCapabilities = flag.Bool("startup_capabilities", true, "Whether to self-configure based on remote server capabilities on startup.")
	// RPCTimeouts stores the per-RPC timeout values.
	RPCTimeouts map[string]string
	// KeepAliveTime specifies gRPCs keepalive time parameter.
	KeepAliveTime = flag.Duration("grpc_keepalive_time", 0*time.Second, "After a duration of this time if the client doesn't see any activity it pings the server to see if the transport is still alive. If zero or not set, the mechanism is off.")
	// KeepAliveTimeout specifies gRPCs keepalive timeout parameter.
	KeepAliveTimeout = flag.Duration("grpc_keepalive_timeout", 20*time.Second, "After having pinged for keepalive check, the client waits for a duration of Timeout and if no activity is seen even after that the connection is closed. Default is 20s.")
	// KeepAlivePermitWithoutStream specifies gRPCs keepalive permitWithoutStream parameter.
	KeepAlivePermitWithoutStream = flag.Bool("grpc_keepalive_permit_without_stream", false, "If true, client sends keepalive pings even with no active RPCs; otherwise, doesn't send pings even if time and timeout are set. Default is false.")
)

Functions

func NewClientFromFlags

func NewClientFromFlags(ctx context.Context, opts ...client.Opt) (*client.Client, error)

NewClientFromFlags connects to a remote execution service and returns a client suitable for higher-level functionality. It uses the flags from above to configure the connection to remote execution.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL