bulk

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: 2

Documentation

Overview

Used by the monitoring features to send monitoring data.

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 Bulk

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

func (*Bulk) CreateOp added in v8.10.0

func (r *Bulk) CreateOp(op types.CreateOperation, doc interface{}) error

CreateOp is a helper function to add a CreateOperation to the current bulk request. doc argument can be a []byte, json.RawMessage or a struct.

func (*Bulk) DeleteOp added in v8.10.0

func (r *Bulk) DeleteOp(op types.DeleteOperation) error

DeleteOp is a helper function to add a DeleteOperation to the current bulk request.

func (Bulk) Do

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

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

func (*Bulk) ErrorTrace added in v8.14.0

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

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

func (*Bulk) FilterPath added in v8.14.0

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

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

func (*Bulk) Header

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

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

func (*Bulk) HttpRequest

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

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

func (*Bulk) Human added in v8.14.0

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

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 (*Bulk) IndexOp added in v8.10.0

func (r *Bulk) IndexOp(op types.IndexOperation, doc interface{}) error

IndexOp is a helper function to add an IndexOperation to the current bulk request. doc argument can be a []byte, json.RawMessage or a struct.

func (*Bulk) Interval

func (r *Bulk) Interval(duration string) *Bulk

Interval Collection interval (e.g., '10s' or '10000ms') of the payload API name: interval

func (Bulk) Perform

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

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

func (*Bulk) Pretty added in v8.14.0

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

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

func (*Bulk) Raw

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

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

func (*Bulk) Request

func (r *Bulk) Request(req *Request) *Bulk

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

func (*Bulk) SystemApiVersion

func (r *Bulk) SystemApiVersion(systemapiversion string) *Bulk

API name: system_api_version

func (*Bulk) SystemId

func (r *Bulk) SystemId(systemid string) *Bulk

SystemId Identifier of the monitored system API name: system_id

func (*Bulk) Type

func (r *Bulk) Type(type_ string) *Bulk

Type Default document type for items which don't provide one API Name: type_

func (*Bulk) UpdateOp added in v8.10.0

func (r *Bulk) UpdateOp(op types.UpdateOperation, doc interface{}, update *types.UpdateAction) error

UpdateOp is a helper function to add an UpdateOperation with and UpdateAction to the current bulk request. update is optional, if both doc and update.Doc are provided, update.Doc has precedence.

type NewBulk

type NewBulk func() *Bulk

NewBulk type alias for index.

func NewBulkFunc

func NewBulkFunc(tp elastictransport.Interface) NewBulk

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

type Response

type Response struct {
	Error *types.ErrorCause `json:"error,omitempty"`
	// Errors True if there is was an error
	Errors bool `json:"errors"`
	// Ignored Was collection disabled?
	Ignored bool  `json:"ignored"`
	Took    int64 `json:"took"`
}

Response holds the response body struct for the package bulk

https://github.com/elastic/elasticsearch-specification/blob/2f823ff6fcaa7f3f0f9b990dc90512d8901e5d64/specification/monitoring/bulk/BulkMonitoringResponse.ts#L23-L32

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