Files
nomad/vendor/github.com/mitchellh/go-glint/context.go
Isabel Suchanek 0edda116ad cli: add monitor flag to deployment status
Adding '-verbose' will print out the allocation information for the
deployment. This also changes the job run command so that it now blocks
until deployment is complete and adds timestamps to the output so that
it's more in line with the output of node drain.

This uses glint to print in place in running in a tty. Because glint
doesn't yet support cmd/powershell, Windows workflows use a different
library to print in place, which results in slightly different
formatting: 1) different margins, and 2) no spinner indicating
deployment in progress.
2021-06-09 16:18:45 -07:00

19 lines
431 B
Go

package glint
// Context is a component type that can be used to set data on the context
// given to Body calls for components that are children of this component.
func Context(inner Component, kv ...interface{}) Component {
if len(kv)%2 != 0 {
panic("kv must be set in pairs")
}
return &contextComponent{inner: inner, pairs: kv}
}
type contextComponent struct {
terminalComponent
inner Component
pairs []interface{}
}