mutation

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RestoreFromBackup

func RestoreFromBackup(path, backupPath string) (int, error)

RestoreFromBackup atomically overwrites path with the contents of backupPath, returning the number of bytes restored. It is the inverse of the .bak written by WriteWithBackup, used to recover from a committed write.

func WriteWithBackup

func WriteWithBackup(path string, updated []byte) (string, error)

Types

type AssetSetRequest

type AssetSetRequest struct {
	Path    string
	HasID   bool
	ID      int64
	Field   string
	Value   string
	Rewrite bool
}

type AssetSetResult

type AssetSetResult struct {
	Field       string
	OldValue    string
	NewValue    string
	TypeHint    string
	Changed     bool
	UpdatedData []byte
}

func PlanAssetSet

func PlanAssetSet(input []byte, blocks []parser.Block, req AssetSetRequest) (AssetSetResult, error)

type CommittedWriteError

type CommittedWriteError struct {
	Path string
	Err  error
}

func (*CommittedWriteError) Error

func (e *CommittedWriteError) Error() string

func (*CommittedWriteError) Unwrap

func (e *CommittedWriteError) Unwrap() error

func (*CommittedWriteError) WriteCommitted

func (e *CommittedWriteError) WriteCommitted() bool

type PrefabSetRequest

type PrefabSetRequest struct {
	Path    string
	HasID   bool
	ID      int64
	Field   string
	Value   string
	Rewrite bool
}

type PrefabSetResult

type PrefabSetResult struct {
	Field       string
	OldValue    string
	NewValue    string
	TypeHint    string
	Changed     bool
	UpdatedData []byte
}

func PlanPrefabSet

func PlanPrefabSet(input []byte, blocks []parser.Block, req PrefabSetRequest) (PrefabSetResult, error)

type SceneApplyPlan

type SceneApplyPlan struct {
	Status          patch.Status
	Operation       string
	Reason          string
	AppendOps       int
	ReservedIDs     []int64
	Changed         bool
	Verified        bool
	BackupPath      string
	ExpectedObjects int
	ActualObjects   int
	UpdatedData     []byte
}

func ApplyScene

func ApplyScene(req SceneApplyRequest, plan SceneApplyPlan) (SceneApplyPlan, error)

func PlanSceneApply

func PlanSceneApply(input []byte, req SceneApplyRequest) (SceneApplyPlan, error)

type SceneApplyRequest

type SceneApplyRequest struct {
	ScenePath string
	PatchPath string
	Envelope  patch.File
	Write     bool
}

type SceneDiffResult

type SceneDiffResult struct {
	Status      patch.Status
	Operation   string
	Reason      string
	AppendOps   int
	ReservedIDs []int64
	OverlapIDs  []int64
}

func DescribeScenePatch

func DescribeScenePatch(req SceneApplyRequest) (SceneDiffResult, error)

Jump to

Keyboard shortcuts

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