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 ¶
EnableCaptureHook is called to request the use of a hook in a pipeline. It updates the supplied pipelines to capture this request.
func Main ¶
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 (*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. |