coreos / mayday

A diagnostics tool for capturing system state.
Apache License 2.0
80 stars 27 forks source link

add rkt parsing and tarables #30

Closed tschuy closed 8 years ago

tschuy commented 8 years ago

This is by no means done yet.

This adds the github.com/coreos/mayday/mayday/rkt package that is to be used as such:

pods = rkt.GetPods() // returns a list of Pods
for _, p := range pods {
    tbs := p.GetTarables() // returns a []Tarable
    for _, t = range tbs {
        tarables = append(tarables, t)
    }
}

GetTarables() returns three Tarables:

So far, if you manually initialize a Pod object with App objects (or use ProcessRktOutput(str) to parse them into existence), you can call GetTarables() to get the Pod and App tarables.

I'm not very happy with this api, but it's at the same time the best I can think of.

Thoughts?