previewtransform

package
v0.0.3 Latest Latest
Warning

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

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

Documentation

Overview

Previews a transform.

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 NewPreviewTransform

type NewPreviewTransform func() *PreviewTransform

NewPreviewTransform type alias for index.

func NewPreviewTransformFunc

func NewPreviewTransformFunc(tp elastictransport.Interface) NewPreviewTransform

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

type PreviewTransform

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

func (PreviewTransform) Do

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

func (*PreviewTransform) Header

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

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

func (*PreviewTransform) HttpRequest

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

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

func (PreviewTransform) Perform

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

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

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

func (r *PreviewTransform) Request(req *Request) *PreviewTransform

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

func (*PreviewTransform) Timeout

func (r *PreviewTransform) Timeout(v string) *PreviewTransform

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

func (*PreviewTransform) TransformId

func (r *PreviewTransform) TransformId(v string) *PreviewTransform

TransformId Identifier for the transform to preview. If you specify this path parameter, you cannot provide transform configuration details in the request body. API Name: transformid

type Request

type Request struct {

	// Description Free text description of the transform.
	Description *string `json:"description,omitempty"`
	// Dest The destination for the transform.
	Dest *types.TransformDestination `json:"dest,omitempty"`
	// Frequency The interval between checks for changes in the source indices when the
	// transform is running continuously. Also determines the retry interval in
	// the event of transient failures while the transform is searching or
	// indexing. The minimum value is 1s and the maximum is 1h.
	Frequency types.Duration `json:"frequency,omitempty"`
	// Latest The latest method transforms the data by finding the latest document for
	// each unique key.
	Latest *types.Latest `json:"latest,omitempty"`
	// Pivot The pivot method transforms the data by aggregating and grouping it.
	// These objects define the group by fields and the aggregation to reduce
	// the data.
	Pivot *types.Pivot `json:"pivot,omitempty"`
	// RetentionPolicy Defines a retention policy for the transform. Data that meets the defined
	// criteria is deleted from the destination index.
	RetentionPolicy *types.RetentionPolicyContainer `json:"retention_policy,omitempty"`
	// Settings Defines optional transform settings.
	Settings *types.Settings `json:"settings,omitempty"`
	// Source The source of the data for the transform.
	Source *types.TransformSource `json:"source,omitempty"`
	// Sync Defines the properties transforms require to run continuously.
	Sync *types.SyncContainer `json:"sync,omitempty"`
}

Request holds the request body struct for the package previewtransform

https://github.com/elastic/elasticsearch-specification/blob/1ad7fe36297b3a8e187b2259dedaf68a47bc236e/specification/transform/preview_transform/PreviewTransformRequest.ts#L33-L107

func NewRequest

func NewRequest() *Request

NewRequest returns a Request

func (*Request) FromJSON

func (r *Request) FromJSON(data string) (*Request, error)

FromJSON allows to load an arbitrary json into the request structure

type Response

type Response struct {
	GeneratedDestIndex types.IndexState  `json:"generated_dest_index"`
	Preview            []json.RawMessage `json:"preview"`
}

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