dao

package
v0.0.0-...-c10c38b Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	COLLECTION = "users"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type UsersDAO

type UsersDAO struct {
	Server   string
	Database string
}

func (*UsersDAO) Connect

func (m *UsersDAO) Connect()

Establish a connection to database

func (*UsersDAO) Delete

func (m *UsersDAO) Delete(user User) error

Delete an existing user

func (*UsersDAO) FindAll

func (m *UsersDAO) FindAll() ([]User, error)

Find list of users

func (*UsersDAO) FindById

func (m *UsersDAO) FindById(id string) (User, error)

Find a user by its id

func (*UsersDAO) Insert

func (m *UsersDAO) Insert(user User) error

Insert a user into database

func (*UsersDAO) Update

func (m *UsersDAO) Update(user User) error

Update an existing user

Jump to

Keyboard shortcuts

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