heartbeat

package
v1.26.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: BSD-3-Clause Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 FilterParams

type FilterParams struct {
	Exclude                    []regex.Regex
	ExcludeUnknownProject      bool
	Include                    []regex.Regex
	IncludeOnlyWithProjectFile bool
}

FilterParams contains heartbeat filtering related command parameters.

func (FilterParams) String

func (p FilterParams) String() string

type Params

type Params struct {
	Category          heartbeat.Category
	CursorPosition    *int
	Entity            string
	EntityType        heartbeat.EntityType
	ExtraHeartbeats   []heartbeat.Heartbeat
	IsWrite           *bool
	Language          *string
	LanguageAlternate string
	LineNumber        *int
	LinesInFile       *int
	LocalFile         string
	OfflineDisabled   bool
	OfflineQueueFile  string
	OfflineSyncMax    int
	Time              float64
	API               legacyparams.API
	Filter            FilterParams
	Project           ProjectParams
	Sanitize          SanitizeParams
}

Params contains heartbeat command parameters.

func LoadParams

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

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

func (Params) String

func (p Params) String() string

type ProjectParams

type ProjectParams struct {
	Alternate        string
	DisableSubmodule []regex.Regex
	MapPatterns      []project.MapPattern
	Override         string
}

ProjectParams params for project name sanitization.

func (ProjectParams) String

func (p ProjectParams) String() string

type SanitizeParams

type SanitizeParams struct {
	HideBranchNames  []regex.Regex
	HideFileNames    []regex.Regex
	HideProjectNames []regex.Regex
}

SanitizeParams params for heartbeat sanitization.

func (SanitizeParams) String

func (p SanitizeParams) String() string

Jump to

Keyboard shortcuts

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