user

package
v0.0.0-...-e806bbe Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2022 License: MPL-2.0 Imports: 8 Imported by: 0

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 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)

Jump to

Keyboard shortcuts

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