moduleMapValuer returns the map valuer with process module attributes.
(segments []*BoundSegmentLiteral, mod pstypes.Module)
| 446 | |
| 447 | // moduleMapValuer returns the map valuer with process module attributes. |
| 448 | func (f *Foreach) moduleMapValuer(segments []*BoundSegmentLiteral, mod pstypes.Module) MapValuer { |
| 449 | var valuer = MapValuer{} |
| 450 | for _, seg := range segments { |
| 451 | key := seg.Value |
| 452 | switch seg.Segment { |
| 453 | case fields.PathSegment: |
| 454 | valuer[key] = mod.Name |
| 455 | case fields.NameSegment: |
| 456 | valuer[key] = filepath.Base(mod.Name) |
| 457 | case fields.AddressSegment: |
| 458 | valuer[key] = mod.BaseAddress.String() |
| 459 | case fields.SizeSegment: |
| 460 | valuer[key] = mod.Size |
| 461 | case fields.ChecksumSegment: |
| 462 | valuer[key] = mod.Checksum |
| 463 | } |
| 464 | } |
| 465 | return valuer |
| 466 | } |
| 467 | |
| 468 | // procMapValuer returns the map valuer with process attributes. |
| 469 | func (f *Foreach) procMapValuer(segments []*BoundSegmentLiteral, proc *pstypes.PS) MapValuer { |