Documentation ¶
Overview ¶
Package display is a generated GoMock package.
Index ¶
- func FilterColumns(req string, def []string) []string
- type Displayable
- type Displayer
- type MockDisplayable
- func (m *MockDisplayable) ColMap() map[string]string
- func (m *MockDisplayable) Cols() []string
- func (m *MockDisplayable) EXPECT() *MockDisplayableMockRecorder
- func (m *MockDisplayable) Filterable() bool
- func (m *MockDisplayable) KV() []map[string]interface{}
- func (m *MockDisplayable) NoHeaders() bool
- type MockDisplayableMockRecorder
- func (mr *MockDisplayableMockRecorder) ColMap() *gomock.Call
- func (mr *MockDisplayableMockRecorder) Cols() *gomock.Call
- func (mr *MockDisplayableMockRecorder) Filterable() *gomock.Call
- func (mr *MockDisplayableMockRecorder) KV() *gomock.Call
- func (mr *MockDisplayableMockRecorder) NoHeaders() *gomock.Call
- type MockDisplayer
- type MockDisplayerMockRecorder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FilterColumns ¶ added in v0.2.0
FilterColumns will check if the filterable flag is used and return only the requested set of columns.
It takes the string parsed from the filterable flag as first argument and the default set of columns (default) as second parameter.
Types ¶
type Displayable ¶
type Displayable interface { KV() []map[string]interface{} Cols() []string ColMap() map[string]string NoHeaders() bool Filterable() bool }
Displayable describes an output handler for admiral.
func JSON ¶ added in v0.4.0
func JSON(d interface{}, pretty bool) Displayable
JSON retrieves a json displayable struct.
To display prettified JSON pass true as second parameter. Under the hood is uses the default json marshaler.
func Text ¶ added in v0.3.0
func Text(divider, text string) Displayable
Text programatically builds a simple text displayer. If you pass a non empty displayer then your text will be wrapped by the value of divider repeated 50 times.
type Displayer ¶
type Displayer interface { Display(Displayable, []string) error DisplayMany([]Displayable, []string) error }
Displayer executes a display action based on the provided displayable object.
func DefaultDisplayer ¶
DefaultDisplayer constructs a column based output to the provided writer (defaults to os.Stdout).
The output appearance is similar to the one provided by docker's cli.
type MockDisplayable ¶
type MockDisplayable struct {
// contains filtered or unexported fields
}
MockDisplayable is a mock of Displayable interface.
func NewMockDisplayable ¶
func NewMockDisplayable(ctrl *gomock.Controller) *MockDisplayable
NewMockDisplayable creates a new mock instance.
func (*MockDisplayable) ColMap ¶
func (m *MockDisplayable) ColMap() map[string]string
ColMap mocks base method.
func (*MockDisplayable) EXPECT ¶
func (m *MockDisplayable) EXPECT() *MockDisplayableMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockDisplayable) Filterable ¶ added in v0.2.0
func (m *MockDisplayable) Filterable() bool
Filterable mocks base method.
func (*MockDisplayable) KV ¶
func (m *MockDisplayable) KV() []map[string]interface{}
KV mocks base method.
func (*MockDisplayable) NoHeaders ¶
func (m *MockDisplayable) NoHeaders() bool
NoHeaders mocks base method.
type MockDisplayableMockRecorder ¶
type MockDisplayableMockRecorder struct {
// contains filtered or unexported fields
}
MockDisplayableMockRecorder is the mock recorder for MockDisplayable.
func (*MockDisplayableMockRecorder) ColMap ¶
func (mr *MockDisplayableMockRecorder) ColMap() *gomock.Call
ColMap indicates an expected call of ColMap.
func (*MockDisplayableMockRecorder) Cols ¶
func (mr *MockDisplayableMockRecorder) Cols() *gomock.Call
Cols indicates an expected call of Cols.
func (*MockDisplayableMockRecorder) Filterable ¶ added in v0.2.0
func (mr *MockDisplayableMockRecorder) Filterable() *gomock.Call
Filterable indicates an expected call of Filterable.
func (*MockDisplayableMockRecorder) KV ¶
func (mr *MockDisplayableMockRecorder) KV() *gomock.Call
KV indicates an expected call of KV.
func (*MockDisplayableMockRecorder) NoHeaders ¶
func (mr *MockDisplayableMockRecorder) NoHeaders() *gomock.Call
NoHeaders indicates an expected call of NoHeaders.
type MockDisplayer ¶
type MockDisplayer struct {
// contains filtered or unexported fields
}
MockDisplayer is a mock of Displayer interface.
func NewMockDisplayer ¶
func NewMockDisplayer(ctrl *gomock.Controller) *MockDisplayer
NewMockDisplayer creates a new mock instance.
func (*MockDisplayer) Display ¶
func (m *MockDisplayer) Display(arg0 Displayable, arg1 []string) error
Display mocks base method.
func (*MockDisplayer) DisplayMany ¶
func (m *MockDisplayer) DisplayMany(arg0 []Displayable, arg1 []string) error
DisplayMany mocks base method.
func (*MockDisplayer) EXPECT ¶
func (m *MockDisplayer) EXPECT() *MockDisplayerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockDisplayerMockRecorder ¶
type MockDisplayerMockRecorder struct {
// contains filtered or unexported fields
}
MockDisplayerMockRecorder is the mock recorder for MockDisplayer.
func (*MockDisplayerMockRecorder) Display ¶
func (mr *MockDisplayerMockRecorder) Display(arg0, arg1 interface{}) *gomock.Call
Display indicates an expected call of Display.
func (*MockDisplayerMockRecorder) DisplayMany ¶
func (mr *MockDisplayerMockRecorder) DisplayMany(arg0, arg1 interface{}) *gomock.Call
DisplayMany indicates an expected call of DisplayMany.