liblambda

package
v0.0.0-...-2114318 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_grpc_api_proto protoreflect.FileDescriptor

Functions

func EventToStdinInput

func EventToStdinInput(event *Event) (string, error)

func RegisterLambdaServer

func RegisterLambdaServer(s *grpc.Server, srv LambdaServer)

func RunLocalBinary

func RunLocalBinary(stdinInput string, ctx context.Context, codeUri, functionHandler string) (string, string, string, error)

Types

type Event

type Event struct {
	EventId   string `protobuf:"bytes,1,opt,name=eventId,proto3" json:"eventId,omitempty"`
	EventData string `protobuf:"bytes,2,opt,name=eventData,proto3" json:"eventData,omitempty"`
	Context   string `protobuf:"bytes,3,opt,name=context,proto3" json:"context,omitempty"`
	// contains filtered or unexported fields
}

func (*Event) Descriptor deprecated

func (*Event) Descriptor() ([]byte, []int)

Deprecated: Use Event.ProtoReflect.Descriptor instead.

func (*Event) GetContext

func (x *Event) GetContext() string

func (*Event) GetEventData

func (x *Event) GetEventData() string

func (*Event) GetEventId

func (x *Event) GetEventId() string

func (*Event) ProtoMessage

func (*Event) ProtoMessage()

func (*Event) ProtoReflect

func (x *Event) ProtoReflect() protoreflect.Message

func (*Event) Reset

func (x *Event) Reset()

func (*Event) String

func (x *Event) String() string

type LambdaClient

type LambdaClient interface {
	Invoke(ctx context.Context, in *Event, opts ...grpc.CallOption) (*Response, error)
}

LambdaClient is the client API for Lambda service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.

func NewLambdaClient

func NewLambdaClient(cc grpc.ClientConnInterface) LambdaClient

type LambdaRestApiResponse

type LambdaRestApiResponse struct {
	Message          string `json:"message"`
	ErrorMessage     string `json:"error-message"`
	FunctionName     string `json:"function-name"`
	ModifiedResource string `json:"modified-resource"`
	DebugMessage     string `json:"debug-message"`
}

func NewErrorRestResponse

func NewErrorRestResponse(errorMessage, functionName, debugMessage string) *LambdaRestApiResponse

func NewOkRestResponse

func NewOkRestResponse(message, functionName, modifiedArn, debugMsg string) *LambdaRestApiResponse

type LambdaServer

type LambdaServer interface {
	Invoke(context.Context, *Event) (*Response, error)
}

LambdaServer is the server API for Lambda service.

type Response

type Response struct {
	Data       string `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
	Stderr     string `protobuf:"bytes,2,opt,name=stderr,proto3" json:"stderr,omitempty"`
	StatusCode int32  `protobuf:"varint,3,opt,name=statusCode,proto3" json:"statusCode,omitempty"`
	Message    string `protobuf:"bytes,4,opt,name=message,proto3" json:"message,omitempty"`
	EventId    string `protobuf:"bytes,5,opt,name=eventId,proto3" json:"eventId,omitempty"`
	// contains filtered or unexported fields
}

func (*Response) Descriptor deprecated

func (*Response) Descriptor() ([]byte, []int)

Deprecated: Use Response.ProtoReflect.Descriptor instead.

func (*Response) GetData

func (x *Response) GetData() string

func (*Response) GetEventId

func (x *Response) GetEventId() string

func (*Response) GetMessage

func (x *Response) GetMessage() string

func (*Response) GetStatusCode

func (x *Response) GetStatusCode() int32

func (*Response) GetStderr

func (x *Response) GetStderr() string

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

func (x *Response) ProtoReflect() protoreflect.Message

func (*Response) Reset

func (x *Response) Reset()

func (*Response) String

func (x *Response) String() string

type UnimplementedLambdaServer

type UnimplementedLambdaServer struct {
}

UnimplementedLambdaServer can be embedded to have forward compatible implementations.

func (*UnimplementedLambdaServer) Invoke

Jump to

Keyboard shortcuts

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