Documentation ¶
Overview ¶
Used by the monitoring features to send monitoring data.
Index ¶
- Variables
- type Bulk
- func (r *Bulk) CreateOp(op types.CreateOperation, doc interface{}) error
- func (r *Bulk) DeleteOp(op types.DeleteOperation) error
- func (r Bulk) Do(providedCtx context.Context) (*Response, error)
- func (r *Bulk) ErrorTrace(errortrace bool) *Bulk
- func (r *Bulk) FilterPath(filterpaths ...string) *Bulk
- func (r *Bulk) Header(key, value string) *Bulk
- func (r *Bulk) HttpRequest(ctx context.Context) (*http.Request, error)
- func (r *Bulk) Human(human bool) *Bulk
- func (r *Bulk) IndexOp(op types.IndexOperation, doc interface{}) error
- func (r *Bulk) Interval(duration string) *Bulk
- func (r Bulk) Perform(providedCtx context.Context) (*http.Response, error)
- func (r *Bulk) Pretty(pretty bool) *Bulk
- func (r *Bulk) Raw(raw io.Reader) *Bulk
- func (r *Bulk) Request(req *Request) *Bulk
- func (r *Bulk) SystemApiVersion(systemapiversion string) *Bulk
- func (r *Bulk) SystemId(systemid string) *Bulk
- func (r *Bulk) Type(type_ string) *Bulk
- func (r *Bulk) UpdateOp(op types.UpdateOperation, doc interface{}, update *types.UpdateAction) error
- type NewBulk
- type Request
- type Response
Constants ¶
This section is empty.
Variables ¶
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 New ¶
func New(tp elastictransport.Interface) *Bulk
Used by the monitoring features to send monitoring data.
https://www.elastic.co/guide/en/elasticsearch/reference/current/monitor-elasticsearch-cluster.html
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 ¶
Do runs the request through the transport, handle the response and returns a bulk.Response
func (*Bulk) ErrorTrace ¶ added in v8.14.0
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
FilterPath Comma-separated list of filters in dot notation which reduce the response returned by Elasticsearch. API name: filter_path
func (*Bulk) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
func (*Bulk) Human ¶ added in v8.14.0
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 ¶
Interval Collection interval (e.g., '10s' or '10000ms') of the payload API name: interval
func (Bulk) Perform ¶
Perform runs the http.Request through the provided transport and returns an http.Response.
func (*Bulk) Pretty ¶ added in v8.14.0
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 ¶
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) SystemApiVersion ¶
API name: system_api_version
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 Request ¶ added in v8.11.0
type Request = []any
Request holds the request body struct for the package bulk
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