cache

package
v0.3.5 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	LATITUDE  = "40.25258"
	LONGITUDE = "-111.657658"
)

LAT and LONG

Functions

func AddConnection

func AddConnection(byuID string, connectionToAdd *Client)

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

func GetEmployeeFromStore(byuID string) *structs.Employee

GetEmployeeFromStore to retrieve the cached employee record

func GetOtherHoursForJobAndDate

func GetOtherHoursForJobAndDate(byuID string, jobID int, date time.Time)

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

func SendMessageToClient(byuID string, messageType string, toSend interface{}) error

SendMessageToClient will send a message to the web socket client

func UpdateEmployeeFromTimesheet

func UpdateEmployeeFromTimesheet(byuID string, timesheet structs.Timesheet)

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

func UpdatePossibleWorkOrders(byuID string, jobID int, workOrderArray []structs.WorkOrder)

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

func WebSocketExists(byuID string) bool

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

func (*Client) CloseWithReason

func (c *Client) CloseWithReason(msg string)

Jump to

Keyboard shortcuts

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