prpctest

package
v0.0.0-...-5467f26 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package prpctest is a package to facilitate pRPC testing by wrapping httptest with a pRPC Server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

type Server struct {
	prpc.Server

	// HTTP is the active HTTP test server. It will be valid when the Server is
	// running.
	HTTP *httptest.Server

	// Host is the server address ("addr:port") if it is running.
	Host string
}

Server is a pRPC test server.

func (*Server) Close

func (s *Server) Close()

Close closes the Server, releasing any retained resources.

func (*Server) NewClient

func (s *Server) NewClient() (*prpc.Client, error)

NewClient returns a prpc.Client configured to use the Server.

func (*Server) NewClientWithOptions

func (s *Server) NewClientWithOptions(opts *prpc.Options) (*prpc.Client, error)

NewClientWithOptions returns a prpc.Client configured to use the Server.

func (*Server) Start

func (s *Server) Start(ctx context.Context)

Start starts the server using the given context as the root server context.

Any currently-registered services will be installed into the pRPC Server.

Jump to

Keyboard shortcuts

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