model

package
v1.13.0-beta5 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NOTHING Action = iota
	WRITE          = iota
	DELETE         = iota
)

Action types

Variables

This section is empty.

Functions

func BuildCaches

func BuildCaches(caches map[string]CacheDefinition, existing map[string]Cache) map[string]Cache

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 InjectConfig(skipLineOnErrorValue bool, skipFieldOnErrorValue bool)

func InjectMaskContextFactories

func InjectMaskContextFactories(factories []MaskContextFactory)

func InjectMaskFactories

func InjectMaskFactories(factories []MaskFactory)

func UnorderedTypes added in v1.5.0

func UnorderedTypes(inter interface{}) interface{}

UnorderedTypes a composition of map[string]Entry

func Untyped added in v1.12.0

func Untyped(inter interface{}) interface{}

Types

type Action

type Action uint

type Applier

type Applier func(rootContext Dictionary, parentContext Dictionary, key string, value Entry) (Action, Entry)

type Cache

type Cache interface {
	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 CacheDefinition struct {
	Unique  bool `yaml:"unique,omitempty"`
	Reverse bool `yaml:"reverse,omitempty"`
}

type Class added in v1.13.0

type Class struct {
	Input  string `yaml:"input"`
	Output string `yaml:"output"`
}

type Collector

type Collector interface {
	Collect(Dictionary)
}

Collector collect Dictionary generate by Process

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 DateParserType struct {
	InputFormat  string `yaml:"inputFormat,omitempty"`
	OutputFormat string `yaml:"outputFormat,omitempty"`
}

type Definition

type Definition struct {
	Version string                     `yaml:"version"`
	Seed    int64                      `yaml:"seed,omitempty"`
	Masking []Masking                  `yaml:"masking"`
	Caches  map[string]CacheDefinition `yaml:"caches,omitempty"`
}

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)

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 (Dictionary) Copy added in v1.5.0

func (d Dictionary) Copy() Dictionary

func (Dictionary) String added in v1.5.0

func (d Dictionary) String() string

func (Dictionary) Unordered added in v1.5.0

func (d Dictionary) Unordered() map[string]Entry

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 Entry

type Entry interface{}

type FF1Type

type FF1Type struct {
	KeyFromEnv string `yaml:"keyFromEnv"`
	TweakField string `yaml:"tweakField,omitempty"`
	Radix      uint   `yaml:"radix,omitempty"`
	Decrypt    bool   `yaml:"decrypt,omitempty"`
}

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 IncrementalType struct {
	Start     int `yaml:"start"`
	Increment int `yaml:"increment"`
}

type LuhnType added in v1.10.0

