2024-05-12 02:06:45 +00:00
|
|
|
# ketotrack
|
|
|
|
Simple GKI calculator written as an exercise in learning Go.
|
|
|
|
|
|
|
|
Currently, this only calculates your GKI and stores the results into a JSON file. At some point I'll get around to
|
|
|
|
implementing note-taking and time-series display.
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
After measuring your blood glucose and blood ketone levels, run `ketotrack`. GKI will be displayed along with
|
|
|
|
the level of ketosis you are in according to [Keto-Mojo](https://keto-mojo.com/glucose-ketone-index-gki/):
|
|
|
|
```
|
|
|
|
Enter glucose reading (mg/dL): 77
|
|
|
|
Enter ketone reading (mmol/L): 1.1
|
|
|
|
|
|
|
|
Your GKI is: 3.89
|
|
|
|
You're in a moderate level of ketosis.
|
|
|
|
```
|
|
|
|
|
|
|
|
Reading data will be saved to `$HOME/.ketotrack/readings.json`.
|
|
|
|
|
|
|
|
## Building and Installing
|
|
|
|
```shell
|
|
|
|
go build
|
|
|
|
mv ketotrack $HOME/.local/bin
|
2024-05-12 18:09:50 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Refactoring Notes
|
2024-05-12 18:38:55 +00:00
|
|
|
- [X] Create `Record` and `Note` struct types
|
2024-05-12 18:09:50 +00:00
|
|
|
- [X] Add `GKI` field to `Reading` struct type
|
2024-05-12 18:38:55 +00:00
|
|
|
- [X] Encapsulate application data with an `AppContext` struct that holds a `Records` slice
|
|
|
|
- [X] `LoadRecords`, `SaveRecords`, `AddReading`, `AddNote` receiver methods
|
|
|
|
- [X] Add interactive menu for adding either a `Note` or a `Record`
|
2024-05-12 18:09:50 +00:00
|
|
|
- [ ] Standardize method names for getting user input to `handleNewNote` and `handleNewReading`
|