client

package
v2.3.8+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2021 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HTTPClient

type HTTPClient struct {
	BaseURL      string
	BaseQueryURL string
	Username     string
	Password     string
	Client       *http.Client
	Hostname     string
	Port         int
	QueryPort    int
}

HTTPClient represents a single connection to an Elasticsearch host

func CreateClient

func CreateClient(args *arguments.ArgumentList, hostnameOverride string) (*HTTPClient, error)

CreateClient creates a new http client for Couchbase. The hostnameOverride parameter specifies a hostname that the client should connect to. Passing in an empty string causes the client to use the hostname specified in the command-line args. (default behavior)

func (*HTTPClient) Request

func (c *HTTPClient) Request(endpoint string, model interface{}) error

Request attempts to make a request to the Couchbase API, storing the result in the given model if successful. Returns an error if the request cannot be completed or a non-200 status code is returned.

Jump to

Keyboard shortcuts

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