jsonanonymizer

package
v0.4.78 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnonymizeJsonError

type AnonymizeJsonError struct {
	InputIndex int64
	Message    string
}

type JsonAnonymizer

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

func NewAnonymizer

func NewAnonymizer(opts ...Option) (*JsonAnonymizer, error)

NewAnonymizer initializes a new Anonymizer with functional options

func (*JsonAnonymizer) AnonymizeJSONObject

func (a *JsonAnonymizer) AnonymizeJSONObject(jsonStr string) (string, error)

AnonymizeJSONObject takes a JSON string applies the configured anonymization transformations to each object, and returns the modified JSON string.

func (*JsonAnonymizer) AnonymizeJSONObjects

func (a *JsonAnonymizer) AnonymizeJSONObjects(jsonStrs []string) ([]string, []*AnonymizeJsonError)

AnonymizeJSONObjects takes a slice of JSON strings applies the configured anonymization transformations to each object, and returns the modified JSON string.

type Option

type Option func(*JsonAnonymizer)

Option is a functional option for configuring the Anonymizer

func WithDefaultTransformers

func WithDefaultTransformers(defaults *mgmtv1alpha1.DefaultTransformersConfig) Option

WithDefaultTransformers sets the default transformers

func WithHaltOnFailure

func WithHaltOnFailure(halt bool) Option

WithHaltOnFailure sets the haltOnFailure flag

func WithTransformerMappings

func WithTransformerMappings(mappings []*mgmtv1alpha1.TransformerMapping) Option

WithTransformerMappings sets the transformer mappings

Jump to

Keyboard shortcuts

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