dao

package
v0.0.0-...-52007fc Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COLLECTION = "pets"
)

COLLECTION represents the database collection to use

Variables

This section is empty.

Functions

This section is empty.

Types

type PetsDAO

type PetsDAO struct {
	Server   string
	Database string
}

PetsDAO represents the database server

func (*PetsDAO) Connect

func (p *PetsDAO) Connect()

Connect establishes a connection to DB

func (*PetsDAO) Delete

func (p *PetsDAO) Delete(pet models.Pet) error

Delete deletes an existing pet

func (*PetsDAO) FindAllByUserID

func (p *PetsDAO) FindAllByUserID(userID string) ([]models.Pet, error)

FindAllByUserID gets a list of all pets for a user

func (*PetsDAO) FindByID

func (p *PetsDAO) FindByID(id string) (models.Pet, error)

FindByID finds a pet by ID

func (*PetsDAO) Insert

func (p *PetsDAO) Insert(pet models.Pet) error

Insert inserts a pet into the DB

func (*PetsDAO) Update

func (p *PetsDAO) Update(pet models.Pet) error

Update updates an existing pet

Jump to

Keyboard shortcuts

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