entry

package
v0.0.2-0...-9a6aa9e Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Elapsed

type Elapsed interface {
	Value() int64
	Add(elapsed Elapsed)
}

func NewElapsed

func NewElapsed(value int64) (Elapsed, error)

type Entry

type Entry interface {
	// props
	ID() ID
	Name() Name
	StartedAt() StartedAt
	Elapsed() Elapsed
	// behaviors
	IncrementElapsed(elapsed Elapsed)
}

func NewEntry

func NewEntry(name Name, startedAt StartedAt) Entry

func NewEntryWithValues

func NewEntryWithValues(id ID, name Name, startedAt StartedAt, elapsed Elapsed) Entry

type ID

type ID interface {
	Value() string
}

func NewID

func NewID() ID

func NewIDFromString

func NewIDFromString(uuidStr string) (ID, error)

type Name

type Name interface {
	Value() string
}

func NewName

func NewName(name string) (Name, error)

type Repository

type Repository interface {
	Add(e Entry)
	GetLatest() (Entry, error)
	GetAll() ([]Entry, error)
	Update(e Entry)
}

type StartedAt

type StartedAt interface {
	Value() int64
}

func NewStartedAt

func NewStartedAt(value int64) (StartedAt, error)

Jump to

Keyboard shortcuts

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