type LuhnType struct {
	Universe string `yaml:"universe,omitempty"`
}

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"`
	Sample    string `yaml:"sample,omitempty"`
	Separator string `yaml:"separator,omitempty"`
	Order     int    `yaml:"order,omitempty"`
}

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(Masking, int64, map[string]Cache) (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(Masking, int64, map[string]Cache) (MaskEngine, bool, error)

type MaskType

type MaskType struct {
	Add               Entry                `yaml:"add,omitempty" jsonschema:"oneof_required=Add"`
	AddTransient      Entry                `yaml:"add-transient,omitempty" jsonschema:"oneof_required=AddTransient"`
	Constant          Entry                `yaml:"constant,omitempty" jsonschema:"oneof_required=Constant"`
	RandomChoice      []Entry              `yaml:"randomChoice,omitempty" jsonschema:"oneof_required=RandomChoice"`
	RandomChoiceInURI string               `yaml:"randomChoiceInUri,omitempty" jsonschema:"oneof_required=RandomChoiceInURI"`
	Command           string               `yaml:"command,omitempty" jsonschema:"oneof_required=Command"`
	RandomInt         RandIntType          `yaml:"randomInt,omitempty" jsonschema:"oneof_required=RandomInt"`
	WeightedChoice    []WeightedChoiceType `yaml:"weightedChoice,omitempty" jsonschema:"oneof_required=WeightedChoice"`
	Regex             string               `yaml:"regex,omitempty" jsonschema:"oneof_required=Regex"`
	Hash              []Entry              `yaml:"hash,omitempty" jsonschema:"oneof_required=Hash"`
	HashInURI         string               `yaml:"hashInUri,omitempty" jsonschema:"oneof_required=HashInURI"`
	RandDate          RandDateType         `yaml:"randDate,omitempty" jsonschema:"oneof_required=RandDate"`
	Incremental       IncrementalType      `yaml:"incremental,omitempty" jsonschema:"oneof_required=Incremental"`
	Replacement       string               `yaml:"replacement,omitempty" jsonschema:"oneof_required=Replacement"`
	Template          string               `yaml:"template,omitempty" jsonschema:"oneof_required=Template"`
	TemplateEach      TemplateEachType     `yaml:"template-each,omitempty" jsonschema:"oneof_required=TemplateEach"`
	Duration          string               `yaml:"duration,omitempty" jsonschema:"oneof_required=Duration"`
	Remove            bool                 `yaml:"remove,omitempty" jsonschema:"oneof_required=Remove"`
	RangeMask         int                  `yaml:"range,omitempty" jsonschema:"oneof_required=RangeMask"`
	RandomDuration    RandomDurationType   `yaml:"randomDuration,omitempty" jsonschema:"oneof_required=RandomDuration"`
	FluxURI           string               `yaml:"fluxUri,omitempty" jsonschema:"oneof_required=FluxURI"`
	RandomDecimal     RandomDecimalType    `yaml:"randomDecimal,omitempty" jsonschema:"oneof_required=RandomDecimal"`
	DateParser        DateParserType       `yaml:"dateParser,omitempty" jsonschema:"oneof_required=DateParser"`
	FromCache         string               `yaml:"fromCache,omitempty" jsonschema:"oneof_required=FromCache"`
	FF1               FF1Type              `yaml:"ff1,omitempty" jsonschema:"oneof_required=FF1"`
	Pipe              PipeType             `yaml:"pipe,omitempty" jsonschema:"oneof_required=Pipe"`
	FromJSON          string               `yaml:"fromjson,omitempty" jsonschema:"oneof_required=FromJSON"`
	Luhn              *LuhnType            `yaml:"luhn,omitempty" jsonschema:"oneof_required=Luhn"`
	Markov            MarkovType           `yaml:"markov,omitempty" jsonschema:"oneof_required=Markov"`
	Transcode         *TranscodeType       `yaml:"transcode,omitempty" jsonschema:"oneof_required=Transcode"`
}

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   `yaml:"selector,omitempty" jsonschema:"oneof_required=case1,oneof_required=case2"`
	Selectors []SelectorType `yaml:"selectors,omitempty" jsonschema:"oneof_required=case3,oneof_required=case4"`
	Mask      MaskType       `yaml:"mask,omitempty" jsonschema:"oneof_required=case1,oneof_required=case3"`
	Masks     []MaskType     `yaml:"masks,omitempty" jsonschema:"oneof_required=case2,oneof_required=case4"`
	Cache     string         `yaml:"cache,omitempty"`
	Preserve  string         `yaml:"preserve,omitempty"`
	Seed      SeedType       `yaml:"seed,omitempty"`
}

type MemCache

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

MemCache is a cache in memory

func (*MemCache) Get

func (mc *MemCache) Get(key Entry) (Entry, bool)

func (*MemCache) Iterate

func (mc *MemCache) Iterate() Source

func (*MemCache) Put

func (mc *MemCache) Put(key Entry, value Entry)

func (*MemCache) Subscribe

func (mc *MemCache) Subscribe(key Entry, observer Observer)

type Observer

type Observer interface {
	Notify(key Entry, value Entry)
}

type PipeType

type PipeType struct {
	Masking        []Masking `yaml:"masking,omitempty"`
	InjectParent   string    `yaml:"injectParent,omitempty"`
	InjectRoot     string    `yaml:"injectRoot,omitempty"`
	DefinitionFile string    `yaml:"file,omitempty"`
}

type Pipeline

type Pipeline interface {
	Process(Processor) Pipeline
	WithSource(Source) Pipeline
	AddSink(SinkProcess) SinkedPipeline
}

func BuildPipeline

func BuildPipeline(pipeline Pipeline, conf Definition, caches map[string]Cache) (Pipeline, map[string]Cache, error)

func NewPipeline

func NewPipeline(source Source) Pipeline

func NewPipelineFromSlice

func NewPipelineFromSlice(dictionaries []Dictionary) Pipeline

func NewProcessPipeline

func NewProcessPipeline(source Source, process Processor) Pipeline

type ProcessPipeline

type ProcessPipeline struct {
	Processor
	// contains filtered or unexported fields
}

func (*ProcessPipeline) AddSink

func (p *ProcessPipeline) AddSink(sink SinkProcess) SinkedPipeline

func (*ProcessPipeline) Err

func (p *ProcessPipeline) Err() error

func (*ProcessPipeline) Next

func (p *ProcessPipeline) Next() bool

func (*ProcessPipeline) Process

func (p *ProcessPipeline) Process(process Processor) Pipeline

func (*ProcessPipeline) Value

func (p *ProcessPipeline) Value() Dictionary

func (*ProcessPipeline) WithSource

func (p *ProcessPipeline) WithSource(source Source) Pipeline

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 NewCounterProcess(contextName string, initValue int) Processor

func NewCounterProcessWithCallback added in v1.4.0

func NewCounterProcessWithCallback(contextName string, initValue int, updater func(int)) Processor

func NewDeleteMaskEngineProcess

func NewDeleteMaskEngineProcess(selector Selector) Processor

func NewFromCacheProcess

