jsonrpc2

package
v1.0.16 Latest Latest
Warning

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

Go to latest
Published: May 30, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultTimeout = 2 * time.Second
)

Variables

View Source
var (
	ErrInvalidParams = errors.New("invalid params")
	ErrInternalError = errors.New("internal error")
)

Functions

This section is empty.

Types

type Conn

type Conn struct {
	In  *bufio.Reader
	Out *bufio.Writer
	// contains filtered or unexported fields
}

func NewConn

func NewConn(in io.Reader, out io.Writer) *Conn

func (*Conn) Read

func (c *Conn) Read() (*protocol.Request, error)

func (*Conn) Write

func (c *Conn) Write(r protocol.Response) error

type Handler

type Handler func(context.Context, chan protocol.Response, protocol.Request) error

type Server

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

func NewServer

func NewServer(conn *Conn, initializer func(string) error, capabilities protocol.ServerCapabilities) (*Server, error)

return a server with the connection set and a function that takes the rootPath to initialize the lsp

func (*Server) Cancel

func (s *Server) Cancel(request protocol.Request)

func (*Server) HandleRequest

func (s *Server) HandleRequest(method string, handler Handler)

func (*Server) Initialize added in v1.0.13

func (s *Server) Initialize(request protocol.Request)

func (*Server) ListenAndServe

func (s *Server) ListenAndServe() error

func (*Server) Shutdown added in v1.0.13

func (s *Server) Shutdown(request protocol.Request)

Jump to

Keyboard shortcuts

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