heartbeat

package
v1.6.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: May 19, 2021 License: BSD-3-Clause Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(v *viper.Viper)

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
	Hostname          string
	IsWrite           *bool
	Language          *string
	LanguageAlternate string
	LineNumber        *int
	LinesInFile       *int
	LocalFile         string
	OfflineDisabled   bool
	OfflineSyncMax    int
	Time              float64
	API               legacyparams.APIParams
	Filter            FilterParams
	Network           legacyparams.NetworkParams
	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