Documentation ¶
Index ¶
Constants ¶
const ( // DefaultOrchestrator is The default orchestrator to // use to run the Declaration DefaultOrchestrator = "split" // DefaultAssignment The default assignment method to use // when classifying parameter sets into a variant group DefaultAssignment = "uniform" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Assignment ¶
Assignment is the interface any randomization operator should implement to be pluggable into an Declaration such that the operator type can be replaced
type Declaration ¶
type Declaration struct { ID uuid.UUID `json:"id"` Orchestrator string `yaml:"orchestrator" json:"orchestrator"` Target target.Target `yaml:"target" json:"target"` // Declaration Name Name string `yaml:"name" json:"name"` // Salt Salt string `yaml:"salt" json:"salt"` // Assignment Algorithm to use // Defaults to uniform Assignment string `yaml:"assignment" json:"assignment"` Operator Assignment `json:"-" yaml:"-"` // Event is a name for annotating // and labeling Declaration data that is // emitted and relevant to the running Declaration Event string `yaml:"event" json:"event"` // Control alerts that we want to run an A/A // defaults to false Control bool `yaml:"control" json:"control"` // Provider is the target implementation // to use (ie: ec2, lambda, k8s) Provider string `yaml:"provider" json:"provider"` // Label all resources with the Declaration and variant // configuration, defaults to true AutoLabel bool `yaml:"autolabel" json:"autolabel"` // Parameters are the input parameter fields to be used // for segmenting and bucketing users Parameters parameters.Parameters `yaml:"parameters" json:"parameters"` // Probes are a collection of probes to evaluate the state of // the Declaration Probes []*probe.Probe `yaml:"probes" json:"probes"` // Guards are a collection of guards with which to // protect the safety and control of the Declaration Guards []*guard.Guard `yaml:"guards" json:"guards"` Variants []*variant.Variant `yaml:"variants" json:"variants"` }
Declaration is the definition of a designed Declaration
func NewDeclaration ¶
func NewDeclaration() Declaration
NewDeclaration returns a instantiated Declaration with defaults
func (*Declaration) Assign ¶
func (e *Declaration) Assign(p parameters.Parameters) (*variant.Variant, error)
Assign takes a specific parameter set and returns the variant assignment for said parameter set
func (*Declaration) Hash ¶
func (e *Declaration) Hash(p parameters.Parameters) uint64
Hash returns the hash int64 representation of the sha1 crypto value for the full list of segments for using to determine an assignment
func (*Declaration) HashString ¶
func (e *Declaration) HashString(p parameters.Parameters) string
HashString returns the hash string representation of the sha1 crypto value for the full list of segments for using to determine an assignment
func (*Declaration) String ¶
func (e *Declaration) String() string
String returns the segments of the hashable string that represents input to the assignment operator for randomization