getasync

package
v8.13.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 11 Imported by: 3

Documentation

Overview

Returns the current status and available results for an async SQL search or stored synchronous SQL search

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 GetAsync

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

func New

Returns the current status and available results for an async SQL search or stored synchronous SQL search

https://www.elastic.co/guide/en/elasticsearch/reference/current/get-async-sql-search-api.html

func (*GetAsync) Delimiter

func (r *GetAsync) Delimiter(delimiter string) *GetAsync

Delimiter Separator for CSV results. The API only supports this parameter for CSV responses. API name: delimiter

func (GetAsync) Do

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

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

func (*GetAsync) Format

func (r *GetAsync) Format(format string) *GetAsync

Format Format for the response. You must specify a format using this parameter or the Accept HTTP header. If you specify both, the API uses this parameter. API name: format

func (*GetAsync) Header

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

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

func (*GetAsync) HttpRequest

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

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

func (GetAsync) IsSuccess

func (r GetAsync) IsSuccess(providedCtx context.Context) (bool, error)

IsSuccess allows to run a query with a context and retrieve the result as a boolean. This only exists for endpoints without a request payload and allows for quick control flow.

func (*GetAsync) KeepAlive

func (r *GetAsync) KeepAlive(duration string) *GetAsync

KeepAlive Retention period for the search and its results. Defaults to the `keep_alive` period for the original SQL search. API name: keep_alive

func (GetAsync) Perform added in v8.7.0

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

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

func (*GetAsync) WaitForCompletionTimeout

func (r *GetAsync) WaitForCompletionTimeout(duration string) *GetAsync

WaitForCompletionTimeout Period to wait for complete results. Defaults to no timeout, meaning the request waits for complete search results. API name: wait_for_completion_timeout

type NewGetAsync

type NewGetAsync func(id string) *GetAsync

NewGetAsync type alias for index.

func NewGetAsyncFunc

func NewGetAsyncFunc(tp elastictransport.Interface) NewGetAsync

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

type Response added in v8.7.0

type Response struct {

	// Columns Column headings for the search results. Each object is a column.
	Columns []types.Column `json:"columns,omitempty"`
	// Cursor Cursor for the next set of paginated results. For CSV, TSV, and
	// TXT responses, this value is returned in the `Cursor` HTTP header.
	Cursor *string `json:"cursor,omitempty"`
	// Id Identifier for the search. This value is only returned for async and saved
	// synchronous searches. For CSV, TSV, and TXT responses, this value is returned
	// in the `Async-ID` HTTP header.
	Id string `json:"id"`
	// IsPartial If `true`, the response does not contain complete search results. If
	// `is_partial`
	// is `true` and `is_running` is `true`, the search is still running. If
	// `is_partial`
	// is `true` but `is_running` is `false`, the results are partial due to a
	// failure or
	// timeout. This value is only returned for async and saved synchronous
	// searches.
	// For CSV, TSV, and TXT responses, this value is returned in the
	// `Async-partial` HTTP header.
	IsPartial bool `json:"is_partial"`
	// IsRunning If `true`, the search is still running. If false, the search has finished.
	// This value is only returned for async and saved synchronous searches. For
	// CSV, TSV, and TXT responses, this value is returned in the `Async-partial`
	// HTTP header.
	IsRunning bool `json:"is_running"`
	// Rows Values for the search results.
	Rows [][]json.RawMessage `json:"rows"`
}

Response holds the response body struct for the package getasync

https://github.com/elastic/elasticsearch-specification/blob/5bf86339cd4bda77d07f6eaa6789b72f9c0279b1/specification/sql/get_async/SqlGetAsyncResponse.ts#L23-L60

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