Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Monitor ¶
func Monitor(listable Monitorable, firstQuery string) error
Monitor displays a terminal application that navigates in the data source
Types ¶
type Monitorable ¶
type Monitorable interface {
// FetchAll returns the whole list of items. They will be saved in the CLI app. until the next FetchAll call.
FetchAll(query string) ([]MonitoredItem, error)
}
Monitorable implements a source of items. The application is responsible to call for a new list of objects. The list is cached in the application between two fetches.
type MonitoredItem ¶
type MonitoredItem interface {
// GetPrimaryKey returns the defauly key that will be used by the application if none is explicitly selected.
// The returned primary key should be an element of the array of all the possible keys returned by GetKeys.
GetPrimaryKey() string
// GetKeys Return all the keys of the metadata properties.
// Subsequent calls should return the same array: same entries, same order.
// The array should contain the value returned by GetPrimaryKey.
GetKeys() []string
// GetValue returns the value of a single given key. Any error results in an empty output.
GetValue(k string) string
// GetDetail generates a description of the object, that will be displayed in the "detail" panel when not in
// "table" mode. The MonitoredItem implementation MAY return a dump of the metadata (i.e the keys and their
// respective values), the application doesn't care.
GetDetail() string
}
MonitoredItem describe the expectation for any monitorable item: just a set of metadata tha can be queried independently.
Click to show internal directories.
Click to hide internal directories.