rpcserver

package
v0.0.0-...-9cb8426 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2024 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Authenticator

type Authenticator interface {
	Authenticate(ctx context.Context, credentials, verifier *rpcv2.OpaqueAuth) (context.Context, rpcv2.OpaqueAuth, rpcv2.AuthStat)
}

Authenticator of requests against an RPC server.

var AllowAuthenticator Authenticator = allowAuthenticator{}

AllowAuthenticator is an implementation of Authenticator that permits the execution of all requests, regardless of the credentials and verifier they provide.

type Server

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

Server of ONC RPCv2, as described in RFC 5531.

func NewServer

func NewServer(services map[uint32]Service, authenticator Authenticator) *Server

NewServer creates a new Server that is capable of accepting incoming requests for a provided set of services.

func (*Server) HandleConnection

func (s *Server) HandleConnection(r io.Reader, w io.Writer) error

HandleConnection reads requests from a streaming network connection and provides them to one or more services, based on the program number in the request. After the service has processed the request asynchronously, a response is written back to the network connection.

type Service

type Service func(ctx context.Context, vers, proc uint32, parameters io.ReadCloser, returnValue io.Writer) (rpcv2.AcceptedReplyData, error)

Service that is capable of processing incoming requests on the RPC server.

The service is responsible for reading parameters from a ReadCloser. It should close it immediately after it has finished reading the parameters, so that the RPC server can continue to read the next incoming request.

Jump to

Keyboard shortcuts

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