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 ¶
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.