ipc

package
v0.0.0-...-612b147 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package ipc provides IPC functionality between rewrapper(client) and reproxy(server).

Index

Constants

View Source
const (
	// GrpcMaxMsgSize is the max value of gRPC response that can be received by the client (in bytes)
	GrpcMaxMsgSize = 1024 * 1024 * 32 // 32MB (default is 4MB)

	// GrpcMaxListenSize is the max value of the gRPC response that can be listened for by the proxy.
	// This is message size received from rewrapper.
	// Limiting this to a smaller value than reception from RBE due to performance issues on intel macs
	// when this is set to 32MB.
	GrpcMaxListenSize = 1024 * 1024 * 8
)
View Source
const (
	// GrpcCxxSupportsUDS is true because the grpc cpp library supports uds on mac and linux.
	GrpcCxxSupportsUDS = true
)

Variables

This section is empty.

Functions

func DialContext

func DialContext(ctx context.Context, serverAddr string) (*grpc.ClientConn, error)

DialContext connects to the serverAddress for grpc. Returns immediately and will make the connection lazily when needed. This is the recommended approach to dialing from the grpc documentation (https://github.com/grpc/grpc-go/blob/master/Documentation/anti-patterns.md)

func DialContextWithBlock

func DialContextWithBlock(ctx context.Context, serverAddr string) (*grpc.ClientConn, error)

DialContextWithBlock connects to the serverAddress for grpc, but waits until the connection is made (via WithBlock) until returning. This is NOT the recommended approach to dialing, but is needed for bootstrap which relies on WithBlock as a check that reproxy has started successfully. Also needed for reproxy connecting to the depsscannerservice. TODO(b/290804932): Remove the dependence on WithBlock as a startup check.

func Exists

func Exists(address string) bool

Exists returns true if there is a UDS socket at the given address. If it's a TCP address, it will just continue and try connecting the normal way.

func GetAllReproxySockets

func GetAllReproxySockets(ctx context.Context) ([]string, error)

GetAllReproxySockets returns all unix sockets where an reproxy service is listening.

func Listen

func Listen(serverAddr string) (net.Listener, error)

Listen announces on the serverAddr to accept grpc connection.

Types

This section is empty.

Jump to

Keyboard shortcuts

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