append

package
v0.0.0-...-31600e6 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Code generated by processor/generate.go - DO NOT EDIT.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Append

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

Appends one or more values to an existing array if the field already exists and it is an array. Converts a scalar to an array and appends one or more values to it if the field exists and it is a scalar. Creates an array containing the provided values if the field doesn’t exist. Accepts a single value or an array of values.

func New

func New(config Config) (*Append, error)

New returns a new Append processor.

func (*Append) Config

func (p *Append) Config() Config

Config returns the Append processor config.

func (*Append) Process

func (p *Append) Process(evt processor.Event) error

func (*Append) String

func (p *Append) String() string

type Config

type Config struct {
	// If false, the processor does not append values already present in the
	// field.
	AllowDuplicates bool `config:"allow_duplicates"`

	// Source field to process.
	Field string `config:"field" validate:"required"`

	// If true and field does not exist or is null, the processor quietly
	// returns without modifying the document.
	IgnoreMissing bool `config:"ignore_missing"`

	// The value to be appended.
	Value string `config:"value"`
}

Config contains the configuration options for the append processor.

func (*Config) InitDefaults

func (c *Config) InitDefaults()

InitDefaults initializes the configuration options to their default values.

Jump to

Keyboard shortcuts

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