Documentation
¶
Overview ¶
package blobmunge provides helper functions for using Redpanda Connect's bloblang mapping language to munge structured data. blobmunge uses MapStructure/v2 to decode data prior to processing. MapStructure/v2: github.com/go-viper/mapstructure/v2
Index ¶
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func InputMap ¶
InputMap takes structured input data and attempts to decode it to map[string]any. Input data can be json in string or []byte, or any other Go data type which can be handled by MapStructure/v2. MapStructure/v2: github.com/go-viper/mapstructure/v2
Types ¶
type BlobMunger ¶
type BlobMunger struct {
// contains filtered or unexported fields
}
BlobMunger
func New ¶
func New(bloblangMapping string) (*BlobMunger, error)
New returns new BlobMunger or an error if mapping cannot be parsed.
func (*BlobMunger) ApplyBloblangMapping ¶
func (b *BlobMunger) ApplyBloblangMapping(input any) ([]byte, error)
ApplyBloblangMapping executes a bloblang mapping on structured input data.
func (*BlobMunger) UpdateMapping ¶
func (b *BlobMunger) UpdateMapping(bloblangMapping string) error
UpdateMapping method attempts to update the mapping rule, if an error is encountered it leaves the existing mapping in place.