tracker

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Heartbeat

type Heartbeat struct {
	WasAnyActivity bool
	ActivityMap    map[activity.Type][]time.Time //activity type with its times
	Time           time.Time                     //heartbeat time
}

Heartbeat is the data packet sent from the tracker to the user.

WasAnyActivity tells if there was any activity within that time frame If there was, then the ActivityMap will tell you what type of activity it was and at what times it occurred.

The Time field is the time of the Heartbeat sent (not to be confused with the activity time, which is the time the activity occurred within the time frame)

type Instance

type Instance struct {
	HeartbeatInterval int //the interval at which you want the heartbeat (in seconds, default 60s)
	WorkerInterval    int //the interval at which you want the checks to happen within a heartbeat (in seconds, default 5s)
	LogLevel          string
	LogFormat         string
	// contains filtered or unexported fields
}

Instance is an instance of the tracker

func (*Instance) Quit

func (tracker *Instance) Quit()

Quit the tracker app

func (*Instance) Start

func (tracker *Instance) Start() (heartbeatCh chan *Heartbeat)

Start the tracker with all possible handlers

func (*Instance) StartWithHandlers

func (tracker *Instance) StartWithHandlers(handlers ...handler.Instance) (heartbeatCh chan *Heartbeat)

StartWithHandlers starts the tracker with a set of handlers

Jump to

Keyboard shortcuts

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