Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorFailedToFetchUser = "Failed to fetch user" ErrorFailedToUnMarshalRecord = "Failed to unmarshal record" ErrorFailedToFetchUsers = "Failed to fetch users" ErrorInvalidUserEmail = "Invalid user email" ErrorUserAlreadyExists = "User already exists" ErrorCouldNotMarshalUser = "Could not marshal user" ErrorCouldNotCreateUser = "Could not create user" ErrorUserDoesNotExists = "User does not exists" ErrorCouldNotUpdateUser = "Could not update user" )
Functions ¶
func DeleteUser ¶
func DeleteUser(req events.APIGatewayProxyRequest, tableName string, dynaClient dynamodbiface.DynamoDBAPI) (*events.APIGatewayProxyResponse, error)
func FetchUsers ¶
func FetchUsers(tableName string, dynaClient dynamodbiface.DynamoDBAPI) (*[]User, error)
Types ¶
type User ¶
type User struct { Email string `json:"email"` // required as naming convention FirstName string `json:"firstName"` LastName string `json:"lastName"` }
func CreateUser ¶
func CreateUser(req events.APIGatewayProxyRequest, tableName string, dynaClient dynamodbiface.DynamoDBAPI) (*User, error)
func FetchUser ¶
func FetchUser(email string, tableName string, dynaClient dynamodbiface.DynamoDBAPI) (*User, error)
func UpdateUser ¶
func UpdateUser(req events.APIGatewayProxyRequest, tableName string, dynaClient dynamodbiface.DynamoDBAPI) (*User, error)
Click to show internal directories.
Click to hide internal directories.