config

package
v0.9.10 Latest Latest
Warning

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

Go to latest
Published: May 16, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package config gomodoro configuration

Index

Constants

View Source
const (
	// DefaultWorkSec default working second
	DefaultWorkSec = 1500
	// DefaultShortBreakSec default short break second
	DefaultShortBreakSec = 300
	// DefaultLongBreakSec default long break second
	DefaultLongBreakSec = 900

	// DefaultLogFile default log file path
	DefaultLogFile = "~/.gomodoro/gomodoro.log"
	// DefaultTaskFile default task file path
	DefaultTaskFile = "~/.gomodoro/tasks.yaml"
	// DefaultUnixDomainScoketPath default unix domain socket file path
	DefaultUnixDomainScoketPath = "~/.gomodoro/gomodoro.sock"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Pomodoro             PomodoroConfig `mapstructure:"pomodoro"`
	Toggl                TogglConfig    `mapstructure:"toggl"`
	LogFile              string         `mapstructure:"log_file"`
	TaskFile             string         `mapstructure:"task_file"`
	UnixDomainScoketPath string         `mapstructure:"unix_domain_socket_path"`
}

Config config for gomodoro

func GetConfig added in v0.9.1

func GetConfig() (*Config, error)

GetConfig get Config

func (*Config) ExpandLogFile added in v0.9.4

func (c *Config) ExpandLogFile() (string, error)

ExpandLogFile get expand log file

func (*Config) ExpandTaskFile added in v0.9.4

func (c *Config) ExpandTaskFile() (string, error)

ExpandTaskFile get expand task file

func (*Config) ExpandUnixDomainSocketPath added in v0.9.4

func (c *Config) ExpandUnixDomainSocketPath() (string, error)

ExpandUnixDomainSocketPath get expand UnixDomainScoketPath

type PomodoroConfig added in v0.9.1

type PomodoroConfig struct {
	WorkSec       int `mapstructure:"work_sec" validate:"gt=0,lte=3600"`
	ShortBreakSec int `mapstructure:"short_break_sec" validate:"gt=0,lte=3600"`
	LongBreakSec  int `mapstructure:"long_break_sec" validate:"gt=0,lte=3600"`
}

PomodoroConfig config for pomodoro

type TogglConfig added in v0.9.1

type TogglConfig struct {
	APIToken  string `mapstructure:"api_token"`
	ProjectID int    `mapstructure:"project_id"`
}

TogglConfig config for Toggl

func (TogglConfig) Enable added in v0.9.1

func (tc TogglConfig) Enable() bool

Enable confirm toggl client is enable

Jump to

Keyboard shortcuts

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