runnerpool

package
v0.0.0-...-3735483 Latest Latest
Warning

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

Go to latest
Published: May 11, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

The consistent hash ring from the original fnlb.

The behaviour of this depends on changes to the runner list leaving it relatively stable.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MTLSRunnerFactory

type MTLSRunnerFactory func(addr, certCommonName string, pki *PKIData) (Runner, error)

MTLSRunnerFactory represents a factory method for constructing runners using mTLS

type PKIData

type PKIData struct {
	Ca   string
	Key  string
	Cert string
}

PKIData encapsulates TLS certificate data

type Placer

type Placer interface {
	PlaceCall(rp RunnerPool, ctx context.Context, call RunnerCall) error
}

Placer implements a placement strategy for calls that are load-balanced across runners in a pool

func NewCHPlacer

func NewCHPlacer() Placer

func NewNaivePlacer

func NewNaivePlacer() Placer

type Runner

type Runner interface {
	TryExec(ctx context.Context, call RunnerCall) (bool, error)
	Close(ctx context.Context) error
	Address() string
}

Runner is the interface to invoke the execution of a function call on a specific runner

type RunnerCall

type RunnerCall interface {
	LbDeadline() time.Time
	RequestBody() io.ReadCloser
	ResponseWriter() http.ResponseWriter
	StdErr() io.ReadWriteCloser
	Model() *models.Call
}

RunnerCall provides access to the necessary details of request in order for it to be processed by a RunnerPool

type RunnerPool

type RunnerPool interface {
	Runners(call RunnerCall) ([]Runner, error)
	Shutdown(ctx context.Context) error
}

RunnerPool is the abstraction for getting an ordered list of runners to try for a call

Jump to

Keyboard shortcuts

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