selfwatch

package
v0.0.0-...-0357043 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultConfigFname = "~/.selfwatch/config.json"

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(fname string) *config

Types

type DailyCount

type DailyCount struct {
	Day   string
	Count int64
}

type Event

type Event struct {
	Code   int32
	Window int64
}

type Recorder

type Recorder struct {
	KeyPress      func(Event)
	KeyRelease    func(Event)
	ButtonPress   func(Event)
	ButtonRelease func(Event)
	// contains filtered or unexported fields
}

func NewRecorder

func NewRecorder() *Recorder

func (*Recorder) Bind

func (recorder *Recorder) Bind() error

func (*Recorder) GetInputFocus

func (r *Recorder) GetInputFocus() C.Window

func (*Recorder) GetWindowAttributes

func (r *Recorder) GetWindowAttributes(window C.Window)

func (*Recorder) ListProperties

func (r *Recorder) ListProperties(window C.Window)

type RemoteSync

type RemoteSync struct {
	Url     string
	Storage *WatchStorage
}

func (*RemoteSync) FlushEvery

func (r *RemoteSync) FlushEvery(seconds float64) chan bool

func (*RemoteSync) FlushKeys

func (s *RemoteSync) FlushKeys() error

func (*RemoteSync) GetLastRowId

func (s *RemoteSync) GetLastRowId() (int64, error)

func (*RemoteSync) SendRows

func (s *RemoteSync) SendRows(rows [][]interface{}) error

type WatchStorage

type WatchStorage struct {
	// contains filtered or unexported fields
}

func NewWatchStorage

func NewWatchStorage(fname string) (*WatchStorage, error)

func (*WatchStorage) BindRecorder

func (s *WatchStorage) BindRecorder(recorder *Recorder, syncDelay float64) error

func (*WatchStorage) CreateSchema

func (s *WatchStorage) CreateSchema() error

func (*WatchStorage) DailyCounts

func (s *WatchStorage) DailyCounts(days int, newDayHour int) ([]DailyCount, error)

func (*WatchStorage) KeyCountsAfterId

func (s *WatchStorage) KeyCountsAfterId(id int64) ([]rowTuple, error)

func (*WatchStorage) SchemaExists

func (s *WatchStorage) SchemaExists() bool

func (*WatchStorage) SerializeRecentKeyCounts

func (s *WatchStorage) SerializeRecentKeyCounts(id int64) ([][]interface{}, error)

func (*WatchStorage) WriteKeys

func (s *WatchStorage) WriteKeys(keys int) error

Jump to

Keyboard shortcuts

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