Comments (6)
Hi @cmello,
I think my question is still relevant: could we change the type of NewImage and OldImage (and Keys) to *dynamodb.AttributeValue from *event.DynamoDBAttributeValue? They are virtually the same thing. That way you could just use dynamodbattribute.Unmarshal and the rest of the methods plus you reduced ambiguity?
from aws-lambda-go.
I would like to know this as well. Namely, why do we have two representations of the "same" thing: dynamodb.AttributeValue vs event.DynamoDBAttributeValue. The dynamodb package provides methods for unmarshalling into a struct which is quite handy, however I can't do the same with this package. I cannot even use something like mapstructure, because Map() returns a map with metadata.
from aws-lambda-go.
Hi @moedeveloper ,
You can use your own struct instead of DynamoDBEvent and customize serialization using the standard βjsonβ key in the field tags. Please see https://golang.org/pkg/encoding/json/#Marshal .
Best regards!
from aws-lambda-go.
Yeah check out the example we have in our tests:
https://github.com/aws/aws-lambda-go/blob/master/events/dynamodb_test.go#L18
from aws-lambda-go.
i saw it, you unmarchal to dynamoDBEvent, i want to unmarchal for a specific struct or maybe an interface{}
from aws-lambda-go.
Hi @morcmarc,
Thank you for your comments! dynamodb.AttributeValue is very handy but aws-lambda-go does not require a dependency on aws-sdk-go at this time. Could you please open a separate issue for discussing the options? Thank you very much!
from aws-lambda-go.
Related Issues (20)
- S3ObjectLambdaEvent is missed in codebase
- events.CodeCommitReference has missing Deleted field HOT 2
- ALB target grouped Lambda returns fine but alb return 502 error that "LambdaInvalidResponse" HOT 2
- Deserialisation of array values in Cognito events custom UserAttributes not working correctly HOT 1
- Support structured JSON logging for errors HOT 2
- please add a mocked example HOT 1
- Custom runtime provided.al2 broken on v1.42 HOT 1
- Add IoTCoreMQTTMessage to aws/aws-lambda-go/events
- Add disconnectStatusCode to event/APIGatewayWebsocketProxyRequestContext
- RequestContext.Authorizer differs between REST gateway vs HTTP gateway
- UnmarshalTypeError on CodePipelineEventBridgeEvent HOT 4
- Missing field enableSMSMFA on struct events.CognitoEventUserPoolsMigrateUserResponse
- Runtime.InvalidEntrypoint
- Add AWS CloudWatch Alarm Event
- Implement `MultiValueHeaders` for ``events.LambdaFunctionURLResponse``
- Small improvement in APIGatewayWebsocketProxyRequestContext.Authorizer
- [BUG] Traceability panic error memory address runtime al2023
- Getting Segmentation Fault while using Lambda function with SAM Server
- Lambda Function Not Routing Correctly with API Gateway
- Please export extensionAPIClient HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-lambda-go.