Documentation
¶
Index ¶
- Constants
- Variables
- func NewColumnFixed(width int, elements ...grid.Element) grid.Element
- func NewColumnPct(width int, elements ...grid.Element) grid.Element
- func NewRowFixed(height int, elements ...grid.Element) grid.Element
- func NewRowPct(height int, elements ...grid.Element) grid.Element
- type Cell
- type CellConfig
- type Cells
- type CellsConfig
- type ColumnOptions
- type ColumnValues
- func GeSystemStateColumnValues(host *domainhost.Host) (ColumnValues, error)
- func GetColumnsValues(dashboard enums.TableType, host *domainhost.Host) (ColumnValues, error)
- func GetNodeColumnValues(host *domainhost.Host) (ColumnValues, error)
- func GetRPCColumnValues(host *domainhost.Host) (ColumnValues, error)
- func GetValidatorColumnValues(host *domainhost.Host) (ColumnValues, error)
- type Columns
- type ColumnsConfig
- type RowConfig
- type Rows
- type RowsConfig
Constants ¶
const ( ColumnWidth14 = 14 ColumnWidth15 = 15 ColumnWidth20 = 20 ColumnWidth24 = 24 ColumnWidth25 = 25 ColumnWidth30 = 30 ColumnWidth33 = 33 ColumnWidth49 = 49 ColumnWidth99 = 20 ColumnWidth19 = 19 RowHeight14 = 14 )
Variables ¶
var ( ColumnsConfigNode = ColumnsConfig{ enums.ColumnNameCurrentEpoch: ColumnWidth33, enums.ColumnNameNetworkPeers: ColumnWidth15, enums.ColumnNameUptime: ColumnWidth25, enums.ColumnNameVersion: ColumnWidth25, enums.ColumnNameCommit: ColumnWidth25, enums.ColumnNameCheckpointExecBacklog: ColumnWidth33, enums.ColumnNameCheckpointSyncBacklog: ColumnWidth33, enums.ColumnNameTotalTransactionBlocks: ColumnWidth33, enums.ColumnNameTotalTransactionCertificates: ColumnWidth33, enums.ColumnNameTotalTransactionEffects: ColumnWidth33, enums.ColumnNameTXSyncPercentage: ColumnWidth49, enums.ColumnNameTransactionsPerSecond: ColumnWidth49, enums.ColumnNameLatestCheckpoint: ColumnWidth24, enums.ColumnNameHighestKnownCheckpoint: ColumnWidth24, enums.ColumnNameHighestSyncedCheckpoint: ColumnWidth24, enums.ColumnNameLastExecutedCheckpoint: ColumnWidth24, enums.ColumnNameCheckSyncPercentage: ColumnWidth49, enums.ColumnNameCheckpointsPerSecond: ColumnWidth49, } RowsConfigNode = RowsConfig{ 0: { Height: RowHeight14, Columns: []enums.ColumnName{ enums.ColumnNameNetworkPeers, enums.ColumnNameUptime, enums.ColumnNameVersion, enums.ColumnNameCommit, }, }, 1: { Height: RowHeight14, Columns: []enums.ColumnName{ enums.ColumnNameCurrentEpoch, enums.ColumnNameCheckpointExecBacklog, enums.ColumnNameCheckpointSyncBacklog, }, }, 2: { Height: RowHeight14, Columns: []enums.ColumnName{ enums.ColumnNameLatestCheckpoint, enums.ColumnNameHighestKnownCheckpoint, enums.ColumnNameHighestSyncedCheckpoint, enums.ColumnNameLastExecutedCheckpoint, }, }, 3: { Height: RowHeight14, Columns: []enums.ColumnName{ enums.ColumnNameCheckSyncPercentage, enums.ColumnNameCheckpointsPerSecond, }, }, 4: { Height: RowHeight14, Columns: []enums.ColumnName{ enums.ColumnNameTotalTransactionBlocks, enums.ColumnNameTotalTransactionCertificates, enums.ColumnNameTotalTransactionEffects, }, }, 5: { Height: RowHeight14, Columns: []enums.ColumnName{ enums.ColumnNameTXSyncPercentage, enums.ColumnNameTransactionsPerSecond, }, }, } CellsConfigNode = CellsConfig{ enums.ColumnNameNetworkPeers: {"NETWORK PEERS", cell.ColorGreen}, enums.ColumnNameUptime: {"UPTIME", cell.ColorGreen}, enums.ColumnNameVersion: {"VERSION", cell.ColorGreen}, enums.ColumnNameCommit: {"COMMIT", cell.ColorGreen}, enums.ColumnNameCurrentEpoch: {"CURRENT EPOCH", cell.ColorGreen}, enums.ColumnNameCheckpointExecBacklog: {"CHECKPOINT EXEC BACKLOG", cell.ColorGreen}, enums.ColumnNameCheckpointSyncBacklog: {"CHECKPOINT SYNC BACKLOG", cell.ColorGreen}, enums.ColumnNameHighestKnownCheckpoint: {"HIGHEST KNOWN CHECKPOINT", cell.ColorBlue}, enums.ColumnNameHighestSyncedCheckpoint: {"HIGHEST SYNCED CHECKPOINT", cell.ColorBlue}, enums.ColumnNameLastExecutedCheckpoint: {"LAST EXECUTED CHECKPOINT", cell.ColorBlue}, enums.ColumnNameLatestCheckpoint: {"LATEST CHECKPOINT", cell.ColorBlue}, enums.ColumnNameCheckSyncPercentage: {"CHECKPOINTS SYNC PERCENTAGE", cell.ColorBlue}, enums.ColumnNameCheckpointsPerSecond: {"CHECKPOINTS VOLUME", cell.ColorBlue}, enums.ColumnNameTotalTransactionBlocks: {"TOTAL TRANSACTION BLOCKS", cell.ColorYellow}, enums.ColumnNameTotalTransactionCertificates: {"TOTAL TRANSACTION CERTIFICATES", cell.ColorYellow}, enums.ColumnNameTotalTransactionEffects: {"TOTAL TRANSACTION EFFECTS", cell.ColorYellow}, enums.ColumnNameTransactionsPerSecond: {"TRANSACTIONS VOLUME", cell.ColorYellow}, enums.ColumnNameTXSyncPercentage: {"TRANSACTIONS SYNC PERCENTAGE", cell.ColorYellow}, } )
var ( ColumnsConfigRPC = ColumnsConfig{ enums.ColumnNameCurrentEpoch: ColumnWidth19, enums.ColumnNameSystemTimeTillNextEpoch: ColumnWidth19, enums.ColumnNameTotalTransactionBlocks: ColumnWidth30, enums.ColumnNameLatestCheckpoint: ColumnWidth30, } RowsConfigRPC = RowsConfig{ 0: { Height: RowHeight14, Columns: []enums.ColumnName{ enums.ColumnNameCurrentEpoch, enums.ColumnNameSystemTimeTillNextEpoch, enums.ColumnNameTotalTransactionBlocks, enums.ColumnNameLatestCheckpoint, }, }, } CellsConfigRPC = CellsConfig{ enums.ColumnNameCurrentEpoch: {"CURRENT EPOCH", cell.ColorGreen}, enums.ColumnNameSystemTimeTillNextEpoch: {"TIME TILL NEXT EPOCH", cell.ColorGreen}, enums.ColumnNameTotalTransactionBlocks: {"TOTAL TRANSACTION BLOCKS", cell.ColorYellow}, enums.ColumnNameLatestCheckpoint: {"LATEST CHECKPOINT", cell.ColorBlue}, } )
var ( ColumnsConfigValidator = ColumnsConfig{ enums.ColumnNameCurrentEpoch: ColumnWidth20, enums.ColumnNameUptime: ColumnWidth25, enums.ColumnNameVersion: ColumnWidth25, enums.ColumnNameCommit: ColumnWidth25, enums.ColumnNameTotalTransactionCertificates: ColumnWidth33, enums.ColumnNameTotalTransactionEffects: ColumnWidth33, enums.ColumnNameCertificatesCreated: ColumnWidth33, enums.ColumnNameCertificatesPerSecond: ColumnWidth49, enums.ColumnNameLastExecutedCheckpoint: ColumnWidth33, enums.ColumnNameHighestKnownCheckpoint: ColumnWidth33, enums.ColumnNameHighestSyncedCheckpoint: ColumnWidth33, enums.ColumnNameCheckSyncPercentage: ColumnWidth49, enums.ColumnNameCheckpointsPerSecond: ColumnWidth49, enums.ColumnNameCurrentRound: ColumnWidth33, enums.ColumnNameHighestProcessedRound: ColumnWidth33, enums.ColumnNameLastCommittedRound: ColumnWidth33, enums.ColumnNameRoundsPerSecond: ColumnWidth49, enums.ColumnNameNetworkPeers: ColumnWidth19, enums.ColumnNamePrimaryNetworkPeers: ColumnWidth19, enums.ColumnNameWorkerNetworkPeers: ColumnWidth19, enums.ColumnNameSkippedConsensusTransactions: ColumnWidth19, enums.ColumnNameTotalSignatureErrors: ColumnWidth19, } RowsConfigValidator = RowsConfig{ 0: { Height: ColumnWidth14, Columns: []enums.ColumnName{ enums.ColumnNameCurrentEpoch, enums.ColumnNameUptime, enums.ColumnNameVersion, enums.ColumnNameCommit, }, }, 1: { Height: ColumnWidth14, Columns: []enums.ColumnName{ enums.ColumnNameNetworkPeers, enums.ColumnNamePrimaryNetworkPeers, enums.ColumnNameWorkerNetworkPeers, enums.ColumnNameSkippedConsensusTransactions, enums.ColumnNameTotalSignatureErrors, }, }, 2: { Height: ColumnWidth14, Columns: []enums.ColumnName{ enums.ColumnNameLastExecutedCheckpoint, enums.ColumnNameHighestKnownCheckpoint, enums.ColumnNameHighestSyncedCheckpoint, }, }, 3: { Height: ColumnWidth14, Columns: []enums.ColumnName{ enums.ColumnNameCheckSyncPercentage, enums.ColumnNameCheckpointsPerSecond, }, }, 4: { Height: ColumnWidth14, Columns: []enums.ColumnName{ enums.ColumnNameTotalTransactionCertificates, enums.ColumnNameTotalTransactionEffects, enums.ColumnNameCertificatesCreated, }, }, 5: { Height: ColumnWidth14, Columns: []enums.ColumnName{ enums.ColumnNameCurrentRound, enums.ColumnNameHighestProcessedRound, enums.ColumnNameLastCommittedRound, }, }, 6: { Height: ColumnWidth14, Columns: []enums.ColumnName{ enums.ColumnNameCertificatesPerSecond, enums.ColumnNameRoundsPerSecond, }, }, } CellsConfigValidator = CellsConfig{ enums.ColumnNameCurrentEpoch: {"CURRENT EPOCH", cell.ColorGreen}, enums.ColumnNameUptime: {"UPTIME", cell.ColorGreen}, enums.ColumnNameVersion: {"VERSION", cell.ColorGreen}, enums.ColumnNameCommit: {"COMMIT", cell.ColorGreen}, enums.ColumnNameNetworkPeers: {"SUI NETWORK PEERS", cell.ColorGreen}, enums.ColumnNamePrimaryNetworkPeers: {"PRIMARY NETWORK PEERS", cell.ColorGreen}, enums.ColumnNameWorkerNetworkPeers: {"WORKER NETWORK PEERS", cell.ColorGreen}, enums.ColumnNameSkippedConsensusTransactions: {"SKIPPED CONSENSUS TRANSACTIONS", cell.ColorGreen}, enums.ColumnNameTotalSignatureErrors: {"TOTAL SIGNATURE ERRORS", cell.ColorGreen}, enums.ColumnNameHighestKnownCheckpoint: {"HIGHEST KNOWN CHECKPOINT", cell.ColorBlue}, enums.ColumnNameHighestSyncedCheckpoint: {"HIGHEST SYNCED CHECKPOINT", cell.ColorBlue}, enums.ColumnNameLastExecutedCheckpoint: {"LAST EXECUTED CHECKPOINT", cell.ColorBlue}, enums.ColumnNameCheckpointExecBacklog: {"CHECKPOINT EXEC BACKLOG", cell.ColorBlue}, enums.ColumnNameCheckpointSyncBacklog: {"CHECKPOINT SYNC BACKLOG", cell.ColorBlue}, enums.ColumnNameCheckSyncPercentage: {"CHECKPOINTS SYNC PERCENTAGE", cell.ColorBlue}, enums.ColumnNameCheckpointsPerSecond: {"CHECKPOINTS VOLUME", cell.ColorBlue}, enums.ColumnNameTotalTransactionCertificates: {"TOTAL TRANSACTION CERTIFICATES", cell.ColorYellow}, enums.ColumnNameTotalTransactionEffects: {"TOTAL TRANSACTION EFFECTS", cell.ColorYellow}, enums.ColumnNameCertificatesCreated: {"CERTIFICATES CREATED", cell.ColorYellow}, enums.ColumnNameCurrentRound: {"CURRENT ROUND", cell.ColorRed}, enums.ColumnNameHighestProcessedRound: {"HIGHEST PROCESSED ROUND", cell.ColorRed}, enums.ColumnNameLastCommittedRound: {"LAST COMMITTED ROUND", cell.ColorRed}, enums.ColumnNameRoundsPerSecond: {"ROUNDS RATIO", cell.ColorRed}, enums.ColumnNameCertificatesPerSecond: {"CERTIFICATES RATIO", cell.ColorYellow}, enums.ColumnNameHandleCertificateNonConsensusLatencySum: {"CERTIFICATE NON CONSENSUS LATENCY", cell.ColorRed}, } )
var CellConfigDefault = []container.Option{ container.Border(linestyle.Light), container.AlignVertical(align.VerticalMiddle), container.AlignHorizontal(align.HorizontalCenter), container.TitleColor(cell.ColorRed), container.FocusedColor(cell.ColorWhite), }
var CellsConfigSystemState = CellsConfig{ enums.ColumnNameCurrentEpoch: {"CURRENT EPOCH", cell.ColorGreen}, enums.ColumnNameSystemEpochStartTimestamp: {"EPOCH START TIME UTC", cell.ColorGreen}, enums.ColumnNameSystemEpochDuration: {"EPOCH DURATION", cell.ColorGreen}, enums.ColumnNameSystemTimeTillNextEpoch: {"TIME TILL NEXT EPOCH", cell.ColorGreen}, enums.ColumnNameSystemTotalStake: {"TOTAL STAKE, SUI", cell.ColorBlue}, enums.ColumnNameSystemStorageFundTotalObjectStorageRebates: {"STORAGE FUND TOTAL OBJECT REBATES, SUI", cell.ColorBlue}, enums.ColumnNameSystemStorageFundNonRefundableBalance: {"STORAGE FUND REFUNDABLE BALANCE, SUI", cell.ColorBlue}, enums.ColumnNameSystemReferenceGasPrice: {"REFERENCE GAS PRICE", cell.ColorYellow}, enums.ColumnNameSystemMinReferenceGasPrice: {"MIN REFERENCE GAS PRICE", cell.ColorYellow}, enums.ColumnNameSystemMaxReferenceGasPrice: {"MAX REFERENCE GAS PRICE", cell.ColorYellow}, enums.ColumnNameSystemMeanReferenceGasPrice: {"MEAN REFERENCE GAS PRICE", cell.ColorYellow}, enums.ColumnNameSystemStakeWeightedMeanReferenceGasPrice: {"STAKE WEIGHTED MEAN REFERENCE GAS PRICE", cell.ColorYellow}, enums.ColumnNameSystemMedianReferenceGasPrice: {"MEDIAN REFERENCE GAS PRICE", cell.ColorYellow}, enums.ColumnNameSystemEstimatedReferenceGasPrice: {"ESTIMATED REFERENCE GAS PRICE", cell.ColorYellow}, enums.ColumnNameSystemStakeSubsidyBalance: {"STAKE SUBSIDY BALANCE, SUI", cell.ColorRed}, enums.ColumnNameSystemStakeSubsidyStartEpoch: {"STAKE SUBSIDY START EPOCH", cell.ColorRed}, enums.ColumnNameSystemStakeSubsidyDistributionCounter: {"STAKE SUBSIDY DISTRIBUTION COUNTER", cell.ColorRed}, enums.ColumnNameSystemStakeSubsidyCurrentDistributionAmount: {"STAKE SUBSIDY DISTRIBUTION AMOUNT, SUI", cell.ColorRed}, enums.ColumnNameSystemStakeSubsidyPeriodLength: {"STAKE SUBSIDY PERIOD LENGTH", cell.ColorRed}, enums.ColumnNameSystemStakeSubsidyDecreaseRate: {"STAKE SUBSIDY DECREASE RATE", cell.ColorRed}, }
var ColumnsConfigSystemState = ColumnsConfig{ enums.ColumnNameSystemEpochStartTimestamp: ColumnWidth99, enums.ColumnNameCurrentEpoch: ColumnWidth20, enums.ColumnNameSystemEpochDuration: ColumnWidth20, enums.ColumnNameSystemTimeTillNextEpoch: ColumnWidth30, enums.ColumnNameSystemReferenceGasPrice: ColumnWidth20, enums.ColumnNameSystemMinReferenceGasPrice: ColumnWidth20, enums.ColumnNameSystemMaxReferenceGasPrice: ColumnWidth20, enums.ColumnNameSystemMeanReferenceGasPrice: ColumnWidth20, enums.ColumnNameSystemStakeWeightedMeanReferenceGasPrice: ColumnWidth19, enums.ColumnNameSystemMedianReferenceGasPrice: ColumnWidth20, enums.ColumnNameSystemEstimatedReferenceGasPrice: ColumnWidth20, enums.ColumnNameSystemStakeSubsidyStartEpoch: ColumnWidth20, enums.ColumnNameSystemStakeSubsidyBalance: ColumnWidth49, enums.ColumnNameSystemStakeSubsidyDistributionCounter: ColumnWidth33, enums.ColumnNameSystemStakeSubsidyCurrentDistributionAmount: ColumnWidth49, enums.ColumnNameSystemStakeSubsidyPeriodLength: ColumnWidth20, enums.ColumnNameSystemStakeSubsidyDecreaseRate: ColumnWidth20, enums.ColumnNameSystemTotalStake: ColumnWidth33, enums.ColumnNameSystemStorageFundTotalObjectStorageRebates: ColumnWidth33, enums.ColumnNameSystemStorageFundNonRefundableBalance: ColumnWidth33, }
var DashboardConfigDefault = []container.Option{ container.Border(linestyle.Light), container.BorderColor(cell.ColorGreen), container.BorderTitle(dashboardName), container.FocusedColor(cell.ColorGreen), container.AlignHorizontal(align.HorizontalCenter), container.AlignVertical(align.VerticalMiddle), container.TitleColor(cell.ColorRed), container.TitleFocusedColor(cell.ColorRed), container.Focused(), }
var RowsConfigSystemState = RowsConfig{ 0: { Height: RowHeight14, Columns: []enums.ColumnName{ enums.ColumnNameSystemEpochStartTimestamp, }, }, 1: { Height: RowHeight14, Columns: []enums.ColumnName{ enums.ColumnNameCurrentEpoch, enums.ColumnNameSystemEpochDuration, enums.ColumnNameSystemTimeTillNextEpoch, }, }, 2: { Height: RowHeight14, Columns: []enums.ColumnName{ enums.ColumnNameSystemTotalStake, enums.ColumnNameSystemStorageFundTotalObjectStorageRebates, enums.ColumnNameSystemStorageFundNonRefundableBalance, }, }, 3: { Height: RowHeight14, Columns: []enums.ColumnName{ enums.ColumnNameSystemReferenceGasPrice, enums.ColumnNameSystemMinReferenceGasPrice, enums.ColumnNameSystemMaxReferenceGasPrice, enums.ColumnNameSystemMeanReferenceGasPrice, enums.ColumnNameSystemStakeWeightedMeanReferenceGasPrice, }, }, 4: { Height: RowHeight14, Columns: []enums.ColumnName{ enums.ColumnNameSystemMedianReferenceGasPrice, enums.ColumnNameSystemEstimatedReferenceGasPrice, enums.ColumnNameSystemStakeSubsidyPeriodLength, enums.ColumnNameSystemStakeSubsidyDecreaseRate, enums.ColumnNameSystemStakeSubsidyStartEpoch, }, }, 5: { Height: RowHeight14, Columns: []enums.ColumnName{ enums.ColumnNameSystemStakeSubsidyCurrentDistributionAmount, enums.ColumnNameSystemStakeSubsidyBalance, }, }, }
Functions ¶
func NewColumnFixed ¶
NewColumnFixed creates a new column element with a fixed width and a list of sub-elements. The `width` parameter specifies the width of the column in pixels, and the `elements` parameter is a list of sub-elements that will be contained within the column.
func NewColumnPct ¶
NewColumnPct creates a new column element with a width proportional to the total grid width and a list of sub-elements. The `width` parameter specifies the percentage of the grid width that the column should occupy, and the `elements` parameter is a list of sub-elements that will be contained within the column.
func NewRowFixed ¶
NewRowFixed creates a new row element with a fixed height and a list of sub-elements. The `height` parameter specifies the height of the row in pixels, and the `elements` parameter is a list of sub-elements that will be contained within the row.
func NewRowPct ¶
NewRowPct creates a new row element with a height proportional to the total grid height and a list of sub-elements. The `height` parameter specifies the percentage of the grid height that the row should occupy, and the `elements` parameter is a list of sub-elements that will be contained within the row.
Types ¶
type Cell ¶
Cell is a struct that represents a single cell in a dashboard grid. It contains a widget and a list of options.
func NewCell ¶
NewCell is a function that creates a new Cell struct given a cellName and a widget. It returns a pointer to the new Cell and an error (if any).
type CellConfig ¶
CellsConfig is a type that represents a mapping of column names to CellConfig.
type Cells ¶
type Cells map[enums.ColumnName]*Cell
Cells is a type that represents a mapping of column names to pointers to Cell structs.
func GetCells ¶
func GetCells(cellsConfig CellsConfig) (Cells, error)
GetCells creates a new set of cells based on the configuration provided. It accepts a CellsConfig object that maps column names to cell names, and a terminal object that represents the terminal where the cells will be displayed. It returns a Cells object and an error. The Cells object is a map that maps column names to cell objects.
type CellsConfig ¶
type CellsConfig map[enums.ColumnName]CellConfig
CellsConfig is a type that represents a mapping of column names to CellConfig.
func GetCellsConfig ¶
func GetCellsConfig(dashboard enums.TableType) (CellsConfig, error)
GetCellsConfig returns the cells configuration based on the specified dashboard type.
type ColumnOptions ¶
type ColumnOptions map[enums.ColumnName]any
ColumnOptions represents a mapping between column names and their corresponding configuration options.
type ColumnValues ¶
type ColumnValues map[enums.ColumnName]any
ColumnValues represents a mapping between column names and their corresponding values.
func GeSystemStateColumnValues ¶
func GeSystemStateColumnValues(host *domainhost.Host) (ColumnValues, error)
GeSystemStateColumnValues returns a map of ColumnName values to corresponding values for a node at the specified index on the specified host. The function retrieves information about the node from the host's internal state and formats it into a map of NodeColumnName keys and corresponding values. The function also includes emoji values in the map if the specified flag is true.
func GetColumnsValues ¶
func GetColumnsValues(dashboard enums.TableType, host *domainhost.Host) (ColumnValues, error)
GetColumnsValues returns the columns values based on the specified dashboard type and host.
func GetNodeColumnValues ¶
func GetNodeColumnValues(host *domainhost.Host) (ColumnValues, error)
GetNodeColumnValues returns a map of ColumnName values to corresponding values for a node at the specified index on the specified host. The function retrieves information about the node from the host's internal state and formats it into a map of NodeColumnName keys and corresponding values. The function also includes emoji values in the map if the specified flag is true.
func GetRPCColumnValues ¶
func GetRPCColumnValues(host *domainhost.Host) (ColumnValues, error)
GetRPCColumnValues returns a map of ColumnName values to corresponding values for a node at the specified index on the specified host. The function retrieves information about the node from the host's internal state and formats it into a map of NodeColumnName keys and corresponding values. The function also includes emoji values in the map if the specified flag is true.
func GetValidatorColumnValues ¶
func GetValidatorColumnValues(host *domainhost.Host) (ColumnValues, error)
GetValidatorColumnValues returns a map of ColumnName values to corresponding values for a node at the specified index on the specified host. The function retrieves information about the node from the host's internal state and formats it into a map of NodeColumnName keys and corresponding values. The function also includes emoji values in the map if the specified flag is true.
type Columns ¶
type Columns map[enums.ColumnName]grid.Element
Columns is a type that maps column names to their respective grid elements.
func GetColumns ¶
func GetColumns(columnsConfig ColumnsConfig, cells Cells) (Columns, error)
GetColumns returns a slice of Columns based on the given ColumnsConfig and Cells.
type ColumnsConfig ¶
type ColumnsConfig map[enums.ColumnName]int
ColumnsConfig is a type that maps column names to their respective widths.
func GetColumnsConfig ¶
func GetColumnsConfig(dashboard enums.TableType) (ColumnsConfig, error)
GetColumnsConfig returns the columns configuration based on the specified dashboard type.
type RowConfig ¶
type RowConfig struct {
Columns []enums.ColumnName
Height int
}
RowConfig is a type that represents the configuration for a single row in a grid. It contains a height and a list of column names that should be included in the row.
type Rows ¶
Rows is a type that represents a set of grid rows, each of which is an element in the grid.
func GetRows ¶
func GetRows(rowsConfig RowsConfig, columns Columns) (Rows, error)
GetRows creates a new set of rows based on the configuration provided. It accepts a RowsConfig object that specifies the height and columns for each row, a Cells object that maps cell names to cell objects, and a Columns object that maps column names to column objects. It returns a Rows object and an error. The Rows object is a slice of Row objects, where each Row object represents a row in the terminal grid.
type RowsConfig ¶
type RowsConfig []RowConfig
RowsConfig is a type that represents the configuration for a set of rows in a grid. Each `RowConfig` contains a height and a list of column names that should be included in the row.
func GetRowsConfig ¶
func GetRowsConfig(dashboard enums.TableType) (RowsConfig, error)
GetRowsConfig returns the rows configuration based on the specified dashboard type.