Documentation ¶
Index ¶
- func Assert(ctx context.Context, passes func() bool, header string, expect, have any)
- func AssertEqualTrees[ET, EL, RT, RL any](ctx context.Context, expect *Sanitree[ET, EL], result *Sanitree[RT, RL], ...)
- func CompareDiffTrees[ET, EL, RT, RL any](ctx context.Context, expect *Sanitree[ET, EL], result *Sanitree[RT, RL], ...)
- func CompareLeaves[ET, EL, RT, RL any](ctx context.Context, expect map[string]*Sanileaf[ET, EL], ...)
- func Debugf(ctx context.Context, tmpl string, vs ...any)
- func Fatal(ctx context.Context, msg string, err error)
- func FilterSlice(sl []string, remove string) []string
- func GetAC() (api.Client, error)
- func GetRelativePath(ctx context.Context, rootDir, p string, info fs.FileInfo, fileWalkerErr error) string
- func Infof(ctx context.Context, tmpl string, vs ...any)
- func IsWithinTimeBound(ctx context.Context, bound, check time.Time, hasTime bool) bool
- func MustGetTimeFromName(ctx context.Context, name string) (time.Time, bool)
- func SetDebug(ctx context.Context) context.Context
- type ContainerComparatorFn
- type Envs
- type LeafComparatorFn
- type NodeComparator
- type PermissionInfo
- type Sanileaf
- type Sanitree
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssertEqualTrees ¶
func CompareDiffTrees ¶
func CompareDiffTrees[ET, EL, RT, RL any]( ctx context.Context, expect *Sanitree[ET, EL], result *Sanitree[RT, RL], comparator NodeComparator[ET, EL, RT, RL], )
CompareDiffTrees recursively compares two sanitrees that have different data types. The two trees are expected to represent a common hierarchy.
Additional comparisons besides the tree hierarchy are optionally left to the caller by population of the NodeComparator func.
func CompareLeaves ¶
func FilterSlice ¶
func GetRelativePath ¶
func IsWithinTimeBound ¶
func MustGetTimeFromName ¶
Types ¶
type ContainerComparatorFn ¶
type Envs ¶
type LeafComparatorFn ¶
type NodeComparator ¶
type PermissionInfo ¶
type Sanitree ¶
type Sanitree[T, L any] struct { Parent *Sanitree[T, L] Self T ID string Name string // CountLeaves is the number of non-container child items. // Used for services that don't need full item metadata, and // just want a count of children. CountLeaves int // leaves are non-container child items. Used by services // that need more than just a count of items. // name (or equivalent) -> leaf Leaves map[string]*Sanileaf[T, L] // Children holds all child containers // name -> node Children map[string]*Sanitree[T, L] // Expand is an arbitrary k:v map of any data that is // uniquely scrutinized by a given service. Expand map[string]any }
Sanitree is used to build out a hierarchical tree of items for comparison against each other. Primarily so that a restore can compare two subtrees easily.
func BuildFilepathSanitree ¶
func CreateNewRoot ¶
Click to show internal directories.
Click to hide internal directories.