Documentation ¶
Index ¶
- Variables
- func ChangeAccountPassword(username string, oldPassword string, newPassword string) (bool, error)
- func ConnectDatabase(dbPath string) error
- func CreateBuilding(p ProposedBuilding, id int) (bool, error)
- func CreateFloor(f ProposedFloor, id int) (bool, error)
- func CreateLocation(p ProposedLocation, id int) (bool, error)
- func CreatePanel(p ProposedPanel, id int) (bool, error)
- func CreateUser(p ProposedUser) (bool, error)
- func DeleteBuildingById(id int) (bool, error)
- func DeleteFloorById(id int) (bool, error)
- func DeleteLocationById(id int) (bool, error)
- func DeletePanelById(id int) (bool, error)
- func DeleteUser(username string) (bool, error)
- func GetBuildingIdByName(buildingName string) (int, error)
- func GetUserStatus(username string) (string, error)
- func SetApprovalStatusPanelById(id int, status PanelApproval, userId int) (bool, error)
- func SetPanelAgeRestrictionById(id int, status PanelAgeRestrictionState) (bool, error)
- func SetPanelLocation(id int, j Location) (bool, error)
- func SetPanelScheduledTimeById(id int, json PanelScheduledTime) (bool, string, error)
- func SetUserStatus(username string, j UserStatus) (bool, error)
- func UpdateBuildingById(id int, b BuildingUpdate) (bool, error)
- func UpdateFloorById(id int, f FloorUpdate) (bool, error)
- func UpdateLocationById(id int, l LocationUpdate) (bool, error)
- type Building
- type BuildingFloor
- type BuildingList
- type BuildingUpdate
- type FailureMsg
- type FloorList
- type FloorUpdate
- type HealthCheck
- type InvalidStatusValue
- type Location
- type LocationList
- type LocationUpdate
- type Panel
- type PanelAgeRestrictionState
- type PanelApproval
- type PanelList
- type PanelSQL
- type PanelScheduledTime
- type PasswordChange
- type PasswordHashMismatch
- type ProposedBuilding
- type ProposedFloor
- type ProposedLocation
- type ProposedPanel
- type ProposedUser
- type Schedule
- type ScheduledEvent
- type SchedulingConflict
- type SuccessMsg
- type User
- type UserStatus
- type UserStatusMsg
- type UsersList
Constants ¶
This section is empty.
Variables ¶
View Source
var DB *sql.DB
Functions ¶
func ChangeAccountPassword ¶
func ConnectDatabase ¶
func CreateBuilding ¶
func CreateBuilding(p ProposedBuilding, id int) (bool, error)
func CreateFloor ¶
func CreateFloor(f ProposedFloor, id int) (bool, error)
func CreateLocation ¶
func CreateLocation(p ProposedLocation, id int) (bool, error)
func CreatePanel ¶
func CreatePanel(p ProposedPanel, id int) (bool, error)
func CreateUser ¶
func CreateUser(p ProposedUser) (bool, error)
func DeleteBuildingById ¶
func DeleteFloorById ¶
func DeleteLocationById ¶
func DeletePanelById ¶
func DeleteUser ¶
func GetBuildingIdByName ¶
func GetUserStatus ¶
func SetApprovalStatusPanelById ¶
func SetApprovalStatusPanelById(id int, status PanelApproval, userId int) (bool, error)
func SetPanelAgeRestrictionById ¶
func SetPanelAgeRestrictionById(id int, status PanelAgeRestrictionState) (bool, error)
func SetPanelScheduledTimeById ¶
func SetPanelScheduledTimeById(id int, json PanelScheduledTime) (bool, string, error)
func SetUserStatus ¶
func SetUserStatus(username string, j UserStatus) (bool, error)
func UpdateBuildingById ¶
func UpdateBuildingById(id int, b BuildingUpdate) (bool, error)
func UpdateFloorById ¶
func UpdateFloorById(id int, f FloorUpdate) (bool, error)
func UpdateLocationById ¶
func UpdateLocationById(id int, l LocationUpdate) (bool, error)
Types ¶
type Building ¶
type Building struct { Id int `json:"Id"` Name string `json:"name"` City string `json:"city"` Region string `json:"region"` CreatorId int `json:"creatorId"` CreationDate string `json:"creationDateTime"` }
func GetBuildingById ¶
func GetBuildings ¶
type BuildingFloor ¶
type BuildingFloor struct { Id int `json:"Id"` FloorName string `json:"floorName"` BuildingId int `json:"buildingId"` CreatorId int `json:"creatorId"` CreationDate string `json:"creationDateTime"` }
func GetAllFloors ¶
func GetAllFloors() ([]BuildingFloor, error)
func GetFloorById ¶
func GetFloorById(id int) (BuildingFloor, error)
func GetFloorsByBuildingId ¶
func GetFloorsByBuildingId(id int) ([]BuildingFloor, error)
type BuildingList ¶
type BuildingList struct {
Data []Building `json:"data"`
}
type BuildingUpdate ¶
type FailureMsg ¶
type FailureMsg struct {
Error string `json:"error"`
}
type FloorList ¶
type FloorList struct {
Data []BuildingFloor `json:"data"`
}
type FloorUpdate ¶
type HealthCheck ¶
type InvalidStatusValue ¶
type InvalidStatusValue struct {
Err error
}
func (*InvalidStatusValue) Error ¶
func (i *InvalidStatusValue) Error() string
type Location ¶
type Location struct { Id int `json:"Id"` Location string `json:"location"` FloorId int `json:"floorId"` BuildingId int `json:"buildingId"` CreatorId int `json:"creatorId"` CreationDate string `json:"creationDateTime"` }
func GetAllLocations ¶
func GetLocationById ¶
func GetLocationsByFloorId ¶
type LocationList ¶
type LocationList struct {
Data []Location `json:"data"`
}
type LocationUpdate ¶
type Panel ¶
type Panel struct { Id int `json:"Id"` Topic string `json:"topic"` Description string `json:"description"` PanelRequestorEmail string `json:"panelRequestorEmail"` Location string `json:"location"` ScheduledTime string `json:"scheduledTime"` DurationInMinutes int `json:"durationInMinutes"` AgeRestricted bool `json:"ageRestricted"` CreatorId int `json:"creatorId"` CreationDateTime string `json:"creationDateTime"` ApprovalStatus bool `json:"approvalStatus"` ApprovedById int `json:"approvedById"` ApprovalDateTime string `json:"approvalDateTime"` }
func GetPanelById ¶
type PanelAgeRestrictionState ¶
type PanelAgeRestrictionState struct {
RestrictionState bool `json:"restrictionState"`
}
type PanelApproval ¶
type PanelApproval struct {
State bool `json:"state"`
}
type PanelSQL ¶
type PanelSQL struct { Id int `json:"Id"` Topic string `json:"topic"` Description string `json:"description"` PanelRequestorEmail string `json:"panelRequestorEmail"` Location string `json:"location"` ScheduledTime sql.NullString `json:"scheduledTime"` DurationInMinutes int `json:"durationInMinutes"` AgeRestricted bool `json:"ageRestricted"` CreatorId int `json:"creatorId"` CreationDateTime string `json:"creationDateTime"` ApprovalStatus bool `json:"approvalStatus"` ApprovedById sql.NullInt64 `json:"approvedById"` ApprovalDateTime sql.NullString `json:"approvalDateTime"` }
func GetPanelsByLocationId ¶
type PanelScheduledTime ¶
type PasswordChange ¶
type PasswordHashMismatch ¶
type PasswordHashMismatch struct {
Err error
}
func (*PasswordHashMismatch) Error ¶
func (p *PasswordHashMismatch) Error() string
type ProposedBuilding ¶
type ProposedFloor ¶
type ProposedLocation ¶
type ProposedPanel ¶
type ProposedUser ¶
type Schedule ¶
type Schedule struct { StartTime string `json:"startTime"` DurationInMinutes int `json:"durationInMinutes"` }
type ScheduledEvent ¶
type SchedulingConflict ¶
type SchedulingConflict struct {
Err error
}
func (*SchedulingConflict) Error ¶
func (s *SchedulingConflict) Error() string
type SuccessMsg ¶
type SuccessMsg struct {
Message string `json:"message"`
}
type User ¶
type User struct { Id int `json:"Id"` UserName string `json:"userName"` Status string `json:"status"` PasswordHash string `json:"passwordHash"` CreationDate string `json:"creationDate"` LastChangedDate string `json:"lastChangedDate"` }
func GetUserById ¶
func GetUserByUserName ¶
type UserStatus ¶
type UserStatus struct {
Status string `json:"status" enum:"enabled,disabled"`
}
type UserStatusMsg ¶
Click to show internal directories.
Click to hide internal directories.