db

package
v0.0.0-...-f21d01c Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAvailabilityInterval

func GetAvailabilityInterval() time.Duration

Types

type Database

type Database struct {
	Conn *sql.DB
}

func NewDatabase

func NewDatabase(connStr string) (*Database, error)

Initialize database connection

func (*Database) AddAvailability

func (db *Database) AddAvailability(providerID types.UUID, slots []time.Time) error

func (*Database) ConfirmAppointment

func (db *Database) ConfirmAppointment(appointmentID types.UUID) error

func (*Database) CreateUser

func (db *Database) CreateUser(name, email, role string) (*schema.User, error)

func (*Database) GetAppointmentStartTime

func (db *Database) GetAppointmentStartTime(availabilityID *types.UUID) (time.Time, error)

func (*Database) GetAvailableAppointments

func (db *Database) GetAvailableAppointments(providerID *types.UUID, date *types.Date) ([]schema.Appointment, error)

func (*Database) GetUser

func (db *Database) GetUser(userID types.UUID) (*schema.User, error)

func (*Database) IsSlotAvailable

func (db *Database) IsSlotAvailable(providerID *types.UUID, startTime *time.Time) (bool, error)

func (*Database) ReserveAppointment

func (db *Database) ReserveAppointment(clientID, providerID *types.UUID, startTime *time.Time) (*schema.Appointment, error)

Jump to

Keyboard shortcuts

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