Movatterモバイル変換


[0]ホーム

URL:


Notice  The highest tagged major version isv9.

estransport

package
v0.0.0Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2019 License:Apache-2.0Imports:7Imported by:0

Details

Repository

github.com/elastic/go-elasticsearch

Links

Documentation

Overview

Package estransport provides the transport layer for the Elasticsearch client.

It is automatically included in the client provided by the github.com/elastic/go-elasticsearch packageand is not intended for direct use: to configure the client, use the elasticsearch.Config struct.

At the moment, the implementation is rather minimal: the client takes a slice of url.URL pointers,and round-robins across them when performing the request.

The default HTTP transport of the client is http.Transport.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

typeClient

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

Client represents the HTTP client.

funcNew

func New(cfgConfig) *Client

New creates new HTTP client.

http.DefaultTransport will be used if no transportis passed in the configuration.

func (*Client)Perform

func (c *Client) Perform(req *http.Request) (*http.Response,error)

Perform executes the request and returns a response or error.

func (*Client)URLs

func (c *Client) URLs() []*url.URL

URLs returns a list of transport URLs.

typeConfig

type Config struct {URLs      []*url.URLTransporthttp.RoundTripper}

Config represents the configuration of HTTP client.

typeInterface

type Interface interface {Perform(*http.Request) (*http.Response,error)}

Interface defines the interface for HTTP client.

typeRoundRobinSelector

type RoundRobinSelector struct {sync.Mutex// contains filtered or unexported fields}

RoundRobinSelector implements a round-robin selection strategy.

funcNewRoundRobinSelector

func NewRoundRobinSelector(urls ...*url.URL) *RoundRobinSelector

NewRoundRobinSelector creates a new RoundRobinSelector.

func (*RoundRobinSelector)Select

func (r *RoundRobinSelector) Select() (*url.URL,error)

Select returns a URL or error from the list of URLs in a round-robin fashion.

typeSelector

type Selector interface {Select() (*url.URL,error)}

Selector defines the interface for selecting URLs for performing request.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp