MCPcopy Create free account
hub / github.com/google/gapid / StateTreeNodeForPath

Function StateTreeNodeForPath

gapis/resolve/state_tree.go:110–123  ·  view source on GitHub ↗

StateTreeNodeForPath returns the path to the StateTreeNode representing the path p.

(ctx context.Context, p *path.StateTreeNodeForPath, r *path.ResolveConfig)

Source from the content-addressed store, hash-verified

108// StateTreeNodeForPath returns the path to the StateTreeNode representing the
109// path p.
110func StateTreeNodeForPath(ctx context.Context, p *path.StateTreeNodeForPath, r *path.ResolveConfig) (*path.StateTreeNode, error) {
111 boxed, err := database.Resolve(ctx, p.Tree.ID())
112 if err != nil {
113 return nil, err
114 }
115 indices, err := stateTreeNodePath(ctx, boxed.(*stateTree), p.Member.Node())
116 if err != nil {
117 return nil, err
118 }
119 return &path.StateTreeNode{
120 Tree: p.Tree,
121 Indices: indices,
122 }, nil
123}
124
125func stateTreeNode(ctx context.Context, tree *stateTree, p *path.StateTreeNode) (*service.StateTreeNode, error) {
126 node := tree.root

Callers 1

ResolveInternalFunction · 0.85

Calls 4

stateTreeNodePathFunction · 0.85
ResolveMethod · 0.65
IDMethod · 0.65
NodeMethod · 0.45

Tested by

no test coverage detected