forked from cilium/ebpf
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
collection: support embedded structs when assigning
Allow using embedded structs when assigning maps and programs from a CollectionSpec. For example: type maps struct { Bar *ebpf.Map `ebpf:"bar"` } var objs struct { maps Prog *ebpf.Program `ebpf:"prog"` } spec.LoadAndAssign(&objs) This is useful for separating out maps and programs, since they tend to have different lifetimes: programs are loaded, attached and then discarded. Maps stick around, since they are used to communicate with the program. The same functionality now applies to CollectionSpec.Assign as well.
- Loading branch information
Showing
2 changed files
with
168 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters