study

package
v0.0.18 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

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

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

Variables

This section is empty.

Functions

func RenderStudy

func RenderStudy(client client.API, study model.Study) string

RenderStudy will produce a detailed view of the selected study.

Types

type CsvRenderer added in v0.0.8

type CsvRenderer struct{}

CsvRenderer will render the output in a CSV format.

func (*CsvRenderer) Render added in v0.0.8

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

Render will render the studies in the CSV format.

type InteractiveRenderer added in v0.0.5

type InteractiveRenderer struct{}

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

func (*InteractiveRenderer) Render added in v0.0.5

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

Render will render the list in an interactive manner.

type ListRenderer added in v0.0.5

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

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

func (*ListRenderer) Render added in v0.0.5

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

Render will use the render strategy to render the studies.

func (*ListRenderer) SetStrategy added in v0.0.5

func (r *ListRenderer) SetStrategy(s ListStrategy)

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

type ListStrategy added in v0.0.5

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 added in v0.0.5

type ListUsedOptions struct {
	Status         string
	NonInteractive bool
	Fields         string
	ProjectID      string
}

ListUsedOptions are the options selected by the user.

type ListView

type ListView struct {
	List    list.Model
	Studies map[string]model.Study
	Study   *model.Study
	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 added in v0.0.5

type NonInteractiveRenderer struct{}

NonInteractiveRenderer will just output study data to the UI.

func (*NonInteractiveRenderer) Render added in v0.0.5

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