speedo

package module
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2022 License: MIT Imports: 8 Imported by: 1

README

# speedo

Speedo can be used to detect the speed of the cycle.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Accumulation uint8 = 0
	Variation    uint8 = 1
	Progress     uint8 = 2
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Name             string
	Log              bool
	Server           string
	PostIntervalSEC  int64
	PrintIntervalSEC int64
}

type PostData added in v0.4.0

type PostData struct {
	Name      string    `json:"name" gorm:"index"`
	SID       string    `json:"sid" gorm:"primaryKey"`
	Value     int64     `json:"Value"`
	CreatedAt time.Time `json:"created_at"`
}

type PostInfo added in v0.4.0

type PostInfo struct {
	ID              uint64    `json:"-" gorm:"primaryKey"`
	SID             string    `json:"sid" form:"sid" gorm:"uniqueIndex"`
	Name            string    `json:"name" form:"name" gorm:"index"`
	Type            uint8     `json:"type"`
	CreatedAt       time.Time `json:"created_at"`
	UpdatedAt       time.Time `json:"updated_at"`
	PostIntervalSEC int64     `json:"post_interval_sec" form:"post_interval_sec"`
	Value           int64     `json:"value" form:"value"`
	Total           uint64    `json:"total" form:"total"`
}

type SpeedStat

type SpeedStat struct {
	Value int64  `json:"value"`
	Speed int64  `json:"speed"`
	Total uint64 `json:"total"`
}

type Speedometer

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

func NewProgressSpeedometer added in v0.3.0

func NewProgressSpeedometer(total uint64, config Config) *Speedometer

func NewSpeedometer

func NewSpeedometer(config Config) *Speedometer

func NewVariationSpeedometer added in v0.3.0

func NewVariationSpeedometer(config Config) *Speedometer

func (*Speedometer) AddValue added in v0.4.0

func (s *Speedometer) AddValue(n int64)

func (*Speedometer) GetStat

func (s *Speedometer) GetStat() SpeedStat

func (*Speedometer) GetStatusString

func (s *Speedometer) GetStatusString() string

func (*Speedometer) SetTotal added in v0.3.0

func (s *Speedometer) SetTotal(n uint64)

func (*Speedometer) SetValue added in v0.2.0

func (s *Speedometer) SetValue(n int64)

func (*Speedometer) Stop

func (s *Speedometer) Stop()

Jump to

Keyboard shortcuts

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