hrtclicker

package module
v0.0.0-...-6b4eda8 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

README

hrtclicker

screenshot

This service was written because this one was struggling to keep track of when to apply its estrogen patches, so it built a service to keep track of that for it. Being a pure Go service that relies on Gotify to send out push notifications to its phone, no Java code was needed.

Architecture

  • Web frontend that allows recording HRT history and displaying statistics
  • Configuration:
    • Recommended time intervals for HRT
  • Gotify integration: push notifications when it's time to do HRT

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	HRT    HRTConfig `json:"hrt"`
	Gotify struct {
		Endpoint     string       `json:"endpoint"`
		Token        string       `json:"token"`
		Notification Notification `json:"notification"`
	} `json:"gotify"`
}

Config contains the configuration for the hrtclicker application. See config.json for an example configuration.

func ReadJSONConfig

func ReadJSONConfig(r io.Reader) (*Config, error)

ReadJSONConfig reads a Config from the provided io.Reader in JSON format.

func ReadJSONConfigFile

func ReadJSONConfigFile(path string) (*Config, error)

ReadJSONConfigFile reads a Config from the provided file path as a JSON file.

type HRTConfig

type HRTConfig struct {
	Type        HRTType           `json:"type"`
	Interval    cfgtypes.Duration `json:"interval"`
	Concurrence int               `json:"concurrence"`
}

type HRTType

type HRTType string

HRTType contains the enumeration for the various types of hormone replacement therapy. The supported types are listed as constants.

const (
	TypePatches    HRTType = "patches"
	TypeGel        HRTType = "gel"
	TypeSublingual HRTType = "sublingual"
	TypeInjection  HRTType = "injection"
)

type Notification

type Notification struct {
	Title   string         `json:"title"`
	Message string         `json:"message"`
	Extras  map[string]any `json:"extras"`
}

Notification is a type used to represent the notification message. It copies Gotify's notification message format.

type NotificationTemplateData

type NotificationTemplateData struct {
	LastDoseAt time.Time
	NextDoseAt time.Time
	HRTType    HRTType
}

NotificationTemplateData is the data used for rendering the template of both the notification title and message.

Directories

Path Synopsis
cmd
internal

Jump to

Keyboard shortcuts

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