meta

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EXPECTED_NUM_FIELDS = 10
	LOWER_BEFORE_SHIFT  = (math.MaxUint64 / 10) + 1
	REX_FLOAT           = "^\\s*\\d*\\.?\\d*\\s*$"
	TIME_DAY            = 24 * time.Hour
)

* Global constants.

Variables

This section is empty.

Functions

This section is empty.

Types

type Activities

type Activities interface {
	Add(info *ActivityInfo) error
	End(id uint32) (time.Time, error)
	Export() ([]byte, error)
	ExportCSV() (io.ReadSeeker, error)
	Get(id uint32) (ActivityGroup, error)
	Import(buf []byte) error
	ImportCSV(data string) error
	Length() uint32
	Remove(id uint32) error
	Replace(id uint32, info *ActivityInfo) error
	Revision() uint64
	Statistics() ActivityStatistics
}

* All activities about which information can be stored.

func CreateActivities

func CreateActivities() Activities

* Create data structure storing activities.

type ActivityGroup

type ActivityGroup interface {
	Begin() time.Time
	Cycling() CyclingActivity
	Other() OtherActivity
	Running() RunningActivity
	WeightKG() string
}

* An activity group is a set of activities carried out within a specific time * interval, typically a day.

type ActivityInfo

type ActivityInfo struct {
	Begin             time.Time
	WeightKG          string
	RunningDuration   time.Duration
	RunningDistanceKM string
	RunningStepCount  uint64
	RunningEnergyKJ   uint64
	CyclingDuration   time.Duration
	CyclingDistanceKM string
	CyclingEnergyKJ   uint64
	OtherEnergyKJ     uint64
}

* Data structure to obtain information about activities from external caller. * * This is used to reduce the number of parameters passed to the method * Activities.Add(...).

type ActivityStatistics

type ActivityStatistics interface {
	Cycling() CyclingActivity
	Other() OtherActivity
	Running() RunningActivity
}

* Activity stats carry cumulative statistics about activities.

type CyclingActivity

type CyclingActivity interface {
	DistanceKM() string
	Duration() time.Duration
	EnergyKJ() uint64
	Zero() bool
}

* The activity of cycling.

type OtherActivity

type OtherActivity interface {
	EnergyKJ() uint64
	Zero() bool
}

* Activities other than running and cycling.

type RunningActivity

type RunningActivity interface {
	DistanceKM() string
	Duration() time.Duration
	EnergyKJ() uint64
	StepCount() uint64
	Zero() bool
}

* The activity of running.

Jump to

Keyboard shortcuts

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