display

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileMetadata

type FileMetadata struct {
	FileSize  int64 `json:"file_size"`
	FileCount int64 `json:"file_count"`
}

func (*FileMetadata) HumanizeCount

func (f *FileMetadata) HumanizeCount() string

func (*FileMetadata) HumanizeSize

func (f *FileMetadata) HumanizeSize() string

type PartitionResource

type PartitionResource struct {
	Name        string             `json:"name"`
	Description *string            `json:"description,omitempty"`
	Plugin      string             `json:"plugin"`
	Local       TableResourceFiles `json:"local,omitempty"`
}

func GetPartitionResource

func GetPartitionResource(partitionName string) (*PartitionResource, error)

func ListPartitionResources

func ListPartitionResources(ctx context.Context) ([]*PartitionResource, error)

func (*PartitionResource) GetListData

func (r *PartitionResource) GetListData() *printers.RowData

GetListData implements the printers.Listable interface

func (*PartitionResource) GetShowData

func (r *PartitionResource) GetShowData() *printers.RowData

GetShowData implements the printers.Showable interface

type PluginListDetails

type PluginListDetails struct {
	Name       string
	Version    string
	Partitions []string
}

func ListPlugins

func ListPlugins(ctx context.Context) ([]*PluginListDetails, error)

func (*PluginListDetails) GetListData

func (r *PluginListDetails) GetListData() *printers.RowData

GetListData implements the printers.Listable interface

type PluginResource

type PluginResource struct {
	Name       string   `json:"name"`
	Version    string   `json:"version"`
	Sources    []string `json:"sources"`
	Partitions []string `json:"partitions"`
	Tables     []string `json:"tables"`
}

func GetPluginResource

func GetPluginResource(ctx context.Context, name string) (*PluginResource, error)

func (*PluginResource) GetListData

func (r *PluginResource) GetListData() *printers.RowData

GetListData implements the printers.Listable interface

func (*PluginResource) GetShowData

func (r *PluginResource) GetShowData() *printers.RowData

GetShowData implements the printers.Showable interface

type PrintableResource

type PrintableResource[T printers.Listable] struct {
	Items []T
}

func NewPrintableResource

func NewPrintableResource[T printers.Listable](items ...T) *PrintableResource[T]

func (PrintableResource[T]) GetItems

func (p PrintableResource[T]) GetItems() []T

func (PrintableResource[T]) GetTable

func (p PrintableResource[T]) GetTable() (*printers.Table, error)

type SourceResource

type SourceResource struct {
	Name        string `json:"name"`
	Description string `json:"description,omitempty"`
}

func GetSourceResource

func GetSourceResource(ctx context.Context, sourceName string) (*SourceResource, error)

func ListSourceResources

func ListSourceResources(ctx context.Context) ([]*SourceResource, error)

func (*SourceResource) GetListData

func (r *SourceResource) GetListData() *printers.RowData

GetListData implements the printers.Listable interface

func (*SourceResource) GetShowData

func (r *SourceResource) GetShowData() *printers.RowData

GetShowData implements the printers.Showable interface

type TableResource

type TableResource struct {
	Name        string                 `json:"name"`
	Description string                 `json:"description,omitempty"`
	Plugin      string                 `json:"plugin"`
	Partitions  []string               `json:"partitions,omitempty"`
	Columns     []*schema.ColumnSchema `json:"columns"`
	Local       TableResourceFiles     `json:"local,omitempty"`
}

func GetTableResource

func GetTableResource(ctx context.Context, tableName string) (*TableResource, error)

func ListTableResources

func ListTableResources(ctx context.Context) ([]*TableResource, error)

func (*TableResource) GetListData

func (r *TableResource) GetListData() *printers.RowData

GetListData implements the printers.Listable interface

func (*TableResource) GetShowData

func (r *TableResource) GetShowData() *printers.RowData

GetShowData implements the printers.Showable interface

type TableResourceFiles

type TableResourceFiles struct {
	FileMetadata
	RowCount int64 `json:"row_count,omitempty"`
}

Jump to

Keyboard shortcuts

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