func NewFromCacheProcess(selector Selector, cache Cache, preserve string) Processor

func NewMapProcess

func NewMapProcess(mapper Mapper) Processor

func NewMaskContextEngineProcess

func NewMaskContextEngineProcess(selector Selector, mask MaskContextEngine) Processor

func NewMaskEngineProcess

func NewMaskEngineProcess(selector Selector, mask MaskEngine, preserve string) Processor

func NewRepeaterProcess

func NewRepeaterProcess(times int) Processor

func NewRepeaterUntilProcess added in v1.12.0

func NewRepeaterUntilProcess(source *TempSource, text, mode string) (Processor, error)

type QueueCollector

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

func NewCollector

func NewCollector() *QueueCollector

func (*QueueCollector) Collect

func (c *QueueCollector) Collect(dictionary Dictionary)

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() Dictionary

type RandDateType

type RandDateType struct {
	DateMin time.Time `yaml:"dateMin"`
	DateMax time.Time `yaml:"dateMax"`
}

type RandIntType

type RandIntType struct {
	Min int `yaml:"min"`
	Max int `yaml:"max"`
}

type RandomDecimalType

type RandomDecimalType struct {
	Min       float64
	Max       float64
	Precision int
}

type RandomDurationType

type RandomDurationType struct {
	Min string
	Max string
}

type RepeaterProcess

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

func (RepeaterProcess) Open

func (p RepeaterProcess) Open() error

func (RepeaterProcess) ProcessDictionary

func (p RepeaterProcess) ProcessDictionary(dictionary Dictionary, out Collector) error

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 `yaml:"field,omitempty"`
}

type Seeder added in v1.13.0

type Seeder func(Dictionary) (int64, bool, error)

func NewSeeder added in v1.13.0

func NewSeeder(conf Masking, seed int64) Seeder

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 NewPathSelector

func NewPathSelector(path string) Selector

type SelectorType

type SelectorType struct {
	Jsonpath string `yaml:"jsonpath"`
}

type SimplePipeline

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

func (SimplePipeline) AddSink

func (pipeline SimplePipeline) AddSink(sink SinkProcess) SinkedPipeline

func (SimplePipeline) Err

func (pipeline SimplePipeline) Err() error

func (SimplePipeline) Next

func (pipeline SimplePipeline) Next() bool

func (SimplePipeline) Open

func (pipeline SimplePipeline) Open() error

func (SimplePipeline) Process

func (pipeline SimplePipeline) Process(process Processor) Pipeline

func (SimplePipeline) Value

func (pipeline SimplePipeline) Value() Dictionary

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

type SinkProcess interface {
	Open() error
	ProcessDictionary(Dictionary) error
}

SinkProcess send Dictionary process by Pipeline to an output

func NewSinkToCache

func NewSinkToCache(cache Cache) SinkProcess

func NewSinkToSlice

func NewSinkToSlice(dictionaries *[]Dictionary) 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(dictionary Dictionary) 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 Dictionary) error

type SinkedPipeline

type SinkedPipeline interface {
	Run() error
}

type Source

type Source interface {
	Open() error
	Next() bool
	Value() Dictionary
	Err() error
}

Source is an iterator over Dictionary

func NewSourceFromSlice

func NewSourceFromSlice(dictionaries []Dictionary) Source

func NewTempSource added in v1.12.0

func NewTempSource(sourceValue Source) Source

type SourceFromSlice

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

func (*SourceFromSlice) Err

func (source *SourceFromSlice) Err() error

func (*SourceFromSlice) Next

func (source *SourceFromSlice) Next() bool

func (*SourceFromSlice) Open

func (source *SourceFromSlice) Open() error

func (*SourceFromSlice) Value

func (source *SourceFromSlice) Value() Dictionary

type TempSource added in v1.12.0

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

func (*TempSource) Err added in v1.12.0

func (s *TempSource) Err() error

func (*TempSource) Next added in v1.12.0

func (s *TempSource) Next() bool

func (*TempSource) Open added in v1.12.0

func (s *TempSource) Open() error

func (*TempSource) Value added in v1.12.0

func (s *TempSource) Value() Dictionary

type TemplateEachType added in v1.7.0

type TemplateEachType struct {
	Item     string `yaml:"item,omitempty"`
	Index    string `yaml:"index,omitempty"`
	Template string `yaml:"template,omitempty"`
}

type TranscodeType added in v1.13.0

type TranscodeType struct {
	Classes []Class `yaml:"classes,omitempty"`
}

type UniqueCache

type UniqueCache interface {
	Cache
	PutUnique(key Entry, value Entry) bool
}

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) PutUnique

func (mc *UniqueMemCache) PutUnique(key Entry, value Entry) bool

type WeightedChoiceType

type WeightedChoiceType struct {
	Choice Entry `yaml:"choice"`
	Weight uint  `yaml:"weight"`
}

Jump to

Keyboard shortcuts

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