socket

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2026 License: 0BSD Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActivityData

type ActivityData struct {
	Project          string  `json:"project"`
	GitRemote        string  `json:"git_remote"`
	StartedAt        string  `json:"started_at"`
	EndedAt          string  `json:"ended_at"`
	Filename         string  `json:"filename"`
	Filetype         string  `json:"filetype"`
	LinesAdded       int     `json:"lines_added"`
	LinesRemoved     int     `json:"lines_removed"`
	GitBranch        string  `json:"git_branch"`
	ActionsPerMinute float64 `json:"actions_per_minute"`
	WordsPerMinute   float64 `json:"words_per_minute"`
	Editor           string  `json:"editor"`
}

type Request

type Request struct {
	Type string          `json:"type"`
	Data json.RawMessage `json:"data"`
}

type Response

type Response struct {
	OK       bool   `json:"ok"`
	Error    string `json:"error,omitempty"`
	Message  string `json:"message,omitempty"`
	Total    *int64 `json:"total,omitempty"`
	Unsynced *int64 `json:"unsynced,omitempty"`
}

type Server

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

func NewServer

func NewServer(path string, database *db.DB, machine string) *Server

func (*Server) SetSyncFunc

func (s *Server) SetSyncFunc(fn SyncFunc)

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop()

type SyncFunc

type SyncFunc func() error

Jump to

Keyboard shortcuts

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