config

package
v0.0.0-...-5a4b634 Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PomoDir    = "~/.pomo"
	PomoConfig = "config.toml"
	Template   = "config.template.toml"
)

Variables

View Source
var DefaultPath = fmt.Sprintf("%s/%s", PomoDir, PomoConfig)

Functions

func ExpandPath

func ExpandPath(path string) (string, error)

func NewCmd

func NewCmd(version string, c *Config) *cobra.Command

func Update

func Update(key, value string, config *Config) error

Types

type Config

type Config struct {
	Database Database    `toml:"database"`
	Timers   TimerConfig `toml:"timers"`
}

func Parse

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

type Database

type Database struct {
	Task    string `toml:"task"`
	Session string `toml:"session"`
}

type TimerConfig

type TimerConfig struct {
	Focus    string `toml:"focus"`
	Short    string `toml:"short"`
	Long     string `toml:"long"`
	Interval int    `toml:"interval"`
}

func (*TimerConfig) FocusDuration

func (tc *TimerConfig) FocusDuration() time.Duration

func (*TimerConfig) LongBreakDuration

func (tc *TimerConfig) LongBreakDuration() time.Duration

func (*TimerConfig) ShortBreakDuration

func (tc *TimerConfig) ShortBreakDuration() time.Duration

Jump to

Keyboard shortcuts

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