Documentation
¶
Index ¶
- Constants
- func LoadConfig(fname string) *config
- type DailyCount
- type Event
- type HourlyCount
- type Recorder
- type RemoteSync
- type WatchStorage
- func (s *WatchStorage) BindRecorder(recorder *Recorder, syncDelay float64) error
- func (s *WatchStorage) CreateSchema() error
- func (s *WatchStorage) DailyCounts(days int, newDayHour int) ([]DailyCount, error)
- func (s *WatchStorage) GetLastKeyPress() (*time.Time, int64, error)
- func (s *WatchStorage) HourlyCounts(hours int, dayOffset int) ([]HourlyCount, error)
- func (s *WatchStorage) HourlyCountsForDate(date string) ([]HourlyCount, error)
- func (s *WatchStorage) KeyCountsAfterId(id int64) ([]rowTuple, error)
- func (s *WatchStorage) SchemaExists() (bool, error)
- func (s *WatchStorage) SerializeRecentKeyCounts(id int64) ([][]interface{}, error)
- func (s *WatchStorage) WeeklyHourlyGrid() (*WeeklyHeatmapResponse, error)
- func (s *WatchStorage) WriteKeys(keys int) error
- func (s *WatchStorage) YearlyCounts(year int, newDayHour int) ([]DailyCount, error)
- type WebServer
- type WeeklyHeatmapResponse
- type WeeklyHourlyCount
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 HourlyCount ¶
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) GetInputFocus ¶
func (*Recorder) GetWindowAttributes ¶
func (*Recorder) ListProperties ¶
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) GetLastKeyPress ¶
func (s *WatchStorage) GetLastKeyPress() (*time.Time, int64, error)
func (*WatchStorage) HourlyCounts ¶
func (s *WatchStorage) HourlyCounts(hours int, dayOffset int) ([]HourlyCount, error)
func (*WatchStorage) HourlyCountsForDate ¶
func (s *WatchStorage) HourlyCountsForDate(date string) ([]HourlyCount, error)
func (*WatchStorage) KeyCountsAfterId ¶
func (s *WatchStorage) KeyCountsAfterId(id int64) ([]rowTuple, error)
func (*WatchStorage) SchemaExists ¶
func (s *WatchStorage) SchemaExists() (bool, error)
func (*WatchStorage) SerializeRecentKeyCounts ¶
func (s *WatchStorage) SerializeRecentKeyCounts(id int64) ([][]interface{}, error)
func (*WatchStorage) WeeklyHourlyGrid ¶
func (s *WatchStorage) WeeklyHourlyGrid() (*WeeklyHeatmapResponse, error)
func (*WatchStorage) WriteKeys ¶
func (s *WatchStorage) WriteKeys(keys int) error
func (*WatchStorage) YearlyCounts ¶
func (s *WatchStorage) YearlyCounts(year int, newDayHour int) ([]DailyCount, error)
type WebServer ¶
type WebServer struct {
Storage *WatchStorage
Config *config
ListenAddr string
CommitHash string
BuildDate string
}
func NewWebServer ¶
func NewWebServer(storage *WatchStorage, cfg *config, addr, commitHash, buildDate string) *WebServer
type WeeklyHeatmapResponse ¶
type WeeklyHeatmapResponse struct {
StartDate string `json:"startDate"`
EndDate string `json:"endDate"`
Data []WeeklyHourlyCount `json:"data"`
}
type WeeklyHourlyCount ¶
Click to show internal directories.
Click to hide internal directories.