harness

package
v2.5.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2018 License: Apache-2.0, BSD-3-Clause, MIT Imports: 17 Imported by: 0

Documentation

Overview

Package harness implements the SDK side of the Beam FnAPI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnableCaptureHook

func EnableCaptureHook(name string, opts []string)

EnableCaptureHook is called to request the use of a hook in a pipeline. It updates the supplied pipelines to capture this request.

func Main

func Main(ctx context.Context, loggingEndpoint, controlEndpoint string) error

Main is the main entrypoint for the Go harness. It runs at "runtime" -- not "pipeline-construction time" -- on each worker. It is a FnAPI client and ultimately responsible for correctly executing user code.

func RegisterCaptureHook

func RegisterCaptureHook(name string, c CaptureHookFactory)

RegisterCaptureHook registers a CaptureHookFactory for the supplied identifier.

Types

type CaptureHook

type CaptureHook io.WriteCloser

CaptureHook writes the messaging content consumed and produced by the worker, allowing the data to be used as an input for the session runner. Since workers can exist in a variety of environments, this allows the runner to tailor the behavior best for its particular needs.

type CaptureHookFactory

type CaptureHookFactory func([]string) CaptureHook

CaptureHookFactory produces a CaptureHook from the supplied options.

type DataChannel

type DataChannel struct {
	// contains filtered or unexported fields
}

DataChannel manages a single grpc connection to the FnHarness.

func NewDataChannel

func NewDataChannel(ctx context.Context, port exec.Port) (*DataChannel, error)

func (*DataChannel) OpenRead

func (c *DataChannel) OpenRead(ctx context.Context, id exec.StreamID) (io.ReadCloser, error)

func (*DataChannel) OpenWrite

func (c *DataChannel) OpenWrite(ctx context.Context, id exec.StreamID) (io.WriteCloser, error)

type DataManager

type DataManager struct {
	// contains filtered or unexported fields
}

DataManager manages data channels to the FnHarness. A fixed number of channels are generally used, each managing multiple logical byte streams.

func (*DataManager) OpenRead

func (m *DataManager) OpenRead(ctx context.Context, id exec.StreamID) (io.ReadCloser, error)

func (*DataManager) OpenWrite

func (m *DataManager) OpenWrite(ctx context.Context, id exec.StreamID) (io.WriteCloser, error)

Directories

Path Synopsis
Package init contains the harness initialization code defined by the FnAPI.
Package init contains the harness initialization code defined by the FnAPI.
Package session is a generated protocol buffer package.
Package session is a generated protocol buffer package.

Jump to

Keyboard shortcuts

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