display

package
v0.7.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2022 License: Apache-2.0 Imports: 9 Imported by: 1

Documentation

Overview

Package display is a generated GoMock package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilterColumns added in v0.2.0

func FilterColumns(req string, def []string) []string

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

func DefaultDisplayer(output io.Writer) Displayer

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) Cols

func (m *MockDisplayable) Cols() []string

Cols mocks base method.

func (*MockDisplayable) EXPECT

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

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

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

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL