rpcwrap

package
v2.0.0-alpha2+incompat... Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2015 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Overview

Package rpcwrap provides wrappers for rpcplus package

Index

Constants

This section is empty.

Variables

View Source
var AuthenticatedServer = rpc.NewServer()

AuthenticatedServer is an rpc.Server instance that serves authenticated calls.

Functions

func DialAuthHTTP

func DialAuthHTTP(network, address, user, password, codecName string, cFactory ClientCodecFactory, connectTimeout time.Duration) (conn *rpc.Client, err error)

DialAuthHTTP connects to an authenticated go HTTP RPC server using the specified codec and credentials. use 0 as connectTimeout for no timeout

func DialHTTP

func DialHTTP(network, address, codecName string, cFactory ClientCodecFactory, connectTimeout time.Duration) (*rpc.Client, error)

DialHTTP connects to a go HTTP RPC server using the specified codec. use 0 as connectTimeout for no timeout

func GetRpcPath

func GetRpcPath(codecName string, auth bool) string

GetRpcPath returns the toplevel path used for serving RPCs over HTTP

func ServeAuthRPC

func ServeAuthRPC(codecName string, cFactory ServerCodecFactory)

ServeAuthRPC handles authenticated rpc requests using the hijack scheme of rpc

func ServeCustomRPC

func ServeCustomRPC(handler *http.ServeMux, server *rpc.Server, useAuth bool, codecName string, cFactory ServerCodecFactory)

ServeCustomRPC serves the given rpc requests with the provided ServeMux, authenticated or not

func ServeHTTPRPC

func ServeHTTPRPC(
	handler *http.ServeMux,
	server *rpc.Server,
	codecName string,
	cFactory ServerCodecFactory,
	contextCreator func(*http.Request) context.Context)

ServeHTTPRPC serves the given http rpc requests with the provided ServeMux, does not support built-in authentication

func ServeRPC

func ServeRPC(codecName string, cFactory ServerCodecFactory)

ServeRPC handles rpc requests using the hijack scheme of rpc

Types

type BufferedConnection

type BufferedConnection struct {
	*bufio.Reader
	io.WriteCloser
	// contains filtered or unexported fields
}

BufferedConnection holds connection data for codecs

func NewBufferedConnection

func NewBufferedConnection(conn io.ReadWriteCloser) *BufferedConnection

NewBufferedConnection creates a new Buffered Connection

func (*BufferedConnection) Close

func (bc *BufferedConnection) Close() error

Close closes the buffered connection FIXME(sougou/szopa): Find a better way to track connection count.

type ClientCodecFactory

type ClientCodecFactory func(conn io.ReadWriteCloser) rpc.ClientCodec

ClientCodecFactory holds pattern for other client codec factories

type ServerCodecFactory

type ServerCodecFactory func(conn io.ReadWriteCloser) rpc.ServerCodec

ServerCodecFactory holds pattern for other server codec factories

Directories

Path Synopsis
Package auth provides authentication codecs
Package auth provides authentication codecs
Package bsonrpc provides codecs for bsonrpc communication
Package bsonrpc provides codecs for bsonrpc communication
Package jsonrpc provides wrappers for json rpc communication
Package jsonrpc provides wrappers for json rpc communication
Package proto provides protocol functions
Package proto provides protocol functions

Jump to

Keyboard shortcuts

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