heartbeat

package
v1.98.5-alpha.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2024 License: BSD-3-Clause Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadParams

func LoadParams(v *viper.Viper) (paramscmd.Params, error)

LoadParams loads params from viper.Viper instance. Returns ErrAuth if failed to retrieve api key.

func RateLimited added in v1.98.1

func RateLimited(params RateLimitParams) bool

RateLimited determines if we should send heartbeats to the API or save to the offline db.

func ResetRateLimit added in v1.98.1

func ResetRateLimit(v *viper.Viper) error

ResetRateLimit updates the internal.heartbeats_last_sent_at timestamp.

func Run

func Run(v *viper.Viper) (int, error)

Run executes the heartbeat command.

func SendHeartbeats

func SendHeartbeats(v *viper.Viper, queueFilepath string) error

SendHeartbeats sends a heartbeat to the wakatime api and includes additional heartbeats from the offline queue, if available and offline sync is not explicitly disabled.

Types

type RateLimitParams added in v1.98.1

type RateLimitParams struct {
	Disabled   bool
	LastSentAt time.Time
	Timeout    time.Duration
}

RateLimitParams contains params for the RateLimited function.

Jump to

Keyboard shortcuts

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