simulatetemplate

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Simulate resolving the given template name or body

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 NewSimulateTemplate

type NewSimulateTemplate func() *SimulateTemplate

NewSimulateTemplate type alias for index.

func NewSimulateTemplateFunc

func NewSimulateTemplateFunc(tp elastictransport.Interface) NewSimulateTemplate

NewSimulateTemplateFunc returns a new instance of SimulateTemplate 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 {
	Overlapping []types.Overlapping `json:"overlapping,omitempty"`
	Template    types.Template      `json:"template"`
}

func NewResponse

func NewResponse() *Response

NewResponse returns a Response

type SimulateTemplate

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

func (*SimulateTemplate) Create

func (r *SimulateTemplate) Create(b bool) *SimulateTemplate

Create If true, the template passed in the body is only used if no existing templates match the same index patterns. If false, the simulation uses the template with the highest priority. Note that the template is not permanently added or updated in either case; it is only used for the simulation. API name: create

func (SimulateTemplate) Do

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

func (*SimulateTemplate) Header

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

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

func (*SimulateTemplate) HttpRequest

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

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

func (*SimulateTemplate) MasterTimeout

func (r *SimulateTemplate) MasterTimeout(v string) *SimulateTemplate

MasterTimeout Period to wait for a connection to the master node. If no response is received before the timeout expires, the request fails and returns an error. API name: master_timeout

func (*SimulateTemplate) Name

Name Name of the index template to simulate. To test a template configuration before you add it to the cluster, omit this parameter and specify the template configuration in the request body. API Name: name

func (SimulateTemplate) Perform

func (r SimulateTemplate) Perform(ctx context.Context) (*http.Response, error)

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

func (*SimulateTemplate) 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 (*SimulateTemplate) Request

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL