offline

package
v1.1.0-alpha.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func QueueFilepath

func QueueFilepath() (string, error)

QueueFilepath returns the path for offline queue db file.

func WithQueue

func WithQueue(filepath string, syncLimit int) (heartbeat.HandleOption, error)

WithQueue initializes and returns a heartbeat handle option, which can be used in a heartbeat processing pipeline for automatic handling of failures of heartbeat sending to the API. Upon inability to send due to missing or failing connection to API, failed sending or errors returned by API, the heartbeats will be temporarily stored in a DB and sending will be retried at next usages of the wakatime cli.

Types

type Queue

type Queue struct {
	Bucket string
	// contains filtered or unexported fields
}

Queue is a db client to temporarily store heartbeats in bolt db, in case heartbeat sending to wakatime api is not possible. Transaction handling is left to the user via the passed in transaction.

func NewQueue

func NewQueue(tx *bolt.Tx) (*Queue, error)

NewQueue creates a new instance of Queue.

func (*Queue) PopMany

func (q *Queue) PopMany(limit int) ([]heartbeat.Heartbeat, error)

PopMany retrieves heartbeats with the specified ids from db.

func (*Queue) PushMany

func (q *Queue) PushMany(hh []heartbeat.Heartbeat) error

PushMany stores the provided heartbeats in the db.

Jump to

Keyboard shortcuts

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