Movatterモバイル変換


[0]ホーム

URL:


servertest

package
v0.37.0Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2025 License:BSD-3-ClauseImports:6Imported by:0

Details

Repository

cs.opensource.google/go/x/tools

Links

Documentation

Overview

Package servertest provides utilities for running tests against a remote LSPserver.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

typeConnector

type Connector interface {Connect(context.Context)jsonrpc2.Conn}

Connector is the interface used to connect to a server.

typePipeServer

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

PipeServer is a test server that handles connections over io.Pipes.

funcNewPipeServer

func NewPipeServer(serverjsonrpc2.StreamServer, framerjsonrpc2.Framer) *PipeServer

NewPipeServer returns a test server that can be connected to via io.Pipes.

func (PipeServer)Close

func (l PipeServer) Close()error

func (*PipeServer)Connect

func (s *PipeServer) Connect(ctxcontext.Context)jsonrpc2.Conn

Connect creates new io.Pipes and binds them to the underlying StreamServer.

typeTCPServer

type TCPServer struct {Addrstring// contains filtered or unexported fields}

TCPServer is a helper for executing tests against a remote jsonrpc2connection. Once initialized, its Addr field may be used to connect ajsonrpc2 client.

funcNewTCPServer

func NewTCPServer(ctxcontext.Context, serverjsonrpc2.StreamServer, framerjsonrpc2.Framer) *TCPServer

NewTCPServer returns a new test server listening on local tcp port andserving incoming jsonrpc2 streams using the provided stream server. Itpanics on any error.

func (TCPServer)Close

func (l TCPServer) Close()error

func (*TCPServer)Connect

Connect dials the test server and returns a jsonrpc2 Connection that isready for use.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp