client

package
v0.0.0-...-dde899a Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2016 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Client  *http.Client
	BaseURL *url.URL
}

func New

func New(u string) (*Client, error)

func (*Client) Do

func (wd *Client) Do(req *http.Request, v interface{}) error

func (*Client) NewRequest

func (c *Client) NewRequest(method, urlStr string, body interface{}) (*http.Request, error)

type Error

type Error struct {
	FailedShards []struct {
		Index  string `json:"index"`
		Node   string `json:"node"`
		Reason struct {
			Reason string `json:"reason"`
			Type   string `json:"type"`
		} `json:"reason"`
		Shard int64 `json:"shard"`
	} `json:"failed_shards"`
	Grouped   bool   `json:"grouped"`
	Phase     string `json:"phase"`
	Reason    string `json:"reason"`
	RootCause []struct {
		Reason string `json:"reason"`
		Type   string `json:"type"`
	} `json:"root_cause"`
	Type string `json:"type"`
}

func (Error) Error

func (e Error) Error() string

type Response

type Response struct {
	Error  *Error `json:"error"`
	Status int64  `json:"status"`
}

Jump to

Keyboard shortcuts

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