uiutil

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Copyright 2026 Teradata

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Package uiutil provides UI utility functions.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearStatus

func ClearStatus() tea.Cmd

ClearStatus clears the status message.

func CmdHandler

func CmdHandler(msg tea.Msg) tea.Cmd

CmdHandler wraps a message in a command that returns that message.

func ExecShell

func ExecShell(ctx context.Context, cmdStr string, callback tea.ExecCallback) tea.Cmd

ExecShell executes a command in the shell.

func OpenInEditor

func OpenInEditor(path string) error

OpenInEditor opens a file in the default editor.

func OpenURL

func OpenURL(url string) error

OpenURL opens a URL in the default browser.

func ReportError

func ReportError(msg string) tea.Cmd

ReportError reports an error message.

func ReportInfo

func ReportInfo(msg string) tea.Cmd

ReportInfo reports an info message.

func ReportWarn

func ReportWarn(msg string) tea.Cmd

ReportWarn reports a warning message.

func SendInfo

func SendInfo(text string, infoType InfoType) tea.Cmd

SendInfo sends an info message.

func SendInfoWithDuration

func SendInfoWithDuration(text string, infoType InfoType, duration time.Duration) tea.Cmd

SendInfoWithDuration sends an info message with duration.

Types

type ClearStatusMsg

type ClearStatusMsg struct{}

ClearStatusMsg clears the status message.

type Cursor

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

Cursor represents a cursor state.

func (*Cursor) Hide

func (c *Cursor) Hide()

Hide hides the cursor.

func (*Cursor) Show

func (c *Cursor) Show()

Show shows the cursor.

func (*Cursor) Visible

func (c *Cursor) Visible() bool

Visible returns whether cursor is visible.

type InfoMsg

type InfoMsg struct {
	Text     string
	Msg      string // Alias for Text
	Type     InfoType
	Duration time.Duration
	TTL      time.Duration // Alias for Duration
}

InfoMsg is an info message.

type InfoType

type InfoType int

InfoType represents the type of info message.

const (
	InfoTypeInfo InfoType = iota
	InfoTypeSuccess
	InfoTypeWarn
	InfoTypeError
	InfoTypeUpdate
)

Jump to

Keyboard shortcuts

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