ui

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Components

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

type Dimensions

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

type History

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

func NewHistory

func NewHistory() *History

func (*History) Add

func (h *History) Add(input string) *History

func (*History) GetAll

func (h *History) GetAll() map[int]string

func (*History) GetCursor

func (h *History) GetCursor() int

func (*History) GetNext

func (h *History) GetNext() *string

func (*History) GetPrevious

func (h *History) GetPrevious() *string

func (*History) Reset

func (h *History) Reset() *History

type Input

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

func NewInput

func NewInput(runMode RunMode, promptMode PromptMode, pipe string, prompts []string) (*Input, error)

func (*Input) GetArgs

func (i *Input) GetArgs() string

func (*Input) GetPipe

func (i *Input) GetPipe() string

func (*Input) GetPromptMode

func (i *Input) GetPromptMode() PromptMode

func (*Input) GetRunMode

func (i *Input) GetRunMode() RunMode

type Prompt

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

func NewPrompt

func NewPrompt(mode PromptMode) *Prompt

func (*Prompt) AsString

func (p *Prompt) AsString() string

func (*Prompt) Blur

func (p *Prompt) Blur() *Prompt

func (*Prompt) Focus

func (p *Prompt) Focus() *Prompt

func (*Prompt) GetMode

func (p *Prompt) GetMode() PromptMode

func (*Prompt) GetValue

func (p *Prompt) GetValue() string

func (*Prompt) SetMode

func (p *Prompt) SetMode(mode PromptMode) *Prompt

func (*Prompt) SetValue

func (p *Prompt) SetValue(value string) *Prompt

func (*Prompt) Update

func (p *Prompt) Update(msg tea.Msg) (*Prompt, tea.Cmd)

func (*Prompt) View

func (p *Prompt) View() string

type PromptMode

type PromptMode int
const (
	ExecPromptMode PromptMode = iota
	TokenConfigPromptMode
	ModelConfigPromptMode
	ApiBaseConfigPromptMode
	ChatPromptMode
	DefaultPromptMode
)

func GetPromptModeFromString

func GetPromptModeFromString(s string) PromptMode

func (PromptMode) String

func (m PromptMode) String() string

type Renderer

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

func NewRenderer

func NewRenderer(options ...glamour.TermRendererOption) *Renderer

func (*Renderer) RenderApiBaseConfigMessage

func (r *Renderer) RenderApiBaseConfigMessage() string

func (*Renderer) RenderApiTokenConfigMessage

func (r *Renderer) RenderApiTokenConfigMessage() string

func (*Renderer) RenderConfigMessage

func (r *Renderer) RenderConfigMessage(username string) string

func (*Renderer) RenderContent

func (r *Renderer) RenderContent(in string) string

func (*Renderer) RenderError

func (r *Renderer) RenderError(in string) string

func (*Renderer) RenderHelp

func (r *Renderer) RenderHelp(in string) string

func (*Renderer) RenderHelpMessage

func (r *Renderer) RenderHelpMessage() string

func (*Renderer) RenderSuccess

func (r *Renderer) RenderSuccess(in string) string

func (*Renderer) RenderWarning

func (r *Renderer) RenderWarning(in string) string

type RunMode

type RunMode int
const (
	CliMode RunMode = iota
	ReplMode
)

func (RunMode) String

func (m RunMode) String() string

type Spinner

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

func NewSpinner

func NewSpinner() *Spinner

func (*Spinner) Tick

func (s *Spinner) Tick() tea.Msg

func (*Spinner) Update

func (s *Spinner) Update(msg tea.Msg) (*Spinner, tea.Cmd)

func (*Spinner) View

func (s *Spinner) View() string

type State

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

type TextareaModel added in v0.1.4

type TextareaModel struct {
	Textarea textarea.Model
	Err      error
}

func InitialTextareaPrompt added in v0.1.4

func InitialTextareaPrompt(value string) TextareaModel

func (TextareaModel) Init added in v0.1.4

func (m TextareaModel) Init() tea.Cmd

func (TextareaModel) Update added in v0.1.4

func (m TextareaModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (TextareaModel) View added in v0.1.4

func (m TextareaModel) View() string

type Ui

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

func NewUi

func NewUi(input *Input) *Ui

func (*Ui) Init

func (u *Ui) Init() tea.Cmd

func (*Ui) Update

func (u *Ui) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Ui) View

func (u *Ui) View() string

Jump to

Keyboard shortcuts

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