follow

package
v8.17.0 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 12 Imported by: 4

Documentation

Overview

Create a follower. Create a cross-cluster replication follower index that follows a specific leader index. When the API returns, the follower index exists and cross-cluster replication starts replicating operations from the leader index to the follower index.

Index

Constants

This section is empty.

Variables

View Source
var ErrBuildPath = errors.New("cannot build path, check for missing path parameters")

ErrBuildPath is returned in case of missing parameters within the build of the request.

Functions

This section is empty.

Types

type Follow

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

func New

Create a follower. Create a cross-cluster replication follower index that follows a specific leader index. When the API returns, the follower index exists and cross-cluster replication starts replicating operations from the leader index to the follower index.

https://www.elastic.co/guide/en/elasticsearch/reference/current/ccr-put-follow.html

func (Follow) Do

func (r Follow) Do(providedCtx context.Context) (*Response, error)

Do runs the request through the transport, handle the response and returns a follow.Response

func (*Follow) ErrorTrace added in v8.14.0

func (r *Follow) ErrorTrace(errortrace bool) *Follow

ErrorTrace When set to `true` Elasticsearch will include the full stack trace of errors when they occur. API name: error_trace

func (*Follow) FilterPath added in v8.14.0

func (r *Follow) FilterPath(filterpaths ...string) *Follow

FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path

func (*Follow) Header

func (r *Follow) Header(key, value string) *Follow

Header set a key, value pair in the Follow headers map.

func (*Follow) HttpRequest

func (r *Follow) HttpRequest(ctx context.Context) (*http.Request, error)

HttpRequest returns the http.Request object built from the given parameters.

func (*Follow) Human added in v8.14.0

