client

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

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

Go to latest
Published: Oct 28, 2023 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Wwidth, Wheight, _ = terminal.GetSize(fd)
	WeightSet          = 23
	WeightChat         = Wwidth - WeightSet - 8
)
View Source
var Keys = KeyMap{
	Quit:            key.NewBinding(key.WithKeys("q", "ctrl+c"), key.WithHelp("q", "quit")),
	Help:            key.NewBinding(key.WithKeys("?"), key.WithHelp("?", "toggle help")),
	SwitchFocus:     key.NewBinding(key.WithKeys("tab"), key.WithHelp("tab", "switch focus")),
	Up:              key.NewBinding(key.WithKeys("up", "k"), key.WithHelp("↑/k", "move up")),
	Down:            key.NewBinding(key.WithKeys("down", "j"), key.WithHelp("↓/j", "move down")),
	FirstLine:       key.NewBinding(key.WithKeys("g", "home"), key.WithHelp("g/home", "first item")),
	LastLine:        key.NewBinding(key.WithKeys("G", "end"), key.WithHelp("G/end", "last item")),
	PageDown:        key.NewBinding(key.WithKeys("ctrl+d", "pgdown"), key.WithHelp("Ctrl+d", "preview page down")),
	PageUp:          key.NewBinding(key.WithKeys("ctrl+u", "pgup"), key.WithHelp("Ctrl+u", "preview page up")),
	NextTab:         key.NewBinding(key.WithKeys("right", "l"), key.WithHelp("→/l", "next section")),
	PrevTab:         key.NewBinding(key.WithKeys("left", "h"), key.WithHelp("←/h", "previous section")),
	MultiLineToggle: key.NewBinding(key.WithKeys("ctrl+l"), key.WithHelp("ctrl+l", "Toggle multiline edit mode")),
	MultiLineSend:   key.NewBinding(key.WithKeys("ctrl+j"), key.WithHelp("ctrl+j", "Send multiline message")),
	Send:            key.NewBinding(key.WithKeys("enter"), key.WithHelp("enter", "Send message")),
	Filter:          key.NewBinding(key.WithKeys("/"), key.WithHelp("/", "Filter PGP Keys")),
	ToggleKey:       key.NewBinding(key.WithKeys(" "), key.WithHelp(" ", "Toggle PGP Key selected state")),
}

Functions

func GetKeyMap

func GetKeyMap() help.KeyMap

Types

type ChatUser

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

func (ChatUser) Description

func (c ChatUser) Description() string

func (ChatUser) FilterValue

func (c ChatUser) FilterValue() string

func (ChatUser) Title

func (c ChatUser) Title() string

type Client

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

func New

func New(debug bool) (Client, *os.File)

func (Client) Init

func (c Client) Init() tea.Cmd

func (*Client) InputActive

func (c *Client) InputActive() bool

func (Client) Update

func (c Client) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (Client) View

func (c Client) View() string

type KeyMap

type KeyMap struct {
	Quit            key.Binding
	Help            key.Binding
	SwitchFocus     key.Binding
	Up              key.Binding
	Down            key.Binding
	FirstLine       key.Binding
	LastLine        key.Binding
	PageDown        key.Binding
	PageUp          key.Binding
	NextTab         key.Binding
	PrevTab         key.Binding
	MultiLineToggle key.Binding
	Send            key.Binding
	MultiLineSend   key.Binding
	Filter          key.Binding
	ToggleKey       key.Binding
}

func (KeyMap) AppKeys

func (k KeyMap) AppKeys() []key.Binding

func (KeyMap) FullHelp

func (k KeyMap) FullHelp() [][]key.Binding

func (KeyMap) NavigationKeys

func (k KeyMap) NavigationKeys() []key.Binding

func (KeyMap) QuitAndHelpKeys

func (k KeyMap) QuitAndHelpKeys() []key.Binding

func (KeyMap) ShortHelp

func (k KeyMap) ShortHelp() []key.Binding

type PublicKey

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

func (PublicKey) Description

func (p PublicKey) Description() string

func (PublicKey) FilterValue

func (p PublicKey) FilterValue() string

func (PublicKey) Title

func (p PublicKey) Title() string

Jump to

Keyboard shortcuts

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