Documentation ¶
Index ¶
- Variables
- func AddConnection(byuID string, connectionToAdd *Client)
- func AddEmployee(byuID string)
- func DeleteWorkOrderEntry(byuID string, id int, date string, seqNum string, ...)
- func GetEmployeeFromStore(byuID string) *structs.Employee
- func GetOtherHoursForJobAndDate(byuID string, jobID int, date time.Time)
- func GetPossibleWorkOrders(byuID string)
- func GetPunchesForAllJobs(byuID string)
- func GetWorkOrderEntries(byuID string)
- func GetYtimeLocation()
- func RemoveEmployeeFromStore(byuID string)
- func SendMessageToClient(byuID string, messageType string, toSend interface{}) error
- func UpdateEmployeeFromTimesheet(byuID string, timesheet structs.Timesheet)
- func UpdateEmployeePunchesForJob(byuID string, jobID int, dayArray []structs.TimeClockDay)
- func UpdateOtherHoursForJobAndDate(byuID string, jobID int, date time.Time, ...)
- func UpdatePossibleWorkOrders(byuID string, jobID int, workOrderArray []structs.WorkOrder)
- func UpdateTimeClockDay(byuID string, jobID int, day structs.TimeClockDay)
- func UpdateWorkOrderEntriesForJob(byuID string, jobID int, workOrderDayArray []structs.WorkOrderDaySummary)
- func WebSocketExists(byuID string) bool
- type Client
Constants ¶
This section is empty.
Variables ¶
var ( LATITUDE = "40.25258" LONGITUDE = "-111.657658" )
LAT and LONG
Functions ¶
func AddConnection ¶
AddConnection adds the websocket to the store
func AddEmployee ¶
func AddEmployee(byuID string)
AddEmployee adds a blank employee record to the cache
func DeleteWorkOrderEntry ¶
func DeleteWorkOrderEntry(byuID string, id int, date string, seqNum string, response structs.WorkOrderDaySummary)
DeleteWorkOrderEntry deletes a work order entry
func GetEmployeeFromStore ¶
GetEmployeeFromStore to retrieve the cached employee record
func GetOtherHoursForJobAndDate ¶
GetOtherHoursForJobAndDate will get the Other Hours entries for the employee (job/date) and add them to the cached employee record
func GetPossibleWorkOrders ¶
func GetPossibleWorkOrders(byuID string)
GetPossibleWorkOrders will get the list of possible work orders for the employee and add them to the cached employee record
func GetPunchesForAllJobs ¶
func GetPunchesForAllJobs(byuID string)
GetPunchesForAllJobs will get the list of punches for each job and add them to the cached employee record
func GetWorkOrderEntries ¶
func GetWorkOrderEntries(byuID string)
GetWorkOrderEntries will get the list of work order entries for the employee and add them to the cached employee record
func GetYtimeLocation ¶
func GetYtimeLocation()
GetYtimeLocation will get the latitude and longitude for the pi based on the building
func RemoveEmployeeFromStore ¶
func RemoveEmployeeFromStore(byuID string)
RemoveEmployeeFromStore removes the employee record from the cache
func SendMessageToClient ¶
SendMessageToClient will send a message to the web socket client
func UpdateEmployeeFromTimesheet ¶
UpdateEmployeeFromTimesheet updates the employee struct from the server Timesheet struct
func UpdateEmployeePunchesForJob ¶
func UpdateEmployeePunchesForJob(byuID string, jobID int, dayArray []structs.TimeClockDay)
UpdateEmployeePunchesForJob updates from a []structs.TimeClockDay
func UpdateOtherHoursForJobAndDate ¶
func UpdateOtherHoursForJobAndDate(byuID string, jobID int, date time.Time, elapsedTimeSummary structs.ElapsedTimeSummary)
UpdateOtherHoursForJobAndDate updates the other hours for a job and that day
func UpdatePossibleWorkOrders ¶
UpdatePossibleWorkOrders .
func UpdateTimeClockDay ¶
func UpdateTimeClockDay(byuID string, jobID int, day structs.TimeClockDay)
UpdateTimeClockDay .
func UpdateWorkOrderEntriesForJob ¶
func UpdateWorkOrderEntriesForJob(byuID string, jobID int, workOrderDayArray []structs.WorkOrderDaySummary)
UpdateWorkOrderEntriesForJob updates the work order entries for a particular job
func WebSocketExists ¶
WebSocketExists checks to see if there is an open connection for the BYUID
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a wrapper around the websocket connection with a channel to send outbound messages to
func ServeWebsocket ¶
func ServeWebsocket(w http.ResponseWriter, r *http.Request) *Client
ServeWebsocket will create a wrapped websocket connection with a channel to push data to