beam: github.com/apache/beam/sdks/go/pkg/beam/util/grpcx Index | Files

package grpcx

import "github.com/apache/beam/sdks/go/pkg/beam/util/grpcx"

Package grpcx contains utilities for working with gRPC.

Index

Package Files

dial.go hook.go metadata.go

Variables

var Dial = DefaultDial

Dial is a convenience wrapper over grpc.Dial. It can be overridden to provide a customized dialing behavior.

func DefaultDial Uses

func DefaultDial(ctx context.Context, endpoint string, timeout time.Duration) (*grpc.ClientConn, error)

DefaultDial is a dialer that specifies an insecure blocking connection with a timeout.

func EnableHook Uses

func EnableHook(name string, opts ...string)

EnableHook is called to request the use of the gRPC hook in a pipeline.

func ReadWorkerID Uses

func ReadWorkerID(ctx context.Context) (string, error)

ReadWorkerID reads the worker ID from an incoming gRPC request context.

func RegisterHook Uses

func RegisterHook(name string, c HookFactory)

RegisterHook registers a HookFactory for the supplied identifier. It panics if the same identifier is registered twice.

func WriteWorkerID Uses

func WriteWorkerID(ctx context.Context, id string) context.Context

WriteWorkerID write the worker ID to an outgoing gRPC request context. It merges the information with any existing gRPC metadata.

type Hook Uses

type Hook struct {
    // Dialer allows the runner to customize the gRPC dialing behavior.
    Dialer func(context.Context, string, time.Duration) (*grpc.ClientConn, error)
}

Hook allow a runner to customize various aspects of gRPC communication with the FnAPI harness. Each member of the struct is optional; the default behavior will be used if a value is not supplied.

type HookFactory Uses

type HookFactory func([]string) Hook

HookFactory is a function that creates hooks from supplied arguments.

Package grpcx imports 7 packages (graph) and is imported by 7 packages. Updated 2019-05-10. Refresh now. Tools for package owners.