fnhandler

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EmptyStringBytes = []byte("")
)

Functions

This section is empty.

Types

type FaultRequestHandler

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

func (*FaultRequestHandler) Handle

func (handler *FaultRequestHandler) Handle(payload []byte, ctx context.RuntimeContext) (interface{}, error)

type Function

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

func NewFunction

func NewFunction(handler IRequestHandler) *Function

func (*Function) HealthCheck

func (fn *Function) HealthCheck(req *common.HealthCheckRequest, resp *common.HealthCheckResponse) error

func (*Function) Invoke

func (fn *Function) Invoke(req *common.InvokeRequest, resp *common.InvokeResponse) (funcErr error)

type FunctionLoadFailedError

type FunctionLoadFailedError struct {
	StatusCode   int
	ErrorMessage string
}

func (*FunctionLoadFailedError) Error

func (e *FunctionLoadFailedError) Error() string

type HandlerFunc

type HandlerFunc func([]byte, context.RuntimeContext) (interface{}, error)

HandlerFunc implements Handler.

type IRequestHandler

type IRequestHandler interface {
	Handle(payload []byte, ctx context.RuntimeContext) (interface{}, error)
}

func NewHandler

func NewHandler(handlerFunc interface{}) IRequestHandler

type InvokeError

type InvokeError struct {
	ErrorCode int    `json:"error_code"`
	ErrorMsg  string `json:"error_msg"`
}

func (*InvokeError) Error

func (e *InvokeError) Error() string

type InvokeErrorMessage

type InvokeErrorMessage struct {
	ErrorMessage string   `json:"errorMessage"`
	ErrorType    string   `json:"errorType,omitempty"`
	StackTrace   []string `json:"stackTrace,omitempty"`
}

type RequestHandler

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

func (*RequestHandler) Handle

func (handler *RequestHandler) Handle(payload []byte, ctx context.RuntimeContext) (interface{}, error)

Jump to

Keyboard shortcuts

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