Documentation
¶
Index ¶
- Constants
- func BuildCaches(caches map[string]CacheDefinition, existing map[string]Cache) map[string]Cache
- func BuildFuncMap(funcs map[string]Function, fns tmpl.FuncMap) (tmpl.FuncMap, error)
- func CleanTypes(inter interface{}) interface{}
- func InjectConfig(skipLineOnErrorValue bool, skipFieldOnErrorValue bool, skipLogFileValue string)
- func InjectMaskContextFactories(factories []MaskContextFactory)
- func InjectMaskFactories(factories []MaskFactory)
- func NewPathSelector(path string) selectorInternal
- func UnorderedTypes(inter interface{}) interface{}
- func Untyped(inter interface{}) interface{}
- type Action
- type Applier
- type ApplyType
- type Cache
- type CacheDefinition
- type ChoiceInCSVType
- type Class
- type Collector
- type CountPredicate
- type CounterProcess
- type DateParserType
- type Definition
- type DeleteMaskEngineProcess
- type Dictionary
- func (d Dictionary) CanUnpackAsDict() bool
- func (d Dictionary) Copy() Dictionary
- func (d Dictionary) Get(key string) Entry
- func (d Dictionary) GetValue(key string) (Entry, bool)
- func (d Dictionary) IsPacked() bool
- func (d Dictionary) MarshalJSON() ([]byte, error)
- func (d Dictionary) Pack() Dictionary
- func (d Dictionary) String() string
- func (d Dictionary) TryUnpackAsDict() (Dictionary, bool)
- func (d Dictionary) Unordered() map[string]Entry
- func (d Dictionary) Unpack() Entry
- func (d Dictionary) UnpackAsDict() Dictionary
- func (d Dictionary) UnpackUnordered() Entry
- func (d Dictionary) UnpackUntyped() interface{}
- func (d Dictionary) Untyped() map[string]interface{}
- func (d Dictionary) With(key string, value interface{}) Dictionary
- type EmbeddedSha3Type
- type Entry
- type ExactMatchType
- type FF1Type
- type FalsePredicate
- type FindInCSVType
- type FromCacheProcess
- type Function
- type FunctionMaskContextEngine
- type FunctionMaskEngine
- type HasCleaner
- type IncrementalType
- type Iterable
- type LogType
- type LookupValueDiscarder
- type LookupValueSetter
- type LuhnType
- type MapProcess
- type Mapper
- type MarkovType
- type MaskCacheEngine
- type MaskContextCacheEngine
- type MaskContextEngine
- type MaskContextEngineProcess
- type MaskContextFactory
- type MaskEngine
- type MaskEngineProcess
- type MaskFactory
- type MaskFactoryConfiguration
- type MaskType
- type Masking
- type MemCache
- type MsgLogger
- type MutableSource
- type Observer
- type PackProcess
- type Param
- type PartitionType
- type PipeType
- type Pipeline
- type Predicate
- type ProcessPipeline
- type ProcessWrapper
- type Processor
- func NewCounterProcess(contextName string, initValue int) Processor
- func NewCounterProcessWithCallback(contextName string, initValue int, updater func(int)) Processor
- func NewDeleteMaskEngineProcess(selector Selector) Processor
- func NewFromCacheProcess(selector Selector, cache Cache, preserve string) Processor
- func NewMapProcess(mapper Mapper) Processor
- func NewMaskContextEngineProcess(selector Selector, mask MaskContextEngine, skipLogFile string) Processor
- func NewMaskEngineProcess(selector Selector, mask MaskEngine, preserve string, preserveList []Entry, ...) Processor
- func NewRepeaterUntilProcess(source *TempSource, text, mode string, skipLogFile string) (Processor, error)
- type QueueCollector
- type RandDateType
- type RandIntType
- type RandomDecimalType
- type RandomDurationType
- type Repeater
- type RepeaterUntilProcess
- type Resource
- type SeedType
- type Seeder
- type SegmentType
- type Selector
- type SelectorType
- type SequenceType
- type Sha3Type
- type SimplePipeline
- func (pipeline SimplePipeline) AddSink(sink SinkProcess) SinkedPipeline
- func (pipeline SimplePipeline) Close() error
- func (pipeline SimplePipeline) Open() error
- func (pipeline SimplePipeline) Process(process Processor) Pipeline
- func (pipeline SimplePipeline) Source() Source
- func (pipeline SimplePipeline) Values() iter.Seq2[Entry, error]
- func (pipeline SimplePipeline) WithSource(source Source) Pipeline
- type SimpleSinkedPipeline
- type SinkProcess
- type SinkToCache
- type SinkToSlice
- type SinkedPipeline
- type SliceSource
- type Source
- type TempSource
- type TemplateEachType
- type TimeLineConstraintType
- type TimeLinePointType
- type TimeLineStartType
- type TimeLineType
- type TranscodeType
- type TruePredicate
- type UniqueCache
- type UniqueMaskCacheEngine
- type UniqueMaskContextCacheEngine
- type UniqueMemCache
- type UnpackProcess
- type WeightedChoiceType
- type XMLType
Constants ¶
const ( NOTHING Action = iota WRITE = iota DELETE = iota )
Action types
Variables ¶
This section is empty.
Functions ¶
func BuildCaches ¶
func BuildFuncMap ¶ added in v1.15.0
func CleanTypes ¶ added in v1.5.0
func CleanTypes(inter interface{}) interface{}
CleanTypes always return either primitive types, or a composition of Dictionaries
func InjectConfig ¶ added in v1.4.0
func InjectMaskContextFactories ¶
func InjectMaskContextFactories(factories []MaskContextFactory)
func InjectMaskFactories ¶
func InjectMaskFactories(factories []MaskFactory)
func NewPathSelector ¶
func NewPathSelector(path string) selectorInternal
func UnorderedTypes ¶ added in v1.5.0
func UnorderedTypes(inter interface{}) interface{}
UnorderedTypes a composition of map[string]Entry
Types ¶
type Applier ¶
type Applier func(rootContext Dictionary, parentContext Dictionary, key string, value Entry) (Action, Entry)
type ApplyType ¶ added in v1.29.0
type ApplyType struct {
URI string `yaml:"uri" json:"uri" jsonschema_description:"URI of the mask resource"`
}
type Cache ¶
type Cache interface {
SetLookupValue(key Entry)
Get(key Entry) (Entry, bool)
Put(key Entry, value Entry)
Subscribe(key Entry, observer Observer)
Iterate() Source
}
func NewMemCache ¶
func NewMemCache() Cache
type CacheDefinition ¶
type ChoiceInCSVType ¶ added in v1.18.0
type ChoiceInCSVType struct {
URI string `yaml:"uri" json:"uri" jsonschema_description:"URI of the CSV resource"`
Header bool `yaml:"header,omitempty" json:"header,omitempty" jsonschema_description:"Does the CSV resource contains a header line"`
Separator string `yaml:"separator,omitempty" json:"separator,omitempty" jsonschema_description:"Separator character"`
Comment string `` /* 158-byte string literal not displayed */
FieldsPerRecord int `` /* 200-byte string literal not displayed */
TrimSpace bool `yaml:"trim,omitempty" json:"trim,omitempty" jsonschema_description:"If true leading white space in a field is ignored"`
Identifier EmbeddedSha3Type `yaml:"identifier,omitempty" json:"identifier,omitempty" jsonschema_description:"Configure a collision resistant ID generator"`
}
type Collector ¶
type Collector interface {
Collect(Entry)
}
Collector collect Dictionary generate by Process
type CountPredicate ¶ added in v1.31.1
type CountPredicate struct {
// contains filtered or unexported fields
}
func (*CountPredicate) Error ¶ added in v1.31.1
func (c *CountPredicate) Error() error
func (*CountPredicate) Reset ¶ added in v1.31.1
func (c *CountPredicate) Reset() error
func (*CountPredicate) Test ¶ added in v1.31.1
func (c *CountPredicate) Test(Entry) bool
type CounterProcess ¶ added in v1.4.0
type CounterProcess struct {
// contains filtered or unexported fields
}
func (CounterProcess) Open ¶ added in v1.4.0
func (p CounterProcess) Open() error
func (CounterProcess) ProcessDictionary ¶ added in v1.4.0
func (p CounterProcess) ProcessDictionary(dictionary Dictionary, out Collector) error
type DateParserType ¶
type Definition ¶
type Definition struct {
Version string `yaml:"version" json:"version" jsonschema_description:"Version of the pipeline definition, use the value 1"`
Seed int64 `` /* 129-byte string literal not displayed */
Functions map[string]Function `yaml:"functions,omitempty" json:"functions,omitempty" jsonschema_description:"Declare functions to be used in the masking"`
Masking []Masking `yaml:"masking" json:"masking" jsonschema_description:"Masking pipeline definition"`
Caches map[string]CacheDefinition `yaml:"caches,omitempty" json:"caches,omitempty" jsonschema_description:"Declare in-memory caches"`
}
func LoadPipelineDefinitionFromFile ¶ added in v1.12.0
func LoadPipelineDefinitionFromFile(filename string) (Definition, error)
func LoadPipelineDefinitionFromYAML ¶
func LoadPipelineDefinitionFromYAML(source []byte) (Definition, error)
func LoadPipelineDefintionFromOneLiner ¶ added in v1.12.0
func LoadPipelineDefintionFromOneLiner(oneLine []string) (Definition, error)
func (*Definition) SetSeed ¶ added in v1.18.0
func (conf *Definition) SetSeed(seedValue int64)
setSeed compute seed from current nano second if seedValue is 0
type DeleteMaskEngineProcess ¶
type DeleteMaskEngineProcess struct {
// contains filtered or unexported fields
}
func (*DeleteMaskEngineProcess) Open ¶
func (dp *DeleteMaskEngineProcess) Open() (err error)
func (*DeleteMaskEngineProcess) ProcessDictionary ¶
func (dp *DeleteMaskEngineProcess) ProcessDictionary(dictionary Dictionary, out Collector) error
type Dictionary ¶
type Dictionary struct {
*ordered.OrderedMap
}
func CleanDictionary ¶ added in v1.5.0
func CleanDictionary(dict interface{}) Dictionary
CleanDictionary fixes all types in the structure
func CleanDictionarySlice ¶ added in v1.6.0
func CleanDictionarySlice(dictSlice interface{}) []Dictionary
func CopyDictionary ¶ added in v1.5.0
func CopyDictionary(other Dictionary) Dictionary
CopyDictionary clone deeply dictionary
func NewDictionary ¶ added in v1.5.0
func NewDictionary() Dictionary
func NewPackedDictionary ¶ added in v1.19.0
func NewPackedDictionary() Dictionary
func (Dictionary) CanUnpackAsDict ¶ added in v1.19.0
func (d Dictionary) CanUnpackAsDict() bool
func (Dictionary) Copy ¶ added in v1.5.0
func (d Dictionary) Copy() Dictionary
func (Dictionary) Get ¶ added in v1.26.1
func (d Dictionary) Get(key string) Entry
func (Dictionary) GetValue ¶ added in v1.26.1
func (d Dictionary) GetValue(key string) (Entry, bool)
func (Dictionary) IsPacked ¶ added in v1.19.0
func (d Dictionary) IsPacked() bool
func (Dictionary) MarshalJSON ¶ added in v1.26.1
func (d Dictionary) MarshalJSON() ([]byte, error)
func (Dictionary) Pack ¶ added in v1.19.0
func (d Dictionary) Pack() Dictionary
func (Dictionary) String ¶ added in v1.5.0
func (d Dictionary) String() string
func (Dictionary) TryUnpackAsDict ¶ added in v1.19.0
func (d Dictionary) TryUnpackAsDict() (Dictionary, bool)
func (Dictionary) Unordered ¶ added in v1.5.0
func (d Dictionary) Unordered() map[string]Entry
func (Dictionary) Unpack ¶ added in v1.19.0
func (d Dictionary) Unpack() Entry
func (Dictionary) UnpackAsDict ¶ added in v1.19.0
func (d Dictionary) UnpackAsDict() Dictionary
func (Dictionary) UnpackUnordered ¶ added in v1.21.0
func (d Dictionary) UnpackUnordered() Entry
func (Dictionary) UnpackUntyped ¶ added in v1.21.0
func (d Dictionary) UnpackUntyped() interface{}
func (Dictionary) Untyped ¶ added in v1.12.0
func (d Dictionary) Untyped() map[string]interface{}
func (Dictionary) With ¶ added in v1.5.0
func (d Dictionary) With(key string, value interface{}) Dictionary
type EmbeddedSha3Type ¶ added in v1.25.0
type ExactMatchType ¶ added in v1.21.0
type FF1Type ¶
type FF1Type struct {
KeyFromEnv string `` /* 130-byte string literal not displayed */
TweakField string `` /* 273-byte string literal not displayed */
Radix uint `` /* 263-byte string literal not displayed */
Domain string `` /* 167-byte string literal not displayed */
Preserve string `` /* 136-byte string literal not displayed */
OnError *string `` /* 138-byte string literal not displayed */
Decrypt bool `yaml:"decrypt,omitempty" json:"decrypt,omitempty" jsonschema_description:"Decrypt the value instead of encrypt"`
}
type FalsePredicate ¶ added in v1.31.1
type FalsePredicate struct{}
func (FalsePredicate) Error ¶ added in v1.31.1
func (FalsePredicate) Error() error
func (FalsePredicate) Reset ¶ added in v1.31.1
func (FalsePredicate) Reset() error
func (FalsePredicate) Test ¶ added in v1.31.1
func (FalsePredicate) Test(Entry) bool
type FindInCSVType ¶ added in v1.21.0
type FindInCSVType struct {
URI string `yaml:"uri" json:"uri" jsonschema_description:"URI of the CSV resource"`
ExactMatch ExactMatchType `` /* 147-byte string literal not displayed */
JaccardMatch ExactMatchType `` /* 157-byte string literal not displayed */
Expected string `` /* 129-byte string literal not displayed */
Header bool `yaml:"header,omitempty" json:"header,omitempty" jsonschema_description:"Does the CSV resource contains a header line"`
Separator string `yaml:"separator,omitempty" json:"separator,omitempty" jsonschema_description:"Separator character"`
Comment string `` /* 158-byte string literal not displayed */
FieldsPerRecord int `` /* 200-byte string literal not displayed */
TrimSpace bool `yaml:"trim,omitempty" json:"trim,omitempty" jsonschema_description:"If true leading white space in a field is ignored"`
}
type FromCacheProcess ¶
type FromCacheProcess struct {
// contains filtered or unexported fields
}
func (*FromCacheProcess) Notify ¶
func (p *FromCacheProcess) Notify(key Entry, value Entry)
func (*FromCacheProcess) Open ¶
func (p *FromCacheProcess) Open() error
func (*FromCacheProcess) ProcessDictionary ¶
func (p *FromCacheProcess) ProcessDictionary(dictionary Dictionary, out Collector) error
type FunctionMaskContextEngine ¶ added in v1.9.0
type FunctionMaskContextEngine struct {
Function func(Dictionary, string, ...Dictionary) (Dictionary, error)
}
FunctionMaskContextEngine implements MaskContextEngine with a simple function
func (FunctionMaskContextEngine) MaskContext ¶ added in v1.9.0
func (fme FunctionMaskContextEngine) MaskContext(e Dictionary, key string, context ...Dictionary) (Dictionary, error)
MaskContext delegate mask algorithm to the function
type FunctionMaskEngine ¶
type FunctionMaskEngine struct {
Function func(Entry, ...Dictionary) (Entry, error)
}
FunctionMaskEngine implements MaskEngine with a simple function
func (FunctionMaskEngine) Mask ¶
func (fme FunctionMaskEngine) Mask(e Entry, context ...Dictionary) (Entry, error)
Mask delegate mask algorithm to the function
type HasCleaner ¶ added in v1.9.0
type HasCleaner interface {
GetCleaner() FunctionMaskContextEngine
}
HasCleaner interface provides a function to apply on cleanup
type IncrementalType ¶
type Iterable ¶ added in v1.31.1
Iterable is a resource that can be iterated over to produce values of type T. It extends the Resource interface.
type LookupValueDiscarder ¶ added in v1.16.0
type LookupValueDiscarder struct {
// contains filtered or unexported fields
}
func (*LookupValueDiscarder) Open ¶ added in v1.16.0
func (lvd *LookupValueDiscarder) Open() error
func (*LookupValueDiscarder) ProcessDictionary ¶ added in v1.16.0
func (lvd *LookupValueDiscarder) ProcessDictionary(e Dictionary, c Collector) error
type LookupValueSetter ¶ added in v1.16.0
type LookupValueSetter struct {
// contains filtered or unexported fields
}
func (*LookupValueSetter) Open ¶ added in v1.16.0
func (lvs *LookupValueSetter) Open() error
func (*LookupValueSetter) ProcessDictionary ¶ added in v1.16.0
func (lvs *LookupValueSetter) ProcessDictionary(e Dictionary, c Collector) error
type LuhnType ¶ added in v1.10.0
type LuhnType struct {
Universe string `` /* 139-byte string literal not displayed */
}
type MapProcess ¶
type MapProcess struct {
// contains filtered or unexported fields
}
func (MapProcess) Open ¶
func (mp MapProcess) Open() error
func (MapProcess) ProcessDictionary ¶
func (mp MapProcess) ProcessDictionary(dictionary Dictionary, out Collector) error
type Mapper ¶
type Mapper func(Dictionary) (Dictionary, error)
type MarkovType ¶ added in v1.12.0
type MarkovType struct {
MaxSize int `yaml:"max-size,omitempty" json:"max-size,omitempty" jsonschema_description:"Maximum length for the generated text"`
Sample string `` /* 126-byte string literal not displayed */
Separator string `` /* 158-byte string literal not displayed */
Order int `` /* 209-byte string literal not displayed */
}
type MaskCacheEngine ¶
type MaskCacheEngine struct {
Cache Cache
OriginalEngine MaskEngine
}
MaskCacheEngine is a struct to create a cahed mask
func NewMaskCacheEngine ¶
func NewMaskCacheEngine(cache Cache, original MaskEngine) MaskCacheEngine
NewMaskCacheEngine create an MaskCacheEngine
func (MaskCacheEngine) Mask ¶
func (mce MaskCacheEngine) Mask(e Entry, context ...Dictionary) (Entry, error)
Mask masks run mask with cache
type MaskContextCacheEngine ¶ added in v1.11.0
type MaskContextCacheEngine struct {
Cache Cache
OriginalEngine MaskContextEngine
}
MaskContextCacheEngine is a struct to create a cahed mask with context
func NewMaskContextCacheEngine ¶ added in v1.11.0
func NewMaskContextCacheEngine(cache Cache, original MaskContextEngine) MaskContextCacheEngine
NewMaskContextCacheEngine create an MaskContextCacheEngine
func (MaskContextCacheEngine) MaskContext ¶ added in v1.11.0
func (mcce MaskContextCacheEngine) MaskContext(context Dictionary, key string, contexts ...Dictionary, ) (Dictionary, error)
MaskContext masks run maskContext with cache
type MaskContextEngine ¶
type MaskContextEngine interface {
MaskContext(Dictionary, string, ...Dictionary) (Dictionary, error)
}
MaskContextEngine is a masking algorithm for dictionary
type MaskContextEngineProcess ¶
type MaskContextEngineProcess struct {
// contains filtered or unexported fields
}
func (*MaskContextEngineProcess) Open ¶
func (mcep *MaskContextEngineProcess) Open() error
func (*MaskContextEngineProcess) ProcessDictionary ¶
func (mcep *MaskContextEngineProcess) ProcessDictionary(dictionary Dictionary, out Collector) (ret error)
type MaskContextFactory ¶
type MaskContextFactory func(MaskFactoryConfiguration) (MaskContextEngine, bool, error)
type MaskEngine ¶
type MaskEngine interface {
Mask(Entry, ...Dictionary) (Entry, error)
}
MaskEngine is a masking algorithm
type MaskEngineProcess ¶
type MaskEngineProcess struct {
// contains filtered or unexported fields
}
func (*MaskEngineProcess) Open ¶
func (mep *MaskEngineProcess) Open() error
func (*MaskEngineProcess) ProcessDictionary ¶
func (mep *MaskEngineProcess) ProcessDictionary(dictionary Dictionary, out Collector) (ret error)
type MaskFactory ¶
type MaskFactory func(MaskFactoryConfiguration) (MaskEngine, bool, error)
type MaskFactoryConfiguration ¶ added in v1.15.0
type MaskType ¶
type MaskType struct {
Add Entry `` /* 135-byte string literal not displayed */
AddTransient Entry `` /* 217-byte string literal not displayed */
Constant Entry `` /* 179-byte string literal not displayed */
RandomChoice []Entry `` /* 224-byte string literal not displayed */
RandomChoiceInURI string `` /* 265-byte string literal not displayed */
RandomChoiceInCSV ChoiceInCSVType `` /* 251-byte string literal not displayed */
Command string `` /* 197-byte string literal not displayed */
RandomInt RandIntType `` /* 217-byte string literal not displayed */
WeightedChoice []WeightedChoiceType `` /* 317-byte string literal not displayed */
Regex string `` /* 215-byte string literal not displayed */
Hash []Entry `` /* 259-byte string literal not displayed */
HashInURI string `` /* 305-byte string literal not displayed */
HashInCSV ChoiceInCSVType `` /* 286-byte string literal not displayed */
RandDate RandDateType `` /* 208-byte string literal not displayed */
Incremental IncrementalType `` /* 207-byte string literal not displayed */
Replacement string `` /* 201-byte string literal not displayed */
Template string `` /* 212-byte string literal not displayed */
TemplateEach TemplateEachType `` /* 280-byte string literal not displayed */
Duration string `` /* 241-byte string literal not displayed */
Remove bool `` /* 163-byte string literal not displayed */
RangeMask int `` /* 182-byte string literal not displayed */
RandomDuration RandomDurationType `` /* 265-byte string literal not displayed */
FluxURI string `` /* 242-byte string literal not displayed */
RandomDecimal RandomDecimalType `` /* 229-byte string literal not displayed */
DateParser DateParserType `` /* 178-byte string literal not displayed */
FromCache string `` /* 228-byte string literal not displayed */
FF1 FF1Type `` /* 192-byte string literal not displayed */
Pipe PipeType `` /* 279-byte string literal not displayed */
FromJSON string `` /* 220-byte string literal not displayed */
Luhn *LuhnType `` /* 196-byte string literal not displayed */
Markov MarkovType `` /* 167-byte string literal not displayed */
Transcode *TranscodeType `` /* 217-byte string literal not displayed */
FindInCSV FindInCSVType `` /* 242-byte string literal not displayed */
XML XMLType `` /* 159-byte string literal not displayed */
TimeLine TimeLineType `` /* 181-byte string literal not displayed */
Sequence SequenceType `` /* 187-byte string literal not displayed */
Sha3 Sha3Type `` /* 184-byte string literal not displayed */
Apply ApplyType `` /* 148-byte string literal not displayed */
Partition []PartitionType `` /* 212-byte string literal not displayed */
Segment SegmentType `` /* 191-byte string literal not displayed */
Log *LogType `` /* 134-byte string literal not displayed */
}
type Masking ¶
type Masking struct {
// Masking requires at least one Selector and one Mask definition.
// Case1: One selector, One mask
// Case2: One selector, Multiple masks
// Case3: Multiple selectors, One mask
// Case4: Multiple selectors, Multiple masks
Selector SelectorType `` /* 190-byte string literal not displayed */
Selectors []SelectorType `` /* 182-byte string literal not displayed */
Mask MaskType `` /* 172-byte string literal not displayed */
Masks []MaskType `` /* 174-byte string literal not displayed */
Cache string `` /* 146-byte string literal not displayed */
Preserve string `` /* 353-byte string literal not displayed */
PreserveL []Entry `yaml:"preserve-list,omitempty" json:"preserve-list,omitempty" jsonschema_description:"Preserve (do not mask) given values"`
Seed SeedType `` /* 135-byte string literal not displayed */
}
type MemCache ¶
type MemCache struct {
// contains filtered or unexported fields
}
MemCache is a cache in memory
func (*MemCache) SetLookupValue ¶ added in v1.16.0
type MsgLogger ¶ added in v1.19.0
type MsgLogger struct {
// contains filtered or unexported fields
}
func NewMsgLogger ¶ added in v1.19.0
type MutableSource ¶ added in v1.31.1
type MutableSource struct {
// contains filtered or unexported fields
}
func NewMutableSource ¶ added in v1.31.1
func NewMutableSource() *MutableSource
func (*MutableSource) Close ¶ added in v1.31.1
func (s *MutableSource) Close() error
func (*MutableSource) Open ¶ added in v1.31.1
func (s *MutableSource) Open() error
func (*MutableSource) SetValues ¶ added in v1.31.1
func (s *MutableSource) SetValues(values ...Dictionary)
type PackProcess ¶ added in v1.19.0
type PackProcess struct{}
PackProcess will pack the jsonline data into a wrapper {"": <jsonline>}
func NewPackProcess ¶ added in v1.19.0
func NewPackProcess() *PackProcess
func (*PackProcess) Open ¶ added in v1.19.0
func (pp *PackProcess) Open() error
func (*PackProcess) ProcessDictionary ¶ added in v1.19.0
func (pp *PackProcess) ProcessDictionary(dictionary Dictionary, out Collector) error
type Param ¶ added in v1.15.0
type Param struct {
Name string `yaml:"name" json:"name" jsonschema_description:"Declare name parameters"`
}
type PartitionType ¶ added in v1.30.0
type PartitionType struct {
Name string `yaml:"name" json:"name" jsonschema_description:"name of the partition"`
When string `yaml:"when,omitempty" json:"when,omitempty" jsonschema_description:"template to execute, if true the condition is active"`
Then []MaskType `yaml:"then,omitempty" json:"then,omitempty" jsonschema_description:"list of masks to execute if the condition is active"`
}
type Pipeline ¶
type Pipeline interface {
Source() Source
Process(Processor) Pipeline
WithSource(Source) Pipeline
AddSink(SinkProcess) SinkedPipeline
}
func BuildPipeline ¶
func NewPipeline ¶
func NewPipelineFromSlice ¶
func NewPipelineFromSlice(dictionaries []Dictionary) Pipeline
func NewProcessPipeline ¶
type ProcessPipeline ¶
type ProcessPipeline struct {
*ProcessWrapper
}
func (*ProcessPipeline) AddSink ¶
func (p *ProcessPipeline) AddSink(sink SinkProcess) SinkedPipeline
func (*ProcessPipeline) Process ¶
func (p *ProcessPipeline) Process(process Processor) Pipeline
func (*ProcessPipeline) Source ¶ added in v1.19.0
func (p *ProcessPipeline) Source() Source
func (*ProcessPipeline) WithSource ¶
func (p *ProcessPipeline) WithSource(source Source) Pipeline
type ProcessWrapper ¶ added in v1.31.1
type ProcessWrapper struct {
// contains filtered or unexported fields
}
func NewProcessWrapper ¶ added in v1.31.1
func NewProcessWrapper(input Source, p Processor) *ProcessWrapper
func (*ProcessWrapper) Close ¶ added in v1.31.1
func (c *ProcessWrapper) Close() error
func (*ProcessWrapper) Open ¶ added in v1.31.1
func (c *ProcessWrapper) Open() error
type Processor ¶
type Processor interface {
Open() error
ProcessDictionary(Dictionary, Collector) error
}
Processor process Dictionary and none, one or many element
func NewCounterProcess ¶ added in v1.4.0
func NewCounterProcessWithCallback ¶ added in v1.4.0
func NewFromCacheProcess ¶
func NewMapProcess ¶
func NewMaskContextEngineProcess ¶
func NewMaskContextEngineProcess(selector Selector, mask MaskContextEngine, skipLogFile string) Processor
func NewMaskEngineProcess ¶
func NewRepeaterUntilProcess ¶ added in v1.12.0
func NewRepeaterUntilProcess(source *TempSource, text, mode string, skipLogFile string) (Processor, error)
type QueueCollector ¶
type QueueCollector struct {
// contains filtered or unexported fields
}
func NewCollector ¶
func NewCollector() *QueueCollector
func (*QueueCollector) Close ¶ added in v1.31.1
func (c *QueueCollector) Close() error
func (*QueueCollector) Collect ¶
func (c *QueueCollector) Collect(dictionary Entry)
func (*QueueCollector) Err ¶
func (c *QueueCollector) Err() error
func (*QueueCollector) Next ¶
func (c *QueueCollector) Next() bool
func (*QueueCollector) Open ¶
func (c *QueueCollector) Open() error
func (*QueueCollector) Value ¶
func (c *QueueCollector) Value() Entry
type RandDateType ¶
type RandIntType ¶
type RandomDecimalType ¶
type RandomDecimalType struct {
Min float64 `yaml:"min" json:"min" jsonschema_description:"Lower bound of the decimal range"`
Max float64 `yaml:"max" json:"max" jsonschema_description:"Lower bound of the decimal range"`
Precision int `yaml:"precision" json:"precision" jsonschema_description:"Precision of the generated value"`
}
type RandomDurationType ¶
type Repeater ¶ added in v1.31.1
type Repeater struct {
// contains filtered or unexported fields
}
func NewCountRepeater ¶ added in v1.31.1
func NewRepeater ¶ added in v1.31.1
type RepeaterUntilProcess ¶ added in v1.12.0
type RepeaterUntilProcess struct {
// contains filtered or unexported fields
}
func (RepeaterUntilProcess) Open ¶ added in v1.12.0
func (p RepeaterUntilProcess) Open() error
func (RepeaterUntilProcess) ProcessDictionary ¶ added in v1.12.0
func (p RepeaterUntilProcess) ProcessDictionary(dictionary Dictionary, out Collector) error
type SeedType ¶ added in v1.13.0
type SeedType struct {
Field string `` /* 173-byte string literal not displayed */
}
type SegmentType ¶ added in v1.30.0
type SegmentType struct {
Regex string `yaml:"regex" json:"regex" jsonschema_description:"regex used to create segments using group captures, groups must be named"`
Match map[string][]MaskType `yaml:"match" json:"match" jsonschema_description:"list of masks to execute for each group if the regex matched"`
NoMatch []MaskType `` /* 141-byte string literal not displayed */
}
type Selector ¶
type Selector interface {
Apply(Dictionary, ...Applier) bool
ApplyContext(Dictionary, ...Applier) bool
// old interface
Delete(Dictionary) Dictionary
ReadContext(Dictionary) (Dictionary, string, bool)
WriteContext(Dictionary, Entry) Dictionary
Read(Dictionary) (Entry, bool)
Write(Dictionary, Entry) Dictionary
fmt.Stringer
}
func NewPackedPathSelector ¶ added in v1.19.0
type SelectorType ¶
type SelectorType struct {
Jsonpath string `yaml:"jsonpath" json:"jsonpath" jsonschema_description:"Path of the target value to mask in the JSON input"`
}
type SequenceType ¶ added in v1.24.0
type SimplePipeline ¶
type SimplePipeline struct {
// contains filtered or unexported fields
}
func (SimplePipeline) AddSink ¶
func (pipeline SimplePipeline) AddSink(sink SinkProcess) SinkedPipeline
func (SimplePipeline) Close ¶ added in v1.31.1
func (pipeline SimplePipeline) Close() error
func (SimplePipeline) Open ¶
func (pipeline SimplePipeline) Open() error
func (SimplePipeline) Process ¶
func (pipeline SimplePipeline) Process(process Processor) Pipeline
func (SimplePipeline) Source ¶ added in v1.19.0
func (pipeline SimplePipeline) Source() Source
func (SimplePipeline) Values ¶ added in v1.31.1
func (pipeline SimplePipeline) Values() iter.Seq2[Entry, error]
func (SimplePipeline) WithSource ¶
func (pipeline SimplePipeline) WithSource(source Source) Pipeline
type SimpleSinkedPipeline ¶
type SimpleSinkedPipeline struct {
// contains filtered or unexported fields
}
func (SimpleSinkedPipeline) Run ¶
func (pipeline SimpleSinkedPipeline) Run() (err error)
type SinkProcess ¶
SinkProcess send Dictionary process by Pipeline to an output
func NewSinkToCache ¶
func NewSinkToCache(cache Cache) SinkProcess
func NewSinkToSlice ¶
func NewSinkToSlice(dictionaries *[]Entry) SinkProcess
type SinkToCache ¶
type SinkToCache struct {
// contains filtered or unexported fields
}
func (*SinkToCache) Open ¶
func (sink *SinkToCache) Open() error
func (*SinkToCache) ProcessDictionary ¶
func (sink *SinkToCache) ProcessDictionary(entry Entry) error
type SinkToSlice ¶
type SinkToSlice struct {
// contains filtered or unexported fields
}
func (*SinkToSlice) Open ¶
func (sink *SinkToSlice) Open() error
func (*SinkToSlice) ProcessDictionary ¶
func (sink *SinkToSlice) ProcessDictionary(dictionary Entry) error
type SinkedPipeline ¶
type SinkedPipeline interface {
Run() error
}
type SliceSource ¶ added in v1.31.1
type SliceSource struct {
// contains filtered or unexported fields
}
SliceSource is a source of dictionaries from a slice. It implements the Iterable and Resource interfaces.
func (*SliceSource) Close ¶ added in v1.31.1
func (s *SliceSource) Close() error
Close closes the source.
func (*SliceSource) Open ¶ added in v1.31.1
func (s *SliceSource) Open() error
Open opens the source.
type Source ¶
Source is an iterator over Entry
func NewSliceSource ¶ added in v1.31.1
func NewSliceSource(data []Dictionary) Source
NewSliceSource creates a new slice source from the given data.
func NewSourceFromSlice ¶
func NewSourceFromSlice(dictionaries []Dictionary) Source
type TempSource ¶ added in v1.12.0
type TempSource struct {
// contains filtered or unexported fields
}
func NewTempSource ¶ added in v1.12.0
func NewTempSource(sourceValue Source) *TempSource
func (*TempSource) Close ¶ added in v1.31.1
func (s *TempSource) Close() error
func (*TempSource) Open ¶ added in v1.12.0
func (s *TempSource) Open() error
type TemplateEachType ¶ added in v1.7.0
type TimeLineConstraintType ¶ added in v1.23.0
type TimeLinePointType ¶ added in v1.23.0
type TimeLinePointType struct {
Name string `yaml:"name" json:"name" jsonschema_description:"Name of the point in the timeline"`
From string `` /* 133-byte string literal not displayed */
Min string `yaml:"min" json:"min" jsonschema_description:"Minimum shift relative to the reference point (ISO 8601 notation)"`
Max string `yaml:"max" json:"max" jsonschema_description:"Maximum shift relative to the reference point (ISO 8601 notation)"`
Constraints []TimeLineConstraintType `yaml:"constraints,omitempty" json:"constraints,omitempty" jsonschema_description:"List of constraints to fulfill"`
Default string `` /* 173-byte string literal not displayed */
}
type TimeLineStartType ¶ added in v1.23.0
type TimeLineType ¶ added in v1.23.0
type TimeLineType struct {
Start TimeLineStartType `yaml:"start" json:"start" jsonschema_description:"Origin of the timeline"`
Format string `` /* 207-byte string literal not displayed */
Points []TimeLinePointType `yaml:"points" json:"points" jsonschema_description:"List of points in the timeline"`
MaxRetry *int `` /* 142-byte string literal not displayed */
Epsilon string `` /* 133-byte string literal not displayed */
}
type TranscodeType ¶ added in v1.13.0
type TranscodeType struct {
Classes []Class `` /* 146-byte string literal not displayed */
}
type TruePredicate ¶ added in v1.31.1
type TruePredicate struct{}
func (TruePredicate) Error ¶ added in v1.31.1
func (TruePredicate) Error() error
func (TruePredicate) Reset ¶ added in v1.31.1
func (TruePredicate) Reset() error
func (TruePredicate) Test ¶ added in v1.31.1
func (TruePredicate) Test(Entry) bool
type UniqueCache ¶
func NewUniqueMemCache ¶
func NewUniqueMemCache() UniqueCache
type UniqueMaskCacheEngine ¶
type UniqueMaskCacheEngine struct {
// contains filtered or unexported fields
}
func NewUniqueMaskCacheEngine ¶
func NewUniqueMaskCacheEngine(cache UniqueCache, original MaskEngine) UniqueMaskCacheEngine
func (UniqueMaskCacheEngine) Mask ¶
func (umce UniqueMaskCacheEngine) Mask(e Entry, context ...Dictionary) (Entry, error)
Mask masks run mask with cache
type UniqueMaskContextCacheEngine ¶ added in v1.11.0
type UniqueMaskContextCacheEngine struct {
// contains filtered or unexported fields
}
func NewUniqueMaskContextCacheEngine ¶ added in v1.11.0
func NewUniqueMaskContextCacheEngine(cache UniqueCache, original MaskContextEngine) UniqueMaskContextCacheEngine
func (UniqueMaskContextCacheEngine) MaskContext ¶ added in v1.11.0
func (umcce UniqueMaskContextCacheEngine) MaskContext(context Dictionary, key string, contexts ...Dictionary, ) (Dictionary, error)
MaskContext masks run mask with cache
type UniqueMemCache ¶
type UniqueMemCache struct {
MemCache
// contains filtered or unexported fields
}
func (*UniqueMemCache) Put ¶ added in v1.23.0
func (mc *UniqueMemCache) Put(key Entry, value Entry)
type UnpackProcess ¶ added in v1.19.0
type UnpackProcess struct{}
UnpackProcess will unpack the jsonline data from a wrapper {"": <jsonline>}
func NewUnpackProcess ¶ added in v1.19.0
func NewUnpackProcess() *UnpackProcess
func (*UnpackProcess) Open ¶ added in v1.19.0
func (up *UnpackProcess) Open() error
func (*UnpackProcess) ProcessDictionary ¶ added in v1.19.0
func (up *UnpackProcess) ProcessDictionary(dictionary Dictionary, out Collector) error