models

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2021 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DotfileName = fmt.Sprintf("%s/.%s", cwd, "shiftstatus")

Functions

func CheckStatus

func CheckStatus() (bool, error)

Check the current shift status. Return `false` if `.shiftstatus` does not exist or if `STATUS` is not `ACTIVE`.

func DisplayStatus

func DisplayStatus(displayState bool)

Display the current shift status set in `.shiftstatus`.

func GetCurrentStorageType

func GetCurrentStorageType() string

Get the current `storage-type` value in `.shiftstatus`.

Types

type ShiftData

type ShiftData struct {
	Type    string // "IN" or "OUT" (clock-in/out)
	Date    string // Shift (clock-in/out) date
	Day     string // Shift (clock-in/out) day
	Time    string // Shift (clock-in/out) time
	Message string // Complimentary message
}

Initialize shift data.

func (*ShiftData) RecordToDB

func (shiftData *ShiftData) RecordToDB()

Write data stored in the ShiftData struct to the SQLite instance.

func (*ShiftData) RecordToTimesheet

func (shiftData *ShiftData) RecordToTimesheet()

Write data stored in the ShiftData struct to the timesheet.

type ShiftStatus

type ShiftStatus struct {
	Type    string // "IN" or "OUT" (clock-in/out)
	Status  string // "ACTIVE" or "READY"
	Time    string // Clock-in or clock-out time
	Message string // Clock-in or clock-out messsage
}

Shift status struct.

func (*ShiftStatus) SetStatus

func (ss *ShiftStatus) SetStatus()

Set the shift status data in `.shiftstatus`.

Jump to

Keyboard shortcuts

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