executor

package
v0.0.0-...-57eb957 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJWTAuthMiddleware

func NewJWTAuthMiddleware(next http.Handler) (http.Handler, error)

Types

type FunctionRequest

type FunctionRequest struct {
	RequestURI string
	Method     string
	UserAgent  string

	Process     string
	ProcessArgs []string
	Environment []string

	InputReader   io.ReadCloser
	OutputWriter  io.Writer
	ContentLength *int64
}

FunctionRequest stores request for function execution

type FunctionRunner

type FunctionRunner interface {
	Run(f FunctionRequest) error
}

FunctionRunner runs a function

type HTTPFunctionRunner

type HTTPFunctionRunner struct {
	ExecTimeout    time.Duration // ExecTimeout the maximum duration or an upstream function call
	ReadTimeout    time.Duration // ReadTimeout for HTTP server
	WriteTimeout   time.Duration // WriteTimeout for HTTP Server
	Process        string        // Process to run as fprocess
	ProcessArgs    []string      // ProcessArgs to pass to command
	Command        *exec.Cmd
	StdinPipe      io.WriteCloser
	StdoutPipe     io.ReadCloser
	Client         *http.Client
	UpstreamURL    *url.URL
	BufferHTTPBody bool
	LogPrefix      bool
	LogBufferSize  int
	LogCallId      bool
	ReverseProxy   *httputil.ReverseProxy
}

HTTPFunctionRunner creates and maintains one process responsible for handling all calls

func (*HTTPFunctionRunner) Run

func (f *HTTPFunctionRunner) Run(req FunctionRequest, contentLength int64, r *http.Request, w http.ResponseWriter) error

Run a function with a long-running process with a HTTP protocol for communication

func (*HTTPFunctionRunner) Start

func (f *HTTPFunctionRunner) Start() error

Start forks the process used for processing incoming requests

type OpenIDConfiguration

type OpenIDConfiguration struct {
	Issuer  string `json:"issuer"`
	JWKSURI string `json:"jwks_uri"`
}

type SerializingForkFunctionRunner

type SerializingForkFunctionRunner struct {
	ExecTimeout   time.Duration
	LogPrefix     bool
	LogBufferSize int
}

SerializingForkFunctionRunner forks a process for each invocation

func (*SerializingForkFunctionRunner) Run

Run run a fork for each invocation

type StreamingFunctionRunner

type StreamingFunctionRunner struct {
	ExecTimeout   time.Duration
	LogPrefix     bool
	LogBufferSize int
}

StreamingFunctionRunner forks a process for each invocation

func (*StreamingFunctionRunner) Run

Run run a fork for each invocation

Jump to

Keyboard shortcuts

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