celrpc

package
v0.15.0 Latest Latest
Warning

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

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

Documentation

Overview

Package celrpc defines CEL conformance service RPC helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExampleNewGrpcClient added in v0.15.0

func ExampleNewGrpcClient()

ExampleNewGrpcClient creates a new CEL RPC client using a path to a server binary. TODO Run from celrpc_test.go.

func RunServer

func RunServer(service confpb.ConformanceServiceServer)

RunServer listens on a dynamically-allocated port on the loopback network device, prints its address and port to stdout, then starts a gRPC server on the socket with the given service callbacks. Note that this call doesn't return until ther server exits.

Types

type ConfClient

type ConfClient interface {
	confpb.ConformanceServiceClient
	// Shutdown deallocates all resources associated with the client.
	// No further calls should be made on the client after shutdown.
	// Shutdown should be called even on an error return.
	Shutdown()
}

ConfClient manages calls to conformance test services.

func NewGrpcClient added in v0.15.0

func NewGrpcClient(serverCmd string) (ConfClient, error)

NewGrpcClient creates a new gRPC ConformanceService client. A server binary is launched given the command line serverCmd. The spawned server shares the current process's stderr, so its log messages will be visible. The caller must call Shutdown() on the retured ConfClient, even if NewGrpcClient() returns a non-nil error.

func NewPipeClient added in v0.15.0

func NewPipeClient(serverCmd string, base64Encode bool, pingsEnabled bool) (ConfClient, error)

NewPipeClient launches a server binary using the provided serverCmd command line. The spawned server shares the current process's stderr, so its log messages will be visible. stdin and stdout are used for communication. The caller must call Shutdown() on the retured ConfClient, even if the method returns a non-nil error.

base64Encode enables base64Encoded messages (b64encode(Any.serializeToString)) pingsEnabled enables pinging between reqests to test subprocess health

Directories

Path Synopsis
testpipeimpl
main
package main defines a simple implementation of the pipe protocol.
package main defines a simple implementation of the pipe protocol.

Jump to

Keyboard shortcuts

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