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) Header(key, value string) *Bulk
- func (r *Bulk) HttpRequest(ctx context.Context) (*http.Request, error)
- 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) 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) HttpRequest ¶
HttpRequest returns the http.Request object built from the given parameters.
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) 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 = []interface{}
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