server

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2020 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package server implements a new Nvim server with low-level nvim rpc-connecting.

Index

Constants

This section is empty.

Variables

View Source
var DefaultDialer = func(ctx context.Context, network, address string) (net.Conn, error) {
	return (&net.Dialer{
		Timeout:   30 * time.Second,
		KeepAlive: 30 * time.Second,
		DualStack: true,
	}).DialContext(ctx, network, address)
}
View Source
var DefaultLogFunc = func(ctx context.Context) func(string, ...interface{}) {
	return func(format string, a ...interface{}) {
		logger.FromContext(ctx).Info(fmt.Sprintf(format, a))
	}
}

Functions

func Dial

func Dial(ctx context.Context) (n *nvim.Nvim, err error)

Types

type EventMap added in v0.2.0

type EventMap map[string]func(...interface{})

type Server

type Server struct {
	Nvim *nvim.Nvim
}

func NewServer

func NewServer(ctx context.Context) (*Server, error)

func (*Server) Close

func (s *Server) Close() error

func (*Server) Serve

func (s *Server) Serve() error

type Subscribe added in v0.2.0

type Subscribe struct {
	Server   *Server
	EventMap EventMap
}

func NewSubscriber added in v0.2.0

func NewSubscriber(ctx context.Context, eventmap EventMap) (*Subscribe, error)

Jump to

Keyboard shortcuts

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