|
4 | 4 | "context" |
5 | 5 | "errors" |
6 | 6 | "github.com/aws/aws-lambda-go/events" |
7 | | - "github.com/aws/aws-lambda-go/lambda" |
8 | 7 | "github.com/stretchr/testify/assert" |
9 | 8 | "reflect" |
10 | 9 | "testing" |
@@ -211,41 +210,3 @@ func TestHandlerMapCreationFailsWithBadHandler(t *testing.T) { |
211 | 210 | "lambda demux handler function: expected a handler function; got *errors.errorString") |
212 | 211 | assert.Nil(t, handlerMap) |
213 | 212 | } |
214 | | - |
215 | | -func foo() { |
216 | | - cfg := &Cfg{ |
217 | | - Factories: []Factory{ |
218 | | - func(ctx *EventContext) any { |
219 | | - if HasAttribute(ctx.event, "connectionId") { |
220 | | - return &events.APIGatewayWebsocketProxyRequest{} |
221 | | - } |
222 | | - return &events.APIGatewayProxyRequest{} |
223 | | - }, |
224 | | - }, |
225 | | - Handlers: []any{ |
226 | | - func(ctx context.Context, event *events.APIGatewayWebsocketProxyRequest) ( |
227 | | - *events.APIGatewayProxyResponse, |
228 | | - error) { |
229 | | - // TODO - your code here to handle websocket event |
230 | | - return &events.APIGatewayProxyResponse{}, nil |
231 | | - }, |
232 | | - func(ctx context.Context, event *events.APIGatewayProxyRequest) ( |
233 | | - *events.APIGatewayProxyResponse, |
234 | | - error) { |
235 | | - // TODO - your code here to handle HTTP/REST event |
236 | | - return &events.APIGatewayProxyResponse{}, nil |
237 | | - }, |
238 | | - }, |
239 | | - } |
240 | | - |
241 | | - lambda.Start(NewHandler(cfg)) |
242 | | -} |
243 | | - |
244 | | -type someHandler struct { |
245 | | -} |
246 | | - |
247 | | -func (s *someHandler) HandleEvent( |
248 | | - _ context.Context, |
249 | | - _ *events.APIGatewayWebsocketProxyRequest) (*events.APIGatewayProxyResponse, error) { |
250 | | - return nil, nil |
251 | | -} |
0 commit comments