offload

package
v2.1.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2013 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ListenAndServeOffloadService

func ListenAndServeOffloadService(addr string, backend OffloadService) error

ListenAndServeOffloadService serves the given OffloadService backend implementation on all connections accepted as a result of listening on addr (TCP).

func RegisterOffloadServiceWeb

func RegisterOffloadServiceWeb(this OffloadServiceWeb, mux webrpc.ServeMux) error

Register a OffloadServiceWeb implementation with the given webrpc ServeMux. If mux is nil, the default webrpc.ServeMux is used.

func ServeOffloadService

func ServeOffloadService(conn net.Conn, backend OffloadService) error

ServeOffloadService serves the given OffloadService backend implementation on conn.

Types

type DataSet

type DataSet struct {
	Data             *string `protobuf:"bytes,1,opt,name=data" json:"data,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (*DataSet) GetData

func (this *DataSet) GetData() string

func (*DataSet) ProtoMessage

func (*DataSet) ProtoMessage()

func (*DataSet) Reset

func (this *DataSet) Reset()

func (*DataSet) String

func (this *DataSet) String() string

type OffloadService

type OffloadService interface {
	Compute(in *DataSet, out *ResultSet) error
}

OffloadService is an interface satisfied by the generated client and which must be implemented by the object wrapped by the server.

func DialOffloadService

func DialOffloadService(addr string) (OffloadService, error)

DialOffloadService returns a OffloadService for calling the OffloadService servince at addr (TCP).

func NewOffloadServiceClient

func NewOffloadServiceClient(conn net.Conn) OffloadService

NewOffloadServiceClient returns an *rpc.Client wrapper for calling the methods of OffloadService remotely.

func NewOffloadServiceWebClient

func NewOffloadServiceWebClient(pro webrpc.Protocol, remote *url.URL) OffloadService

NewOffloadServiceWebClient returns a webrpc wrapper for calling the methods of OffloadService remotely via the web. The remote URL is the base URL of the webrpc server.

type OffloadServiceWeb

type OffloadServiceWeb interface {
	Compute(r *http.Request, in *DataSet, out *ResultSet) error
}

OffloadServiceWeb is the web-based RPC version of the interface which must be implemented by the object wrapped by the webrpc server.

type ResultSet

type ResultSet struct {
	Result           *string `protobuf:"bytes,1,opt,name=result" json:"result,omitempty"`
	XXX_unrecognized []byte  `json:"-"`
}

func (*ResultSet) GetResult

func (this *ResultSet) GetResult() string

func (*ResultSet) ProtoMessage

func (*ResultSet) ProtoMessage()

func (*ResultSet) Reset

func (this *ResultSet) Reset()

func (*ResultSet) String

func (this *ResultSet) String() string

Jump to

Keyboard shortcuts

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