Documentation
¶
Overview ¶
Package ldmigration contains general types used by LaunchDarkly SDK components to support technology migrations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsistencyCheck ¶
type ConsistencyCheck struct {
// contains filtered or unexported fields
}
ConsistencyCheck records the results of a consistency check and the ratio at which the check was sampled.
For example, a sampling ratio of 10 indicts this consistency check was sampled approximately once every ten operations.
func NewConsistencyCheck ¶
func NewConsistencyCheck(wasConsistent bool, samplingRatio int) *ConsistencyCheck
NewConsistencyCheck creates a new consistency check reflecting the provided values.
func (ConsistencyCheck) Consistent ¶
func (c ConsistencyCheck) Consistent() bool
Consistent returns whether or not the check returned a consistent result.
func (ConsistencyCheck) SamplingRatio ¶
func (c ConsistencyCheck) SamplingRatio() int
SamplingRatio returns the 1 in x sampling ratio used to determine if the consistency check should be run.
type ExecutionOrder ¶
type ExecutionOrder string
ExecutionOrder represents the various execution modes this SDK can operate under while performing migration-assisted reads.
const ( // Serial execution ensures the authoritative read will always complete execution before executing the // non-authoritative read. Serial ExecutionOrder = "serial" // Random execution randomly decides if the authoritative read should execute first or second. Random ExecutionOrder = "random" // Concurrent executes both reads in separate go routines, and waits until both calls have finished before // proceeding. Concurrent ExecutionOrder = "concurrent" )
type Operation ¶
type Operation string
Operation represents a type of migration operation; namely, read or write.
type Origin ¶
type Origin string
Origin represents the source of origin for a migration-related operation.
type Stage ¶
type Stage string
Stage denotes one of six possible stages a technology migration could be a part of, progressing through the following order.
Off -> DualWrite -> Shadow -> Live -> RampDown -> Complete
const ( // Off - migration hasn't started, "old" is authoritative for reads and writes Off Stage = "off" // DualWrite - write to both "old" and "new", "old" is authoritative for reads DualWrite Stage = "dualwrite" // Shadow - both "new" and "old" versions run with a preference for "old" Shadow Stage = "shadow" // Live - both "new" and "old" versions run with a preference for "new" Live Stage = "live" // RampDown - only read from "new", write to "old" and "new" RampDown Stage = "rampdown" // Complete - migration is done Complete Stage = "complete" )
func ParseStage ¶
ParseStage parses a MigrationStage from a string, or returns an error if the stage is unrecognized.