migrate

package
v0.99.0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package migrate provides the functionality to take action on specific schema fields that are consumed by the translation package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttributeChangeSet

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

AttributeChangeSet represents an unscoped entry that can be applied.

The listed changes are duplicated twice to allow for simplified means of transition to or from a revision.

func NewAttributeChangeSet

func NewAttributeChangeSet(mappings ast.AttributeMap) *AttributeChangeSet

NewAttributeChangeSet allows for typed strings to be used as part of the invocation that will be converted into the default string type.

func (*AttributeChangeSet) Apply

func (a *AttributeChangeSet) Apply(attrs pcommon.Map) error

func (*AttributeChangeSet) Rollback

func (a *AttributeChangeSet) Rollback(attrs pcommon.Map) error

type AttributeChangeSetSlice

type AttributeChangeSetSlice []*AttributeChangeSet

AttributeChangeSetSlice allows for `AttributeChangeSet` to be chained together as they are defined within the schema and be applied sequentially to ensure deterministic behavior.

func NewAttributeChangeSetSlice

func NewAttributeChangeSetSlice(changes ...*AttributeChangeSet) *AttributeChangeSetSlice

NewAttributeChangeSetSlice combines all the provided `AttributeChangeSets` and allows them to be executed in the provided order.

func (*AttributeChangeSetSlice) Apply

func (slice *AttributeChangeSetSlice) Apply(attrs pcommon.Map) error

func (*AttributeChangeSetSlice) Rollback

func (slice *AttributeChangeSetSlice) Rollback(attrs pcommon.Map) error

type ConditionalAttributeSet

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

func NewConditionalAttributeSet

func NewConditionalAttributeSet[Match ValueMatch](mappings ast.AttributeMap, matches ...Match) *ConditionalAttributeSet

func (*ConditionalAttributeSet) Apply

func (ca *ConditionalAttributeSet) Apply(attrs pcommon.Map, values ...string) (errs error)

func (*ConditionalAttributeSet) Rollback

func (ca *ConditionalAttributeSet) Rollback(attrs pcommon.Map, values ...string) (errs error)

type ConditionalAttributeSetSlice

type ConditionalAttributeSetSlice []*ConditionalAttributeSet

func NewConditionalAttributeSetSlice

func NewConditionalAttributeSetSlice(conditions ...*ConditionalAttributeSet) *ConditionalAttributeSetSlice

func (*ConditionalAttributeSetSlice) Apply

func (slice *ConditionalAttributeSetSlice) Apply(attrs pcommon.Map, values ...string) error

func (*ConditionalAttributeSetSlice) Rollback

func (slice *ConditionalAttributeSetSlice) Rollback(attrs pcommon.Map, values ...string) error

type SignalNameChange

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

SignalNameChange allows for migrating types that implement the `alias.Signal` interface.

func NewSignalNameChange

func NewSignalNameChange[Key SignalType, Value SignalType](mappings map[Key]Value) *SignalNameChange

NewSignalNameChange will create a `Signal` that will check the provided mappings if it can update a `alias.Signal` and if no values are provided for `matches`, then all values will be updated.

func (*SignalNameChange) Apply

func (s *SignalNameChange) Apply(signal alias.NamedSignal)

func (*SignalNameChange) Rollback

func (s *SignalNameChange) Rollback(signal alias.NamedSignal)

type SignalNameChangeSlice

type SignalNameChangeSlice []*SignalNameChange

func NewSignalNameChangeSlice

func NewSignalNameChangeSlice(changes ...*SignalNameChange) *SignalNameChangeSlice

func (*SignalNameChangeSlice) Apply

func (slice *SignalNameChangeSlice) Apply(signal alias.NamedSignal)

func (*SignalNameChangeSlice) Rollback

func (slice *SignalNameChangeSlice) Rollback(signal alias.NamedSignal)

type SignalType

type SignalType interface {
	~string
}

SignalType allows for type constraints in order to apply to potential type defined strings.

type StateSelector

type StateSelector int
const (
	StateSelectorApply StateSelector
	StateSelectorRollback
)

type ValueMatch

type ValueMatch interface {
	~string
}

ValueMatch defines the expected match type that is used on creation of `ConditionalAttributeSet`

Jump to

Keyboard shortcuts

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