client

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

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

Go to latest
Published: May 30, 2016 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ALPHA      = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
	CRIDLength = 20
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BinaryResponse

type BinaryResponse struct{ *http.Response }

BinaryResponse represents a non json content which cannot be inspected by gotojs like an image or other content.

func NewBinaryResponse

func NewBinaryResponse(res *http.Response) (ret *BinaryResponse)

NewBinaryResponse returns a new binary response object for a http response.

func (*BinaryResponse) Catch

func (b *BinaryResponse) Catch() (ret []byte, err error)

func (*BinaryResponse) Close

func (b *BinaryResponse) Close() error

func (*BinaryResponse) MimeType

func (b *BinaryResponse) MimeType() string

func (*BinaryResponse) Read

func (b *BinaryResponse) Read(p []byte) (n int, err error)

type Client

type Client struct {
	Client *http.Client

	Header http.Header
	// contains filtered or unexported fields
}

func NewClient

func NewClient(bu string) (ret *Client)

NewClient creates a plain gotojs client that points to a remote gotojs instance

func NewProxyClient

func NewProxyClient(c *http.Client, jar http.CookieJar, bu *url.URL, ph string, crid string) (ret *Client)

NewProxyClient creates a new gotojs client that can be used to proxy incoming requests to a remote gotojs instance from within a local gotojs instance.

func (*Client) CopyHeader

func (c *Client) CopyHeader(req *http.Request)

CopyHeader copies incoming request header to the outgoing proxy call. Some headers are excluded like the cookie header.

func (*Client) Invoke

func (c *Client) Invoke(in, mn string, args ...interface{}) (ret interface{}, err error)

Invoke a method/binding on the remote site.

Jump to

Keyboard shortcuts

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