cloudfunction

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHandler

func NewHandler(handlerSymbol interface{}) functionHandler

NewHandler Creates the base function handler, which will do basic payload unmarshaling before defering to handlerSymbol. If handlerSymbol is not a valid handler, the returned function will be a handler that just reports the validation error.

func Start

func Start(handler interface{})

func StartHandler

func StartHandler(handler Handler)

StartHandler takes in a Handler wrapper interface which can be implemented either by a custom function or a struct.

Handler implementation requires a single "Invoke()" function:

func Invoke(context.Context, []byte) ([]byte, error)

func StartHandlerReturn added in v0.2.2

func StartHandlerReturn(handler Handler) *net.Listener

Types

type Function

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

func NewFunction

func NewFunction(handler Handler) *Function

func (*Function) Invoke

func (fn *Function) Invoke(req *messages.InvokeRequest, response *messages.InvokeResponse) error

func (*Function) Ping

func (fn *Function) Ping(req *messages.PingRequest, response *messages.PingResponse) error

type Handler

type Handler interface {
	Invoke(ctx context.Context, payload []byte) ([]byte, error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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