Documentation
¶
Index ¶
- Variables
- func FormatCommandError(err error) string
- func Run(opts Options) (string, error)
- type DiffDataCorpora
- type DiffEntry
- type DiffEntryKind
- type DiffFieldChange
- type DiffResult
- type DiffSnapshots
- type LogicalDatabase
- type LogicalDatabaseBuildError
- type LogicalDatabaseErrorKind
- type LogicalObject
- type LogicalObjectSource
- type Options
- type SnapshotDataCorpus
- type SnapshotDataFile
- type SnapshotKind
- type SnapshotRef
- type WorkingTreeView
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrTooManyArgs = errors.New("diff accepts at most 2 snapshot arguments")
Functions ¶
func FormatCommandError ¶
Types ¶
type DiffDataCorpora ¶
type DiffDataCorpora struct {
Paths []string
Left SnapshotDataCorpus
Right SnapshotDataCorpus
}
type DiffEntry ¶
type DiffEntry struct {
Kind DiffEntryKind
Type string
ObjectID string
OldValue map[string]any
NewValue map[string]any
FieldChanges []DiffFieldChange
OldSources []LogicalObjectSource
NewSources []LogicalObjectSource
}
type DiffEntryKind ¶
type DiffEntryKind string
const ( DiffEntryKindAdded DiffEntryKind = "added" DiffEntryKindRemoved DiffEntryKind = "removed" DiffEntryKindModified DiffEntryKind = "modified" DiffEntryKindRelocated DiffEntryKind = "relocated" )
type DiffFieldChange ¶
type DiffResult ¶
type DiffResult struct {
Entries []DiffEntry
}
type DiffSnapshots ¶
type DiffSnapshots struct {
Left SnapshotRef
Right SnapshotRef
}
type LogicalDatabase ¶
type LogicalDatabase struct {
Snapshot SnapshotRef
Objects []LogicalObject
}
LogicalDatabase is the normalized repository-wide data model used by diff.
Invariants:
- object identity is derived from Mergeway semantics, never file path
- source paths are preserved as metadata for rendering and future merge work
- object ordering is deterministic so downstream diff/render steps stay stable
type LogicalDatabaseBuildError ¶
type LogicalDatabaseBuildError struct {
Kind LogicalDatabaseErrorKind
Snapshot SnapshotRef
TypeName string
ObjectID string
Path string
Selector string
Err error
}
func (*LogicalDatabaseBuildError) Error ¶
func (e *LogicalDatabaseBuildError) Error() string
func (*LogicalDatabaseBuildError) Unwrap ¶
func (e *LogicalDatabaseBuildError) Unwrap() error
type LogicalDatabaseErrorKind ¶
type LogicalDatabaseErrorKind string
const ( LogicalDatabaseErrorParse LogicalDatabaseErrorKind = "parse" LogicalDatabaseErrorInvalidObject LogicalDatabaseErrorKind = "invalid_object" LogicalDatabaseErrorIdentityCollision LogicalDatabaseErrorKind = "identity_collision" )
type LogicalObject ¶
type LogicalObjectSource ¶
type SnapshotDataCorpus ¶
type SnapshotDataCorpus struct {
Snapshot SnapshotRef
Schema *diffSnapshotSchema
Files []SnapshotDataFile
}
type SnapshotDataFile ¶
type SnapshotKind ¶
type SnapshotKind string
const ( SnapshotKindHead SnapshotKind = "head" SnapshotKindRevision SnapshotKind = "revision" SnapshotKindWorkingTree SnapshotKind = "working_tree" )
type SnapshotRef ¶
type SnapshotRef struct {
Kind SnapshotKind
Revision string
WorkingTreeView WorkingTreeView
}
func (SnapshotRef) String ¶
func (s SnapshotRef) String() string
type WorkingTreeView ¶
type WorkingTreeView string
const ( WorkingTreeViewFull WorkingTreeView = "full" WorkingTreeViewUnstaged WorkingTreeView = "unstaged" WorkingTreeViewUnspecified WorkingTreeView = "" )
Click to show internal directories.
Click to hide internal directories.