Documentation
¶
Index ¶
- Constants
- Variables
- func FormatTimeAsAge(t time.Time, now time.Time) string
- func NickFromWho(who string) string
- type ChatSizeMsg
- type Client
- func (m *Client) At(row, cell int) string
- func (m *Client) AtRaw(row int) Msg
- func (m *Client) ChatViewHeight() int
- func (m *Client) Columns() int
- func (m *Client) Err() error
- func (m *Client) Id() mpty.ClientId
- func (m *Client) Init() tea.Cmd
- func (m *Client) PrintErrMsg(err error)
- func (m *Client) PrintInfoMsg(s string)
- func (m *Client) Rows() int
- func (m *Client) SetSize(w, h int)
- func (m *Client) SetupCmdPalette(additionalCmds ...Cmd)
- func (m *Client) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m *Client) UpdateChat(msg tea.Msg) (*Client, tea.Cmd)
- func (m *Client) UpdateClient(msg tea.Msg) (mpty.ClientModel, tea.Cmd)
- func (m *Client) View() tea.View
- func (m *Client) ViewTo(w io.Writer)
- type Cmd
- type CmdPalette
- type Msg
- type NamesReq
- type ServerModel
- type WhoisReq
Constants ¶
View Source
const ( SysNick = "system" HelpNick = "help" InfoNick = "info" ErrNick = "error" )
View Source
const ( COL_DEBUG = iota COL_TS COL_WHO COL_MSG COL_SZ )
Variables ¶
View Source
var ( Bold = lipgloss.NewStyle().Bold(true) None = lipgloss.NewStyle() AlignRight = lipgloss.NewStyle().Align(lipgloss.Right) StyleZeroWidth = lipgloss.NewStyle().Padding(0).Margin(0).Width(0).MaxWidth(0) StyleDebugCol = lipgloss.NewStyle(). MarginRight(1) StyleTSCol = lipgloss.NewStyle(). Faint(true). MarginRight(1). Align(lipgloss.Right). Width(len(time.TimeOnly) + 1). MaxWidth(len(time.TimeOnly) + 1) VertLine = lipgloss.Border{ Left: "│", TopRight: "│", Right: "│", BottomRight: "│", MiddleRight: "│", } StyleNick = lipgloss.NewStyle(). Align(lipgloss.Right). Margin(0). MarginRight(1). Padding(0). PaddingRight(1). PaddingLeft(0). Border(VertLine, false). BorderRight(true) StyleSysNick = StyleNick.Faint(true) StyleMsgCol = lipgloss.NewStyle(). Align(lipgloss.Left). Margin(0). Padding(0). PaddingLeft(0). PaddingRight(1) StyleSysMsg = StyleMsgCol.Faint(true) )
Functions ¶
func NickFromWho ¶
Types ¶
type ChatSizeMsg ¶
type ChatSizeMsg struct {
Width, Height int
}
type Client ¶
func (*Client) ChatViewHeight ¶
func (*Client) PrintErrMsg ¶
func (*Client) PrintInfoMsg ¶
func (*Client) SetupCmdPalette ¶
TODO
-> Available commands: /away [REASON] - Set away reason, or empty to unset. /back - Clear away status. /focus [USER ...] - Only show messages from focused users, or $ to reset. /ignore [USER] - Hide messages from USER, /unignore USER to stop hiding. /msg USER MESSAGE - Send MESSAGE to USER. /nick NAME - Rename yourself. /reply MESSAGE - Reply with MESSAGE to the previous private message. /theme [colors|...] - Set your color theme.
func (*Client) UpdateClient ¶
type Cmd ¶
type Cmd struct {
// Use is a short use description. The first word will be used as the
// command
Use string
// Aliases is a list of alternative names for the command
Aliases []string
// Short is a description that will be displayed in the help
Short string
Hidden bool
// Run is the function that is executed for the command
Run func(cmd *Cmd, args []string) tea.Cmd
}
type CmdPalette ¶
type CmdPalette struct {
// contains filtered or unexported fields
}
func NewCmdPalette ¶
func NewCmdPalette(leader string, cmds ...Cmd) CmdPalette
func (CmdPalette) Find ¶
func (p CmdPalette) Find(cmd string) *Cmd
func (CmdPalette) Suggestions ¶
func (p CmdPalette) Suggestions() []string
func (CmdPalette) Usage ¶
func (p CmdPalette) Usage() string
type Msg ¶
type ServerModel ¶
type ServerModel struct {
// contains filtered or unexported fields
}
func (*ServerModel) Init ¶
func (m *ServerModel) Init() tea.Cmd
func (*ServerModel) UpdateBlokFall ¶
func (m *ServerModel) UpdateBlokFall(msg tea.Msg) tea.Cmd
func (*ServerModel) UpdateChat ¶
func (m *ServerModel) UpdateChat(msg tea.Msg)
func (*ServerModel) View ¶
func (m *ServerModel) View() tea.View
Click to show internal directories.
Click to hide internal directories.