user

package
v0.0.0-...-272b7ce Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2022 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Overview

The controller functions which access the database and the structs which define the data. If this were a larger package these would be split up.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorFailedToFetchRecord     = "Failed to fetch record"
	ErrorInvalidUserData         = "Invalid user data"
	ErrorFailedToUnmarshalRecord = "Failed to unmarshal record"
	ErrorInvalidEmail            = "Invalid Email"
	ErrorCouldNotMarshalItem     = "Could not marshal item"
	ErrorCouldNotDeleteItem      = "Could not delete item"
	ErrorCouldNotPutDynamoItem   = "Could not dynamo put item"
	ErrorUserAlreadyExists       = "User already exists"
	ErrorUserDoesNotExist        = "User does not exist"
)

Functions

func DeleteUser

func DeleteUser(req events.APIGatewayProxyRequest, tablename string, dynaClient dynamodbiface.DynamoDBAPI) error

func FetchUsers

func FetchUsers(tableName string, dynaClient dynamodbiface.DynamoDBAPI) (*[]User, error)

Types

type User

type User struct {
	Email     string `json: "email"`
	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