pomodo

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2023 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package pomodo manages the pomodo timer.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Step

type Step int

Step is a step in the pomodoro technique.

const (
	// Work is a work/pomodoro session.
	Work Step = iota
	// ShortBreak is a short break in the pomodoro session.
	ShortBreak
	// LongBreak is a long break in the pomodoro session.
	LongBreak
)

func (Step) GetStartingTime

func (s Step) GetStartingTime(ctx context.Context) int

GetStartingTime returns the number of minutes for the session timer.

func (Step) String

func (s Step) String() string

type Timer

type Timer struct {
	CurrentStep Step

	Duration timeRemaining
	Ticking  bool

	Time *timeRemaining
	// contains filtered or unexported fields
}

Timer contains the state of the pomodo timer.

func New

func New(ctx context.Context) *Timer

New returns a new instance of Timer.

func (*Timer) Start

func (t *Timer) Start(ctx context.Context)

Start starts a new timer that ticks once a second.

func (*Timer) Stop

func (t *Timer) Stop()

Stop signals the currently running timer to stop.

Jump to

Keyboard shortcuts

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