Documentation ¶
Index ¶
- Constants
- type FileReader
- type Option
- type Proxy
- type Server
- func (s *Server) EndSession(event pulse.Event, reply *string)
- func (s *Server) FocusGained(event pulse.Event, reply *string)
- func (s *Server) OpenFile(event pulse.Event, reply *string)
- func (s *Server) RunBackgroundJobs(ctx context.Context, segmentationInterval time.Duration)
- func (s *Server) SendHeartbeat(event pulse.Event, reply *string)
- func (s *Server) StartServer(ctx context.Context, port string) error
- type SessionWriter
Constants ¶
const (
HeartbeatTTL = time.Minute * 10
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileReader ¶
FileReader is a simple abstraction that defines a function for getting metadata from a file within a git repository.
type Option ¶
type Option func(*Server)
type Proxy ¶
type Proxy struct {
// contains filtered or unexported fields
}
Proxy serves as the intermediary between our client and server. It directs remote procedure calls to the server, mitigating the risk of unintentionally revealing server methods, just because they happen to conform to the RPC interface.
func (*Proxy) EndSession ¶
EndSession should be called when the neovim process ends.
func (*Proxy) FocusGained ¶
FocusGained should be called when a buffer gains focus.
func (*Proxy) OpenFile ¶
OpenFile should be called when a buffer is opened. The server will check if the path is a valid file.
func (*Proxy) SendHeartbeat ¶
SendHeartbeat can be called for events such as buffer writes and cursor moves. Its purpose is to notify the server that the current session remains active. If we don't perform any actions for 10 minutes the server is going to end the session.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func New ¶
func New(cfg *pulse.Config, segmentPath string, sessionWriter SessionWriter, opts ...Option) *Server
New creates a new server.
func (*Server) EndSession ¶
EndSession should be called by the *VimLeave* autocommand.
func (*Server) FocusGained ¶
FocusGained is invoked by the FocusGained autocommand.
func (*Server) RunBackgroundJobs ¶
RunBackgroundJobs starts the heartbeat, aggregation, and segmentation jobs.
func (*Server) SendHeartbeat ¶
SendHeartbeat can be called for events such as buffer writes and cursor moves. Its purpose is to notify the server that the current session remains active. The server ends the session if it doesn't receive a heartbeat for 10 minutes.
type SessionWriter ¶
type SessionWriter interface {
Write(context.Context, pulse.CodingSession) error
}