As far as I know, you cannot write ebpf code using Go. You can write C code for ebpf filters, and then use Go to install it and interface with it. Take a look at Cilium tools. You might also want to take a look at https://github.com/kubeshark/tracer.
On Tue, Aug 13, 2024 at 4:55 PM Sharon Mafgaoker <sha...@cloud5.co.il> wrote: > > Hey Everyone, > > Nice to e-meet you all! I'm new here and kindly asking for some advice on a > topic I'm exploring. > > While watching Rob Pike's videos about Go, I noticed he doesn't recommend > using CGO due to potential issues when changing OS/architecture. > > I have an idea to read incoming IPs, perform background checks, and validate > them by harnessing the power of concurrency. To analyze packets faster, I > want to use eBPF. However, I haven't found a way to load Go code directly > into eBPF, and it seems like CGO is the only way. > > Does anyone have advice on how to use pure Go with eBPF? Any insights or > alternative approaches would be greatly appreciated. > > Thank you! > > Best regards, > Sharon > > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/dcf0ea09-e65a-4215-9966-57b3caadc8f2n%40googlegroups.com. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CAMV2RqrFBPv8Pk9-PDwE2mS%2BFcq2hp%3D5GuiyJrsh-%3DVUr_vWWA%40mail.gmail.com.