tui

package
v0.0.0-...-8cea320 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TableHelpMsg string = "c - CREATE, e - EDIT, d - DELETE, r - RUN/STOP"
	EditHelpMsg  string = "enter - CONFIRM, esc - CANCEL"
)

Variables

This section is empty.

Functions

func NewTableModel

func NewTableModel(tunnelList []core.Tunnel) *table.Model

func ValidateDest

func ValidateDest(s string) error

dest must be xxx.xxx.xxx.xxx:<port> or localhost:<port>

func ValidateName

func ValidateName(s string) error

no prefixing of trailing spaces allowed

func ValidateSource

func ValidateSource(s string) error

source must be localhost:<port>

func WriteTTY

func WriteTTY(tty string, msg string)

for debug

Types

type CLIEnd

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

connection between gopolar core and cli

func NewCLIEnd

func NewCLIEnd() *CLIEnd

func (*CLIEnd) CreateTunnel

func (ce *CLIEnd) CreateTunnel(name string, source string, dest string) (uint64, error)

returns ID of the new tunnel

func (*CLIEnd) DELETE

func (ce *CLIEnd) DELETE(url string) (map[string]interface{}, error)

func (*CLIEnd) DeleteTunnel

func (ce *CLIEnd) DeleteTunnel(id int64) error

func (*CLIEnd) EditTunnel

func (ce *CLIEnd) EditTunnel(id uint64, newName string, newSource string, newDest string) error

func (*CLIEnd) GET

func (ce *CLIEnd) GET(url string) (map[string]interface{}, error)

func (*CLIEnd) GetAboutInfo

func (ce *CLIEnd) GetAboutInfo() (core.AboutInfo, error)

func (*CLIEnd) GetTunnelList

func (ce *CLIEnd) GetTunnelList() ([]core.Tunnel, error)

func (*CLIEnd) POST

func (ce *CLIEnd) POST(url string, data interface{}) (map[string]interface{}, error)

func (*CLIEnd) ToggleTunnel

func (ce *CLIEnd) ToggleTunnel(id int64) error

type EditModel

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

func NewEditModel

func NewEditModel() *EditModel

func (EditModel) GetInput

func (m EditModel) GetInput() (name string, source string, dest string)

func (EditModel) Init

func (m EditModel) Init() tea.Cmd

func (*EditModel) Reset

func (m *EditModel) Reset()

func (*EditModel) SetValues

func (m *EditModel) SetValues(name, source, dest string)

reset edit view to default, then set values

func (EditModel) Update

func (m EditModel) Update(msg tea.Msg) (EditModel, tea.Cmd)

func (EditModel) View

func (m EditModel) View() string

type UIModel

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

func NewUIModel

func NewUIModel(end *CLIEnd) *UIModel

func (UIModel) Init

func (m UIModel) Init() tea.Cmd

func (UIModel) Update

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

func (UIModel) View

func (m UIModel) View() string

Jump to

Keyboard shortcuts

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