config

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package config is responsible for setting the program config from the config file and command-line arguments

Index

Constants

View Source
const SoundOff = "off"
View Source
const Version = "v1.4.2"

Variables

This section is empty.

Functions

func DBFilePath added in v1.4.0

func DBFilePath() string

func Dir added in v1.4.0

func Dir() string

func InitializePaths added in v1.4.0

func InitializePaths()

func LogFilePath added in v1.4.1

func LogFilePath() string

func StatusFilePath added in v1.4.0

func StatusFilePath() string

Types

type Duration added in v1.4.0

type Duration map[SessType]time.Duration

Duration maps a session to time duration value.

type FilterConfig added in v1.4.0

type FilterConfig struct {
	StartTime time.Time
	EndTime   time.Time
	Tags      []string
}

FilterConfig represents a configuration to filter sessions in the database by their start time, end time, and assigned tags.

func Filter added in v1.4.0

func Filter(ctx *cli.Context) *FilterConfig

Filter initializes and returns a configuration to filter sessions from command-line arguments.

type Message added in v1.4.0

type Message map[SessType]string

Message maps a session to a message.

type SessType added in v1.4.0

type SessType string
const (
	Work       SessType = "Work session"
	ShortBreak SessType = "Short break"
	LongBreak  SessType = "Long break"
)

type TimerConfig

type TimerConfig struct {
	Duration            Duration `json:"duration"`
	Message             Message  `json:"message"`
	AmbientSound        string   `json:"sound"`
	BreakSound          string   `json:"break_sound"`
	WorkSound           string   `json:"work_sound"`
	PathToConfig        string   `json:"path_to_config"`
	PathToDB            string   `json:"path_to_db"`
	SessionCmd          string   `json:"session_cmd"`
	Tags                []string `json:"tags"`
	LongBreakInterval   int      `json:"long_break_interval"`
	Notify              bool     `json:"notify"`
	DarkTheme           bool     `json:"dark_theme"`
	TwentyFourHourClock bool     `json:"twenty_four_hour_clock"`
	PlaySoundOnBreak    bool     `json:"sound_on_break"`
	AutoStartBreak      bool     `json:"auto_start_break"`
	AutoStartWork       bool     `json:"auto_start_work"`
	Strict              bool     `json:"strict"`
}

TimerConfig represents the program configuration derived from the config file and command-line arguments.

func Timer added in v1.4.0

func Timer(ctx *cli.Context) *TimerConfig

Timer initializes and returns the timer configuration.

Jump to

Keyboard shortcuts

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