2016-09-08 13:11:39 -04:00
|
|
|
package formatter
|
|
|
|
|
|
|
|
const (
|
|
|
|
imageHeader = "IMAGE"
|
|
|
|
createdSinceHeader = "CREATED"
|
|
|
|
createdAtHeader = "CREATED AT"
|
|
|
|
sizeHeader = "SIZE"
|
|
|
|
labelsHeader = "LABELS"
|
|
|
|
nameHeader = "NAME"
|
|
|
|
driverHeader = "DRIVER"
|
|
|
|
scopeHeader = "SCOPE"
|
|
|
|
)
|
|
|
|
|
|
|
|
type subContext interface {
|
2017-02-03 19:48:46 -05:00
|
|
|
FullHeader() interface{}
|
2016-09-08 13:11:39 -04:00
|
|
|
}
|
|
|
|
|
2016-09-12 16:59:18 -04:00
|
|
|
// HeaderContext provides the subContext interface for managing headers
|
|
|
|
type HeaderContext struct {
|
2017-02-03 19:48:46 -05:00
|
|
|
header interface{}
|
2016-09-08 13:11:39 -04:00
|
|
|
}
|
|
|
|
|
2017-02-03 19:48:46 -05:00
|
|
|
// FullHeader returns the header as an interface
|
|
|
|
func (c *HeaderContext) FullHeader() interface{} {
|
|
|
|
return c.header
|
2016-09-08 13:11:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func stripNamePrefix(ss []string) []string {
|
|
|
|
sss := make([]string, len(ss))
|
|
|
|
for i, s := range ss {
|
|
|
|
sss[i] = s[1:]
|
|
|
|
}
|
|
|
|
|
|
|
|
return sss
|
|
|
|
}
|