luci: go.chromium.org/luci/common/testing/prpctest Index | Files

package prpctest

import "go.chromium.org/luci/common/testing/prpctest"

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

Index

Package Files

server.go

type Server Uses

type Server struct {
    prpc.Server

    // Base returns a middleware chain. It is handed the Context passed to
    // Start. If Base is nil, setContext will be used.
    Base func(context.Context) router.MiddlewareChain

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

Server is a pRPC test server.

func (*Server) Close Uses

func (s *Server) Close()

Close closes the Server, releasing any retained resources.

func (*Server) NewClient Uses

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

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

func (*Server) Start Uses

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

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

Package prpctest imports 7 packages (graph). Updated 2018-08-21. Refresh now. Tools for package owners.