collection

package
v0.0.62 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultListFields = "ID,Name,ItemCount"

DefaultListFields is the default fields we should show if the user has not specified.

Variables

This section is empty.

Functions

func GetCollectionPreviewPath

func GetCollectionPreviewPath(ID string) string

GetCollectionPreviewPath returns the URL path to a collection preview, agnostic of domain

func GetCollectionPreviewURL

func GetCollectionPreviewURL(ID string) string

GetCollectionPreviewURL returns the full URL to a collection preview using configuration

func RenderCollection

func RenderCollection(collection *model.Collection, w io.Writer) error

RenderCollection will write a detailed view of the selected collection to the provided writer.

Types

type CsvRenderer

type CsvRenderer struct{}

CsvRenderer will render the output in a CSV format.

func (*CsvRenderer) Render

func (r *CsvRenderer) Render(client client.API, opts ListUsedOptions, w io.Writer) error

Render will render the collections in the CSV format.

type InteractiveRenderer

type InteractiveRenderer struct{}

InteractiveRenderer runs the bubbles UI framework to provide a rich UI experience for the user.

func (*InteractiveRenderer) Render

func (r *InteractiveRenderer) Render(client client.API, opts ListUsedOptions, w io.Writer) error

Render will render the list in an interactive manner.

type JSONRenderer

type JSONRenderer struct{}

JSONRenderer will render the output in JSON format.

func (*JSONRenderer) Render

func (r *JSONRenderer) Render(client client.API, opts ListUsedOptions, w io.Writer) error

Render will render the collections in JSON format.

type ListRenderer

type ListRenderer struct {
	// contains filtered or unexported fields
}

ListRenderer defines an interface to allow different strategies to render the list view.

func (*ListRenderer) Render

func (r *ListRenderer) Render(client client.API, opts ListUsedOptions, w io.Writer) error

Render will use the render strategy to render the collections.

func (*ListRenderer) SetStrategy

func (r *ListRenderer) SetStrategy(s ListStrategy)

SetStrategy allows you to set the renderer strategy for the list view.

type ListStrategy

type ListStrategy interface {
	Render(client client.API, opts ListUsedOptions, w io.Writer) error
}

ListStrategy defines an interface to allow different strategies to render the list view.

type ListUsedOptions

type ListUsedOptions struct {
	WorkspaceID string
	Fields      string
	Limit       int
	Offset      int
}

ListUsedOptions are the options selected by the user.

type ListView

type ListView struct {
	List        list.Model
	Collections map[string]model.Collection
	Collection  *model.Collection
	Client      client.API
}

ListView is responsible for presenting a list view to the user.

func (ListView) Init

func (lv ListView) Init() tea.Cmd

Init will initialise the view.

func (ListView) Update

func (lv ListView) Update(msg tea.Msg) (tea.Model, tea.Cmd)

Update will update the view.

func (ListView) View

func (lv ListView) View() string

View will render the view.

type NonInteractiveRenderer

type NonInteractiveRenderer struct{}

NonInteractiveRenderer will just output collection data to the UI.

func (*NonInteractiveRenderer) Render

func (r *NonInteractiveRenderer) Render(client client.API, opts ListUsedOptions, w io.Writer) error

Render will just display the results in a table.

Jump to

Keyboard shortcuts

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