Skip to content

GArLIC: GolAng LInux Connector: A Proc Connector library for go

License

Notifications You must be signed in to change notification settings

fearful-symmetry/garlic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GArLIC: GolAng LInux Connector

GARLIC is a simple proc connector interface for golang.

It's dead simple, and built on top of @mdlayher's gloang netlink library

The Proc Connector interface is mildly obscure, and you can read more here

Go Report Card CircleCI GoDoc

Tutorial

//Open a connection to the local Proc connector instance
//This requires root.
cn, err := DialPCN()
	if err != nil {
		log.Fatalf("%s", err)
	}

//Read in events
for {
    data, err := cn.ReadPCN()

	if err != nil {
		log.Errorf("Read fail: %s", err)
    }
	fmt.Printf("%#v\n", data)
}

//You can also filter by a list of events
cn, err := DialPCNWithEvents([]EventType{ProcEventGID, ProcEventExit})
	if err != nil {
		log.Fatalf("%s", err)
	}

Why?

Because it's fun. Also, garlic is my favorite seasoning.

What's next?

  • A CLI implementation is in the works.
  • Find a non-root way to run the tests.
  • Start looking at perf data
  • add new interfaces
  • Expand tests

About

GArLIC: GolAng LInux Connector: A Proc Connector library for go

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Languages