closepointintime

package
v9.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

Close a point in time. A point in time must be opened explicitly before being used in search requests. The `keep_alive` parameter tells Elasticsearch how long it should persist. A point in time is automatically closed when the `keep_alive` period has elapsed. However, keeping points in time has a cost; close them as soon as they are no longer required for search requests.

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 ClosePointInTime

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

func New

Close a point in time. A point in time must be opened explicitly before being used in search requests. The `keep_alive` parameter tells Elasticsearch how long it should persist. A point in time is automatically closed when the `keep_alive` period has elapsed. However, keeping points in time has a cost; close them as soon as they are no longer required for search requests.

https://www.elastic.co/docs/api/doc/elasticsearch/operation/operation-open-point-in-time

func (ClosePointInTime) Do

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

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

func (*ClosePointInTime) ErrorTrace

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

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

func (*ClosePointInTime) FilterPath

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

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

func (*ClosePointInTime) Header

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

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

func (*ClosePointInTime) HttpRequest

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

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

func (*ClosePointInTime) Human

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

Human When set to `true` will return statistics in a format suitable for humans. For example `"exists_time": "1h"` for humans and `"exists_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 (*ClosePointInTime) Id

The ID of the point-in-time. API name: id

func (ClosePointInTime) Perform

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

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

func (*ClosePointInTime) Pretty

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

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

func (*ClosePointInTime) Raw

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

func (*ClosePointInTime) Request

func (r *ClosePointInTime) Request(req *Request) *ClosePointInTime

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

type NewClosePointInTime

type NewClosePointInTime func() *ClosePointInTime

NewClosePointInTime type alias for index.

func NewClosePointInTimeFunc

func NewClosePointInTimeFunc(tp elastictransport.Interface) NewClosePointInTime

NewClosePointInTimeFunc returns a new instance of ClosePointInTime 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 {

	// Id The ID of the point-in-time.
	Id string `json:"id"`
}

Request holds the request body struct for the package closepointintime

https://github.com/elastic/elasticsearch-specification/blob/907d11a72a6bfd37b777d526880c56202889609e/specification/_global/close_point_in_time/ClosePointInTimeRequest.ts#L23-L48

func NewRequest

func NewRequest() *Request

NewRequest returns a Request

func (*Request) FromJSON

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

FromJSON allows to load an arbitrary json into the request structure

func (*Request) UnmarshalJSON

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

type Response

type Response struct {

	// NumFreed The number of search contexts that were successfully closed.
	NumFreed int `json:"num_freed"`
	// Succeeded If `true`, all search contexts associated with the point-in-time ID were
	// successfully closed.
	Succeeded bool `json:"succeeded"`
}

Response holds the response body struct for the package closepointintime

https://github.com/elastic/elasticsearch-specification/blob/907d11a72a6bfd37b777d526880c56202889609e/specification/_global/close_point_in_time/ClosePointInTimeResponse.ts#L22-L42

func NewResponse

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