Documentation
¶
Overview ¶
Package ops implements the 14 migration operations.
Index ¶
- func ExecAddCollection(doc *tomledit.DocumentNode, op Op) error
- func ExecAddField(doc *tomledit.DocumentNode, op Op) error
- func ExecAppend(doc *tomledit.DocumentNode, op Op) error
- func ExecDropCollection(doc *tomledit.DocumentNode, op Op) error
- func ExecMergeDefaults(doc *tomledit.DocumentNode, op Op) error
- func ExecMergeDefaultsByKey(doc *tomledit.DocumentNode, op Op) error
- func ExecMoveField(doc *tomledit.DocumentNode, op Op) error
- func ExecRaw(doc *tomledit.DocumentNode, op Op) error
- func ExecRemoveField(doc *tomledit.DocumentNode, op Op) error
- func ExecRemoveWhere(doc *tomledit.DocumentNode, op Op) error
- func ExecRenameField(doc *tomledit.DocumentNode, op Op) error
- func ExecSetValue(doc *tomledit.DocumentNode, op Op) error
- func ExecSetValueWhere(doc *tomledit.DocumentNode, op Op) error
- func ExecTransform(doc *tomledit.DocumentNode, op Op) error
- func Execute(doc *tomledit.DocumentNode, op Op) error
- func Matches(item map[string]any, where any, mode MatchMode, index int, arrayLen int) bool
- type DownOp
- type MatchMode
- type Migration
- type Op
- type OpType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExecAddCollection ¶
func ExecAddCollection(doc *tomledit.DocumentNode, op Op) error
func ExecAddField ¶
func ExecAddField(doc *tomledit.DocumentNode, op Op) error
func ExecAppend ¶
func ExecAppend(doc *tomledit.DocumentNode, op Op) error
func ExecDropCollection ¶
func ExecDropCollection(doc *tomledit.DocumentNode, op Op) error
func ExecMergeDefaults ¶
func ExecMergeDefaults(doc *tomledit.DocumentNode, op Op) error
func ExecMergeDefaultsByKey ¶
func ExecMergeDefaultsByKey(doc *tomledit.DocumentNode, op Op) error
func ExecMoveField ¶
func ExecMoveField(doc *tomledit.DocumentNode, op Op) error
func ExecRemoveField ¶
func ExecRemoveField(doc *tomledit.DocumentNode, op Op) error
func ExecRemoveWhere ¶
func ExecRemoveWhere(doc *tomledit.DocumentNode, op Op) error
func ExecRenameField ¶
func ExecRenameField(doc *tomledit.DocumentNode, op Op) error
func ExecSetValue ¶
func ExecSetValue(doc *tomledit.DocumentNode, op Op) error
func ExecSetValueWhere ¶
func ExecSetValueWhere(doc *tomledit.DocumentNode, op Op) error
func ExecTransform ¶
func ExecTransform(doc *tomledit.DocumentNode, op Op) error
Types ¶
type Migration ¶
func ParseMigration ¶
type Op ¶
type Op struct {
Type OpType
Section string // "structure" or "data"
// Common
Path string
Down *DownOp
// add_field
FieldType string // "type" field from TOML
Default any
// rename_field, move_field
From string
To string
// add_collection
Fields map[string]any
// set_value, raw
Value any
Content string
// set_value_where, remove_where
Where any
MatchMode string
Set map[string]any
// transform
Expr string
// merge_defaults_by_key
MatchField string
Defaults []map[string]any
}
type OpType ¶
type OpType string
const ( OpAddField OpType = "add_field" OpRemoveField OpType = "remove_field" OpRenameField OpType = "rename_field" OpMoveField OpType = "move_field" OpAddCollection OpType = "add_collection" OpDropCollection OpType = "drop_collection" OpSetValue OpType = "set_value" OpSetValueWhere OpType = "set_value_where" OpRemoveWhere OpType = "remove_where" OpAppend OpType = "append" OpTransform OpType = "transform" OpMergeDefaults OpType = "merge_defaults" OpMergeDefaultsByKey OpType = "merge_defaults_by_key" OpRaw OpType = "raw" )
Click to show internal directories.
Click to hide internal directories.