Documentation ¶
Index ¶
- func FromFile(migrationVersion *string, serializable *serializers.SplitYAML) (migrations.IMigration, error)
- func IsFeatureGateFromName(name string) bool
- func New(name *string, weights *Weights, owner *string) (migrations.IMigration, error)
- type ISplitMigration
- type Split
- func (s *Split) ApplyToSchema(schema *serializers.Schema, migrationRepo migrations.Repository, ...) error
- func (s *Split) File() *serializers.MigrationFile
- func (s *Split) Filename() *string
- func (s *Split) MigrationVersion() *string
- func (s *Split) ResourceKey() SplitKey
- func (s *Split) SameResourceAs(other migrations.IMigration) bool
- func (s *Split) Serializable() interface{}
- func (s *Split) SyncPath() string
- func (s *Split) Validate() error
- func (s *Split) Weights() *Weights
- type SplitKey
- type Weights
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromFile ¶
func FromFile(migrationVersion *string, serializable *serializers.SplitYAML) (migrations.IMigration, error)
FromFile reifies a migration from the yaml serializable representation
func IsFeatureGateFromName ¶ added in v1.0.0
IsFeatureGateFromName returns true if name ends with '_enabled'
func New ¶
func New(name *string, weights *Weights, owner *string) (migrations.IMigration, error)
New returns a migration object
Types ¶
type ISplitMigration ¶
type ISplitMigration interface {
ResourceKey() SplitKey
}
ISplitMigration defines the interface that allows split-impacting migration types to determine whether they operate on the same split
type Split ¶
type Split struct {
// contains filtered or unexported fields
}
Split represents a feature we're marking (un)completed
func MostRecentNamed ¶
func MostRecentNamed(name, migrationVersion string, migrationRepo migrations.Repository) *Split
MostRecentNamed returns the most recent matching migration in a repo
func (*Split) ApplyToSchema ¶
func (s *Split) ApplyToSchema(schema *serializers.Schema, migrationRepo migrations.Repository, _idempotently bool) error
ApplyToSchema applies a migrations changes to in-memory schema representation
func (*Split) File ¶
func (s *Split) File() *serializers.MigrationFile
File returns a serializable MigrationFile for this migration
func (*Split) MigrationVersion ¶
MigrationVersion returns the migration version
func (*Split) ResourceKey ¶
ResourceKey returns the natural key of the resource under migration
func (*Split) SameResourceAs ¶
func (s *Split) SameResourceAs(other migrations.IMigration) bool
SameResourceAs returns whether the migrations refer to the same TestTrack resource
func (*Split) Serializable ¶
func (s *Split) Serializable() interface{}
Serializable returns a JSON-serializable representation
type SplitKey ¶
type SplitKey string
SplitKey is the resource key for migrations impacting split state
type Weights ¶
Weights represents the weightings of a split
func WeightsFromString ¶
WeightsFromString parses a `variant: 0, another_variant: 100`-style string into a weights map
func WeightsFromYAML ¶
WeightsFromYAML converts YAML-serializable weights to a weights map
func (*Weights) ReweightToDecision ¶
ReweightToDecision sets weights to 100% one variant