这是indexloc提供的服务,不要输入任何密码

database

package
v0.0.0-...-9658b47 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package database provides functionality for managing the connection and interactions with the Firestore database.

It includes initialization of the Firestore client and CRUD operations for all Firestore collections.

Index

Constants

This section is empty.

Variables

Functions

func ChangeCareGiver

func ChangeCareGiver(newCg []models.Relationship, id string) error

ChangeCareGiver changes the care giver for a document with the matching id in the care_receiver Firebase collection

func CloseDB

func CloseDB()

CloseDB destructs the closes the Firebase App Client instance

func CreateCareGiver

func CreateCareGiver(c *gin.Context) error

CreateCareGiver creates a new document in the care_giver Firebase collection

func CreateCareReceiver

func CreateCareReceiver(data []byte) error

CreateCareReceiver creates a document in the care_receiver Firebase collection

func CreateSOSLog

func CreateSOSLog(data []byte) (string, error)

CreateSOSLog creates a new document in the sos_log Firebase collection

func CreateTravelLog

func CreateTravelLog(data []byte) (string, error)

CreateTravelLog creates a new document in the travel_log Firebase collection

func CreateVolunteer

func CreateVolunteer(c *gin.Context) error

CreateVolunteer creates a new document in the volunteers Firebase Collection

func DeleteCareGiver

func DeleteCareGiver(id string) error

Delete the document with the matching id from the care_giver Firebase collection

func DeleteCareReceiver

func DeleteCareReceiver(id string) error

DeleteCareReceiver deletes a document with the matching id in the care_receiver Firebase collection

func DeleteVolunteer

func DeleteVolunteer(id string) error

DeleteVolunteer deletes the document with matching id from the volunteer Firebase collection

func FindSOSLog

func FindSOSLog(SOSId string) (models.SOSLog, error)

FindSOSLog reads the document with the matching SOSId in the sos_log Firebase collection

func InitCareGiver

func InitCareGiver()

InitCareGiver initialises the reference to the care_giver Firebase collection

func InitCareReceiver

func InitCareReceiver()

InitCareReceiver initialises the reference to the care_receiver Firebase collection

func InitSosLog

func InitSosLog()

InitSOSLog initialises the reference to the sos_log Firebase collection

func InitTravelLog

func InitTravelLog()

InitTravelLog initialises the reference to the travel_log Firebase collection

func InitVolunteers

func InitVolunteers()

InitVolunteers initialises the reference to the volunteers Firebase collection

func NewCareReceiver

func NewCareReceiver(newCareReceiver models.Relationship, id string) error

NewCareReceiver adds a new care receiver to the care receiver list of the document with the matching id in the care_giver Firebase collection

func ReadAllCareGivers

func ReadAllCareGivers() ([]models.CareGiver, error)

ReadAllCareGivers reads and returns all documents from the care_giver Firebase collection

func ReadAllCareReceivers

func ReadAllCareReceivers() ([]models.CareReceiver, error)

ReadAllCareReceiver reads and returns all documents from the care_receiver Firebase collection

func ReadAllSOSLogs

func ReadAllSOSLogs() ([]models.SOSLog, error)

ReadAllSOSLogs reads and returns all documents from the sos_log Firebase collection

func ReadAllTravelLogs

func ReadAllTravelLogs() ([]models.TravelLog, error)

Read all documents

func ReadAllVolunteers

func ReadAllVolunteers() ([]models.Volunteer, error)

ReadAllVolunteers reads and returns all documents from the volunteers Firebase collection

func ReadCareGiver

func ReadCareGiver(id string) (models.CareGiver, error)

ReadCareGiver reads and returns a document with the matching id from the care_giver Firebase collection

func ReadCareReceiver

func ReadCareReceiver(id string) (models.CareReceiver, error)

ReadCareReceiver reads and returns the document with the mathcing id from the care_receiver Firebase collection

func ReadLatestSOSLog

func ReadLatestSOSLog(id string) (models.SOSLog, error)

ReadLatestSOSLog reads and returns the all documents with cr_id field matching the specified id in the sos_log Firebase collection

func ReadLatestTravelLog

func ReadLatestTravelLog(id string) (models.TravelLog, error)

ReadLatestTravelLog reads and returns the last created document with cr_id that matches the id, from the travel_log Firebase collection

func ReadTravelLog

func ReadTravelLog(id string) ([]models.TravelLog, error)

ReadTravelLog reads and returns all documents with cr_id matching the specified id in the travel_log Firebase collection

func ReadVolunteer

func ReadVolunteer(id string) (models.Volunteer, error)

ReadVolunteer reads and returns the document with matching id from the volunteers Firebase collection

func RemoveCareReceiver

func RemoveCareReceiver(CgId string, CrId string) error

RemoveCareReceiver removes a new care receiver from the care receiver list of the document with the matching id in the care_giver Firebase collection

func UpdateCareGiver

func UpdateCareGiver(c *gin.Context, id string) error

UpdateCareGiver updates a document with the matching id in the care_giver Firebase collection (use NewCareReceiver and RemoveCareReceiver to modify the care receiver list)

func UpdateCareReceiver

func UpdateCareReceiver(c *gin.Context, id string) error

UpdateCareReceiver updates the document with the matching id in the care_giver Firebase collection (use ChangeCareGiver to modify the related caregiver)

func UpdateSOSLog

func UpdateSOSLog(data []byte, id string) error

UpdateSOSLog updates the document with the matching id in the sos_log Firebase collection

func UpdateTravelLog

func UpdateTravelLog(data []byte, id string) error

UpdateTravelLog updates the document with matching id in the travel_log Firebase collection

func UpdateVolunteer

func UpdateVolunteer(c *gin.Context, id string) error

UpdateVolunteer updates the document with matching id from the the volunteers Firebase collection

Types

This section is empty.

Jump to

Keyboard shortcuts

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