client

package
v0.0.0-...-8bc2473 Latest Latest
Warning

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

Go to latest
Published: Apr 26, 2015 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Call

func Call(request Request, response interface{}) error

func CallRemote

func CallRemote(address, path string, request Request, response interface{}) error

Types

type Client

type Client interface {
	NewRequest(string, string, interface{}) Request
	NewProtoRequest(string, string, interface{}) Request
	NewJsonRequest(string, string, interface{}) Request
	Call(interface{}, interface{}) error
	CallRemote(string, string, interface{}, interface{}) error
}

type Headers

type Headers interface {
	Add(string, string)
	Del(string)
	Get(string) string
	Set(string, string)
}

type Request

type Request interface {
	Service() string
	Method() string
	ContentType() string
	Request() interface{}
	Headers() Headers
}

func NewJsonRequest

func NewJsonRequest(service, method string, request interface{}) Request

func NewProtoRequest

func NewProtoRequest(service, method string, request interface{}) Request

func NewRequest

func NewRequest(service, method string, request interface{}) Request

type RpcClient

type RpcClient struct{}

func NewRpcClient

func NewRpcClient() *RpcClient

func (*RpcClient) Call

func (r *RpcClient) Call(request Request, response interface{}) error

TODO: Call(..., opts *Options) error {

func (*RpcClient) CallRemote

func (r *RpcClient) CallRemote(address, path string, request Request, response interface{}) error

func (*RpcClient) NewJsonRequest

func (r *RpcClient) NewJsonRequest(service, method string, request interface{}) *RpcRequest

func (*RpcClient) NewProtoRequest

func (r *RpcClient) NewProtoRequest(service, method string, request interface{}) *RpcRequest

func (*RpcClient) NewRequest

func (r *RpcClient) NewRequest(service, method string, request interface{}) *RpcRequest

type RpcRequest

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

func NewRpcRequest

func NewRpcRequest(service, method string, request interface{}, contentType string) *RpcRequest

func (*RpcRequest) ContentType

func (r *RpcRequest) ContentType() string

func (*RpcRequest) Headers

func (r *RpcRequest) Headers() Headers

func (*RpcRequest) Method

func (r *RpcRequest) Method() string

func (*RpcRequest) Request

func (r *RpcRequest) Request() interface{}

func (*RpcRequest) Service

func (r *RpcRequest) Service() string

Jump to

Keyboard shortcuts

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