mongodb

package
v0.0.0-...-8474782 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceRepo

type DeviceRepo struct {
	DB *mongo.Collection
}

DeviceRepo Collection

func (*DeviceRepo) CreateDevice

func (d *DeviceRepo) CreateDevice(device *models.Device) (*models.Device, error)

CreateDevice create device

func (*DeviceRepo) GetDevice

func (d *DeviceRepo) GetDevice(id string) (*models.Device, error)

GetDevice get one device

func (*DeviceRepo) GetDevices

func (d *DeviceRepo) GetDevices() ([]*models.Device, error)

GetDevices get all devices

func (*DeviceRepo) GetDevicesByRoomID

func (d *DeviceRepo) GetDevicesByRoomID(deviceID string) ([]*models.Device, error)

GetDevicesByRoomID get all devices in a Device by deviceID

func (*DeviceRepo) UpdateDevice

func (d *DeviceRepo) UpdateDevice(id string, device *models.Device) (*models.Device, error)

UpdateDevice update a device by id

type EmailRepo

type EmailRepo struct {
	DB *mongo.Collection
}

EmailRepo Collection

func (*EmailRepo) CreateEmail

func (e *EmailRepo) CreateEmail(email *models.Email) (*models.Email, error)

CreateEmail create email

func (*EmailRepo) GetEmail

func (e *EmailRepo) GetEmail(id string) (*models.Email, error)

GetEmail get one email

func (*EmailRepo) GetEmails

func (e *EmailRepo) GetEmails() ([]*models.Email, error)

GetEmails get all emails

type RoomRepo

type RoomRepo struct {
	DB *mongo.Collection
}

RoomRepo Collection

func (*RoomRepo) CreateRoom

func (d *RoomRepo) CreateRoom(room *models.Room) (*models.Room, error)

CreateRoom create room

func (*RoomRepo) GetRoom

func (d *RoomRepo) GetRoom(id string) (*models.Room, error)

GetRoom get one room

func (*RoomRepo) GetRooms

func (d *RoomRepo) GetRooms(filter *models.RoomFilter, limit *int, offset *int) ([]*models.Room, error)

GetRooms get all rooms

func (*RoomRepo) UpdateRoom

func (d *RoomRepo) UpdateRoom(id string, room *models.Room) (*models.Room, error)

UpdateRoom update a room by id

type UserRepo

type UserRepo struct {
	DB *mongo.Collection
}

UserRepo Collection

func (*UserRepo) CreateUser

func (d *UserRepo) CreateUser(user *models.User) (*models.User, error)

CreateUser create user

func (*UserRepo) GetUser

func (d *UserRepo) GetUser(id string) (*models.User, error)

GetUser get user by id

func (*UserRepo) GetUserByUsername

func (d *UserRepo) GetUserByUsername(username string) (*models.User, error)

GetUserByUsername get user by username

func (*UserRepo) GetUsers

func (d *UserRepo) GetUsers() ([]*models.User, error)

GetUsers get all users

func (*UserRepo) UpdateUser

func (d *UserRepo) UpdateUser(id string, user *models.User) (*models.User, error)

UpdateUser update a User by id

Jump to

Keyboard shortcuts

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