lambda

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2023 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Start

func Start(handler Handler)

Start starts the lambda handler.

Types

type Endpoint

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

Endpoint represent http-service endpoints.

func NewEndpoint

func NewEndpoint(svc service, logger *slog.Logger, addr string) *Endpoint

NewEndpoint returns new Endpoint instance.

func (*Endpoint) StartServer

func (e *Endpoint) StartServer(ctx context.Context) error

StartServer starts http-server.

type Error

type Error struct {
	Status  int    `json:"status"`
	Message string `json:"message"`
}

func NewError

func NewError(status int, message string) *Error

func (Error) Error

func (e Error) Error() []byte

type Handler

type Handler func(ctx context.Context, payload []byte) ([]byte, error)

Handler is a user function that handles lambda requests.

type Service

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

Service is a service for lambda.

func NewService

func NewService(cfg *config.Config, log *slog.Logger, container builder) *Service

NewService returns new Service instance.

func (*Service) Create

func (s *Service) Create(ctx context.Context, name string, file io.ReadCloser) error

func (*Service) Invoke

func (s *Service) Invoke(ctx context.Context, name string, data []byte) ([]byte, error)

Jump to

Keyboard shortcuts

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