Documentation ¶
Index ¶
- Constants
- func GetDir() (string, error)
- func InitLog(w io.Writer, level slog.Level, format LogFormat)
- func LogFormatStrings() []string
- func UnitStrings() []string
- type Advanced
- type Arrows
- type Config
- type Duration
- type DynamicIcon
- type LocalFile
- type Log
- type LogFormat
- type Option
- type TOMLParser
- type Unit
Constants ¶
const LocalFileFormatCsv = "csv"
const MmolConversionFactor = 0.0555
Variables ¶
This section is empty.
Functions ¶
func LogFormatStrings ¶
func LogFormatStrings() []string
LogFormatStrings returns a slice of all String values of the enum
func UnitStrings ¶
func UnitStrings() []string
UnitStrings returns a slice of all String values of the enum
Types ¶
type Arrows ¶
type Arrows struct { DoubleUp string `toml:"double-up"` SingleUp string `toml:"single-up"` FortyFiveUp string `toml:"forty-five-up"` Flat string `toml:"flat"` FortyFiveDown string `toml:"forty-five-down"` SingleDown string `toml:"single-down"` DoubleDown string `toml:"double-down"` Unknown string `toml:"unknown"` }
type Config ¶
type Config struct { File string `toml:"-"` Flags *pflag.FlagSet `toml:"-"` Version string `toml:"-"` Title string `toml:"title" comment:"Tray title."` URL string `toml:"url" comment:"Nightscout URL. (required)"` Token string `toml:"token" comment:"Nightscout token. Using an access token is recommended instead of the API secret."` Units Unit `toml:"units" comment:"Blood sugar unit. (one of: mg/dL, mmol/L)"` DynamicIcon DynamicIcon `toml:"dynamic-icon" comment:"Makes the tray icon show the current blood sugar reading."` Arrows Arrows `toml:"arrows" comment:"Customize the arrows."` LocalFile LocalFile `toml:"local-file" comment:"Enables writing the latest blood sugar to a local temporary file."` Log Log `toml:"log" comment:"Log configuration"` Advanced Advanced `toml:"advanced" comment:"Advanced settings."` // contains filtered or unexported fields }
func (*Config) AddCallback ¶
func (*Config) RegisterFlags ¶
func (conf *Config) RegisterFlags()
func (*Config) RemoveCallback ¶
type DynamicIcon ¶
type DynamicIcon struct { Enabled bool `toml:"enabled"` FontColor colorx.Hex `toml:"font-color" comment:"Hex code used to render text."` FontFile string `toml:"font-file" comment:"Font path or filename of a system font. If left blank, an embedded font will be used."` MaxFontSize float64 `toml:"max-font-size" comment:"Maximum font size in points."` }
type LogFormat ¶
type LogFormat uint8
func LogFormatString ¶
LogFormatString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func LogFormatValues ¶
func LogFormatValues() []LogFormat
LogFormatValues returns all values of the enum
func (LogFormat) IsALogFormat ¶
IsALogFormat returns "true" if the value is listed in the enum definition. "false" otherwise
func (LogFormat) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface for LogFormat
func (*LogFormat) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface for LogFormat
type TOMLParser ¶
type TOMLParser struct{}
type Unit ¶
type Unit uint8
func UnitString ¶
UnitString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.
func (Unit) IsAUnit ¶
IsAUnit returns "true" if the value is listed in the enum definition. "false" otherwise
func (Unit) MarshalText ¶
MarshalText implements the encoding.TextMarshaler interface for Unit
func (*Unit) UnmarshalText ¶
UnmarshalText implements the encoding.TextUnmarshaler interface for Unit