database

package
v0.0.0-...-bee4d3c Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorFailedToUnmarshalRecord = "failed to unmarshal record"
	ErrorFailedToFetchRecord     = "failed to fetch record"
	ErrorInvalidUserData         = "invalid user data"
	ErrorInvalidEmail            = "invalid email"
	ErrorCouldNotMarshalItem     = "could not marshal item"
	ErrorCouldNotDeleteItem      = "could not delete item"
	ErrorCouldNotDynamoPutItem   = "could not dynamo put item"
	ErrorUserAlreadyExists       = "user.User already exists"
	ErrorUserDoesNotExist        = "user.User does not exist"
)

Functions

This section is empty.

Types

type User

type User struct {
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	Email     string `json:"email"`
}

type UsersRepository

type UsersRepository struct {
	// contains filtered or unexported fields
}

func NewUsersRepository

func NewUsersRepository(session *session.Session) *UsersRepository

func (*UsersRepository) Create

func (ur *UsersRepository) Create(user *User) (*User, error)

func (*UsersRepository) DeleteByEmail

func (ur *UsersRepository) DeleteByEmail(email string) (*User, error)

func (*UsersRepository) GetAll

func (ur *UsersRepository) GetAll() ([]User, error)

func (*UsersRepository) GetByEmail

func (ur *UsersRepository) GetByEmail(email string) (*User, error)

func (*UsersRepository) Update

func (ur *UsersRepository) Update(user *User) (*User, error)

Jump to

Keyboard shortcuts

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