timer

package
v0.9.32 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package timer countdown duration

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ITimer added in v0.9.31

type ITimer struct {
	// contains filtered or unexported fields
}

ITimer implements Timer interface.

func NewTimer

func NewTimer(config *config.Config, c screen.Client) *ITimer

NewTimer initilize Timer.

func (*ITimer) GetRemainSec added in v0.9.31

func (t *ITimer) GetRemainSec() int

GetRemainSec get remaining seconds of timer.

func (*ITimer) GetTitle added in v0.9.31

func (t *ITimer) GetTitle() string

GetTitle gets title.

func (*ITimer) Run added in v0.9.31

func (t *ITimer) Run(ctx context.Context) (int, error)

Run timer.

func (*ITimer) SetDuration added in v0.9.31

func (t *ITimer) SetDuration(d int)

SetDuration sets remaining seconds.

func (*ITimer) SetFontColor added in v0.9.31

func (t *ITimer) SetFontColor(c tcell.Color)

SetFontColor sets cell color.

func (*ITimer) SetTitle added in v0.9.31

func (t *ITimer) SetTitle(title string)

SetTitle sets title.

func (*ITimer) Start added in v0.9.31

func (t *ITimer) Start()

Start timer.

func (*ITimer) Stop added in v0.9.31

func (t *ITimer) Stop()

Stop timer.

func (*ITimer) Toggle added in v0.9.31

func (t *ITimer) Toggle()

Toggle timer between stop and start.

type Timer

type Timer interface {
	Run(context.Context) (int, error)
	Stop()
	SetTitle(string)
	GetTitle() string
	GetRemainSec() int
	SetDuration(sec int)
	SetFontColor(tcell.Color)
}

Timer interface.

Jump to

Keyboard shortcuts

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