INNER CODE UNIT · Go

requireUnix

Netis/cloud-probe · cpctl/cmd/base.go:125

func requireUnix() error {
	if Globals.Unix == "" {
		return fmt.Errorf("--unix/-u is required (e.g. /var/run/cloud-probe/cpworker.sock)")
	}
	return nil
}

// unixConnStr wraps the raw socket path into the cpworker client's
// connection-string form.
func unixConnStr() string {
	return "unix://" + Globals.Unix
}

// withRPCTimeout derives a per-RPC context from the parent using the global
// --timeout. For single-shot commands the returned ctx covers the whole call;
// loop commands (ping, stats) should call this per iteration so --timeout
// applies to each RPC and not the total run duration.
func withRPCTimeout(parent context.Context) (context.Context, context.CancelFunc) {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…