Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Factory ¶
func Factory(conf model.MaskFactoryConfiguration) (model.MaskEngine, bool, error)
Factory create a mask from a yaml config
Types ¶
type Choice ¶
type Choice struct { Item interface{} Weight uint }
Choice is a wrapper of item and its weight
type Chooser ¶
type Chooser struct {
// contains filtered or unexported fields
}
A Chooser is to choose a Choice by weight
func NewChooser ¶
NewChooser creates a Chooser from Choices
type MaskEngine ¶
type MaskEngine struct {
// contains filtered or unexported fields
}
MaskEngine a list of masking value with weight for random
func NewMask ¶
func NewMask(list []model.WeightedChoiceType, seed int64, seeder model.Seeder) MaskEngine
NewMask returns a WeightedMaskList from slice of model.Entry and weights
func (MaskEngine) Mask ¶
func (wml MaskEngine) Mask(e model.Entry, context ...model.Dictionary) (model.Entry, error)
Mask choose a mask value randomly
Click to show internal directories.
Click to hide internal directories.