func (r *Follow) Human(human bool) *Follow

Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"eixsts_time_in_millis": 3600000` for computers. When disabled the human readable values will be omitted. This makes sense for responses being consumed only by machines. API name: human

func (*Follow) LeaderIndex added in v8.9.0

func (r *Follow) LeaderIndex(indexname string) *Follow

API name: leader_index

func (*Follow) MaxOutstandingReadRequests added in v8.9.0

func (r *Follow) MaxOutstandingReadRequests(maxoutstandingreadrequests int64) *Follow

API name: max_outstanding_read_requests

func (*Follow) MaxOutstandingWriteRequests added in v8.9.0

func (r *Follow) MaxOutstandingWriteRequests(maxoutstandingwriterequests int64) *Follow

API name: max_outstanding_write_requests

func (*Follow) MaxReadRequestOperationCount added in v8.9.0

func (r *Follow) MaxReadRequestOperationCount(maxreadrequestoperationcount int64) *Follow

API name: max_read_request_operation_count

func (*Follow) MaxReadRequestSize added in v8.9.0

func (r *Follow) MaxReadRequestSize(maxreadrequestsize string) *Follow

API name: max_read_request_size

func (*Follow) MaxRetryDelay added in v8.9.0

func (r *Follow) MaxRetryDelay(duration types.Duration) *Follow

API name: max_retry_delay

func (*Follow) MaxWriteBufferCount added in v8.9.0

func (r *Follow) MaxWriteBufferCount(maxwritebuffercount int64) *Follow

API name: max_write_buffer_count

func (*Follow) MaxWriteBufferSize added in v8.9.0

func (r *Follow) MaxWriteBufferSize(maxwritebuffersize string) *Follow

API name: max_write_buffer_size

func (*Follow) MaxWriteRequestOperationCount added in v8.9.0

func (r *Follow) MaxWriteRequestOperationCount(maxwriterequestoperationcount int64) *Follow

API name: max_write_request_operation_count

func (*Follow) MaxWriteRequestSize added in v8.9.0

func (r *Follow) MaxWriteRequestSize(maxwriterequestsize string) *Follow

API name: max_write_request_size

func (Follow) Perform added in v8.7.0

func (r Follow) Perform(providedCtx context.Context) (*http.Response, error)

Perform runs the http.Request through the provided transport and returns an http.Response.

func (*Follow) Pretty added in v8.14.0

func (r *Follow) Pretty(pretty bool) *Follow

Pretty If set to `true` the returned JSON will be "pretty-formatted". Only use this option for debugging only. API name: pretty

func (*Follow) Raw

func (r *Follow) Raw(raw io.Reader) *Follow

Raw takes a json payload as input which is then passed to the http.Request If specified Raw takes precedence on Request method.

func (*Follow) ReadPollTimeout added in v8.9.0

func (r *Follow) ReadPollTimeout(duration types.Duration) *Follow

API name: read_poll_timeout

func (*Follow) RemoteCluster added in v8.9.0

func (r *Follow) RemoteCluster(remotecluster string) *Follow

API name: remote_cluster

func (*Follow) Request

func (r *Follow) Request(req *Request) *Follow

Request allows to set the request property with the appropriate payload.

func (*Follow) WaitForActiveShards

func (r *Follow) WaitForActiveShards(waitforactiveshards string) *Follow

WaitForActiveShards Sets the number of shard copies that must be active before returning. Defaults to 0. Set to `all` for all shard copies, otherwise set to any non-negative value less than or equal to the total number of copies for the shard (number of replicas + 1) API name: wait_for_active_shards

type NewFollow

type NewFollow func(index string) *Follow

NewFollow type alias for index.

func NewFollowFunc

func NewFollowFunc(tp elastictransport.Interface) NewFollow

NewFollowFunc returns a new instance of Follow with the provided transport. Used in the index of the library this allows to retrieve every apis in once place.

type Request

type Request struct {
	LeaderIndex                   *string        `json:"leader_index,omitempty"`
	MaxOutstandingReadRequests    *int64         `json:"max_outstanding_read_requests,omitempty"`
	MaxOutstandingWriteRequests   *int64         `json:"max_outstanding_write_requests,omitempty"`
	MaxReadRequestOperationCount  *int64         `json:"max_read_request_operation_count,omitempty"`
	MaxReadRequestSize            *string        `json:"max_read_request_size,omitempty"`
	MaxRetryDelay                 types.Duration `json:"max_retry_delay,omitempty"`
	MaxWriteBufferCount           *int64         `json:"max_write_buffer_count,omitempty"`
	MaxWriteBufferSize            *string        `json:"max_write_buffer_size,omitempty"`
	MaxWriteRequestOperationCount *int64         `json:"max_write_request_operation_count,omitempty"`
	MaxWriteRequestSize           *string        `json:"max_write_request_size,omitempty"`
	ReadPollTimeout               types.Duration `json:"read_poll_timeout,omitempty"`
	RemoteCluster                 *string        `json:"remote_cluster,omitempty"`
}

Request holds the request body struct for the package follow

https://github.com/elastic/elasticsearch-specification/blob/2f823ff6fcaa7f3f0f9b990dc90512d8901e5d64/specification/ccr/follow/CreateFollowIndexRequest.ts#L25-L54

func NewRequest added in v8.5.0

func NewRequest() *Request

NewRequest returns a Request

func (*Request) FromJSON added in v8.5.0

func (r *Request) FromJSON(data string) (*Request, error)

FromJSON allows to load an arbitrary json into the request structure

func (*Request) UnmarshalJSON added in v8.12.1

func (s *Request) UnmarshalJSON(data []byte) error

type Response added in v8.7.0

type Response struct {
	FollowIndexCreated     bool `json:"follow_index_created"`
	FollowIndexShardsAcked bool `json:"follow_index_shards_acked"`
	IndexFollowingStarted  bool `json:"index_following_started"`
}

Response holds the response body struct for the package follow

https://github.com/elastic/elasticsearch-specification/blob/2f823ff6fcaa7f3f0f9b990dc90512d8901e5d64/specification/ccr/follow/CreateFollowIndexResponse.ts#L20-L26

func NewResponse added in v8.7.0

func NewResponse() *Response

NewResponse returns a Response

Jump to

Keyboard shortcuts

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