Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 3 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,7 @@
<a id="markdown-serverfull---a-lambda-simulator-for-go" name="serverfull---a-lambda-simulator-for-go"></a>
# Serverfull - A Lambda Simulator For Go
[![GoDoc](https://godoc.org/github.com/asecurityteam/serverfull?status.svg)](https://godoc.org/github.com/asecurityteam/serverfull)
<!-- TOC -->

- [Serverfull - A Lambda Simulator For Go](#serverfull---a-lambda-simulator-for-go)
- [Overview](#overview)
- [Quick Start](#quick-start)
- [Features And Limitations](#features-and-limitations)
- [HTTP API Options](#http-api-options)
- [Function Loaders](#function-loaders)
- [Running In Mock Mode](#running-in-mock-mode)
- [Building Lambda Binaries](#building-lambda-binaries)
- [Configuration](#configuration)
- [Status](#status)
- [Planned/Proposed Features](#plannedproposed-features)
- [Contributing](#contributing)
- [Building And Testing](#building-and-testing)
- [License](#license)
- [Contributing Agreement](#contributing-agreement)

<!-- /TOC -->

<a id="markdown-overview" name="overview"></a>
<!-- TOC -->autoauto- [Serverfull - A Lambda Simulator For Go](#serverfull---a-lambda-simulator-for-go)auto - [Overview](#overview)auto - [Quick Start](#quick-start)auto - [Features And Limitations](#features-and-limitations)auto - [HTTP API Options](#http-api-options)auto - [Function Loaders](#function-loaders)auto - [Running In Mock Mode](#running-in-mock-mode)auto - [Building Lambda Binaries](#building-lambda-binaries)auto - [Configuration](#configuration)auto - [Status](#status)auto - [Planned/Proposed Features](#plannedproposed-features)auto - [Contributing](#contributing)auto - [Building And Testing](#building-and-testing)auto - [License](#license)auto - [Contributing Agreement](#contributing-agreement)autoauto<!-- /TOC -->

## Overview

This projects is a toolkit for leveraging Lambda functions outside of the usual
Expand Down Expand Up @@ -49,7 +29,6 @@ would likely be better served by using tools like
[docker-lambda](https://github.com/lambci/docker-lambda) and [AWS SAM
Local](https://aws.amazon.com/blogs/aws/new-aws-sam-local-beta-build-and-test-serverless-applications-locally/).

<a id="markdown-quick-start" name="quick-start"></a>
## Quick Start

Start by defining a normal lambda function. For example, here is one from the AWS Go
Expand Down Expand Up @@ -77,7 +56,7 @@ import (
"fmt"

"github.com/asecurityteam/serverfull"
"github.com/asecurityteam/settings"
"github.com/asecurityteam/settings/v2"
)

func hello() (string, error) {
Expand Down Expand Up @@ -131,10 +110,8 @@ aws lambda invoke \
rm output.txt
```

<a id="markdown-features-and-limitations" name="features-and-limitations"></a>
## Features And Limitations

<a id="markdown-http-api-options" name="http-api-options"></a>
### HTTP API Options

The `X-Amz-Invocation-Type` header can be used, as described in the actual [AWS
Expand All @@ -153,7 +130,6 @@ are:
The API is compatible enough with AWS Lambda that the AWS CLI, as well as all AWS
SDKs that support Lambda features, can be used after adjusting the endpoint value.

<a id="markdown-function-loaders" name="function-loaders"></a>
### Function Loaders

The project currently only supports using a static mapping of functions. A future
Expand All @@ -162,7 +138,6 @@ feature we are considering is the addition of the `CreateFunction` and
This would enable teams who want to continue using the AWS CLI for managing
deployments to do so.

<a id="markdown-running-in-mock-mode" name="running-in-mock-mode"></a>
### Running In Mock Mode

Mock mode inspects the signatures of each function being served and runs a
Expand All @@ -183,7 +158,6 @@ if err := serverfull.StartHTTP(ctx, source, fetcher); err != nil {
}
```

<a id="markdown-building-lambda-binaries" name="building-lambda-binaries"></a>
### Building Lambda Binaries

In the same manner that you can enable mock mode you can also enable a native
Expand Down Expand Up @@ -218,7 +192,6 @@ startup time.
The lambda build mode also supports running the function in mock mode by
using `StartLambdaMock`.

<a id="markdown-configuration" name="configuration"></a>
## Configuration

This project uses [settings](https://github.com/asecurityteam/settings) for managing
Expand All @@ -236,13 +209,11 @@ you use a project like [transportd](https://github.com/asecurityteam/transportd)
more in-depth "service-mesh" type of proxy rather than modifying this project
directly.

<a id="markdown-status" name="status"></a>
## Status

This project is in incubation which means we are not yet operating this tool in
production and the interfaces are subject to change.

<a id="markdown-plannedproposed-features" name="plannedproposed-features"></a>
## Planned/Proposed Features

- Replication of AWS CloudWatch metrics for lambda when running in HTTP mode.
Expand All @@ -252,10 +223,8 @@ production and the interfaces are subject to change.
- Ability to provide static or random values for mock outputs instead of only zero
values.

<a id="markdown-contributing" name="contributing"></a>
## Contributing

<a id="markdown-building-and-testing" name="building-and-testing"></a>
### Building And Testing

We publish a docker image called [SDCLI](https://github.com/asecurityteam/sdcli) that
Expand Down Expand Up @@ -283,12 +252,10 @@ the Makefile:

Report the combined coverage for unit and integration tests

<a id="markdown-license" name="license"></a>
### License

This project is licensed under Apache 2.0. See LICENSE.txt for details.

<a id="markdown-contributing-agreement" name="contributing-agreement"></a>
### Contributing Agreement

Atlassian requires signing a contributor's agreement before we can accept a patch. If
Expand Down
2 changes: 1 addition & 1 deletion domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/aws/aws-lambda-go/lambda"
"github.com/rs/xstats"

"github.com/asecurityteam/logevent"
"github.com/asecurityteam/logevent/v2"
)

// Logger is an alias for the chosen project logging library
Expand Down
38 changes: 22 additions & 16 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,31 +1,37 @@
module github.com/asecurityteam/serverfull

go 1.17
go 1.22

toolchain go1.23.1

require (
github.com/asecurityteam/logevent v1.6.1
github.com/asecurityteam/runhttp v0.4.2
github.com/asecurityteam/settings v0.7.0
github.com/aws/aws-lambda-go v1.26.0
github.com/go-chi/chi v4.1.2+incompatible
github.com/asecurityteam/logevent/v2 v2.0.1
github.com/asecurityteam/runhttp v0.6.5
github.com/asecurityteam/settings/v2 v2.0.1
github.com/aws/aws-lambda-go v1.47.0
github.com/go-chi/chi v1.5.5
github.com/golang/mock v1.6.0
github.com/rs/xstats v0.0.0-20170813190920-c67367528e16
github.com/stretchr/testify v1.7.0
github.com/stretchr/testify v1.9.0
)

require (
github.com/asecurityteam/component-connstate v0.1.0 // indirect
github.com/asecurityteam/component-expvar v0.1.0 // indirect
github.com/asecurityteam/component-log v0.2.1 // indirect
github.com/asecurityteam/component-signals v0.1.0 // indirect
github.com/asecurityteam/component-stat v0.1.0 // indirect
github.com/asecurityteam/component-connstate v0.2.3 // indirect
github.com/asecurityteam/component-expvar v0.2.2 // indirect
github.com/asecurityteam/component-log v0.4.0 // indirect
github.com/asecurityteam/component-signals v0.4.0 // indirect
github.com/asecurityteam/component-stat v0.5.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/fatih/structs v1.1.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/go-chi/chi/v5 v5.1.0 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/rs/xhandler v0.0.0-20170707052532-1eb70cf1520d // indirect
github.com/rs/zerolog v1.15.0 // indirect
github.com/spf13/cast v1.3.1 // indirect
golang.org/x/net v0.23.0 // indirect
github.com/rs/zerolog v1.33.0 // indirect
github.com/spf13/cast v1.7.0 // indirect
golang.org/x/net v0.28.0 // indirect
golang.org/x/sys v0.24.0 // indirect
gopkg.in/yaml.v3 v3.0.1 // indirect
)
Loading