forwarder

package
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2017 License: MIT, MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Forward

func Forward(ctx context.Context, options *Options) (err error)

Forward forwards a function call

Types

type HTTPRunnable

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

HTTPRunnable is a Runnable which does an HTTP request for its work (to be used with openfaas)

func NewHTTPRunnable

func NewHTTPRunnable(url string) *HTTPRunnable

NewHTTPRunnable returns a new http runnable for a given host port combination

func (*HTTPRunnable) Run

func (r *HTTPRunnable) Run(ctx context.Context, options []string, input io.Reader, output io.Writer) error

Run implements the runnable interface

type HostConfig

type HostConfig struct {
	Transport   TransportProtocol
	Host        string
	Port        uint16
	CallOptions []string
}

HostConfig specifies one function service

type Options

type Options struct {
	Hosts  []*HostConfig
	Input  io.Reader
	Output io.Writer
}

Options are the options for the forwarding

type TransportProtocol

type TransportProtocol int

TransportProtocol is the type of the transport, currently only GRPC is supported

const (
	// GRPC represents a gRPC transport layer
	GRPC TransportProtocol = iota
	// HTTP represents a http transport layer
	HTTP
)

Jump to

Keyboard shortcuts

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