Documentation
¶
Overview ¶
mpty provides primitives for creating multiplayer bubbletea applications.
Index ¶
- Variables
- type ClientConnectMsg
- type ClientDisconnectMsg
- type ClientId
- type ClientInfoModel
- func (m *ClientInfoModel) Id() ClientId
- func (m *ClientInfoModel) Init() tea.Cmd
- func (m *ClientInfoModel) Update(msg tea.Msg) (tea.Model, tea.Cmd)
- func (m *ClientInfoModel) UpdateInfo(msg tea.Msg) (*ClientInfoModel, tea.Cmd)
- func (m *ClientInfoModel) View() tea.View
- func (m *ClientInfoModel) ViewHeight() int
- type ClientMain
- type ClientModel
- type Input
- type Main
- type NewClientProgram
- type Program
- type Recorder
- type Session
Constants ¶
This section is empty.
Variables ¶
View Source
var (
Bold = lipgloss.NewStyle().Bold(true)
)
Functions ¶
This section is empty.
Types ¶
type ClientConnectMsg ¶
type ClientConnectMsg ClientId
type ClientDisconnectMsg ¶
type ClientDisconnectMsg ClientId
type ClientInfoModel ¶
type ClientInfoModel struct {
Term string
Width int
Height int
Time time.Time
Sess Session
Who *apitype.WhoIsResponse
// contains filtered or unexported fields
}
func NewClientInfoModelFromSsh ¶
func NewClientInfoModelFromSsh(pty ssh.Pty, sess Session, who *apitype.WhoIsResponse) *ClientInfoModel
func NewClientInfoModelFromWebtty ¶
func NewClientInfoModelFromWebtty(sess Session, who *apitype.WhoIsResponse) *ClientInfoModel
func (*ClientInfoModel) Id ¶
func (m *ClientInfoModel) Id() ClientId
func (*ClientInfoModel) Init ¶
func (m *ClientInfoModel) Init() tea.Cmd
func (*ClientInfoModel) UpdateInfo ¶
func (m *ClientInfoModel) UpdateInfo(msg tea.Msg) (*ClientInfoModel, tea.Cmd)
func (*ClientInfoModel) View ¶
func (m *ClientInfoModel) View() tea.View
func (*ClientInfoModel) ViewHeight ¶
func (m *ClientInfoModel) ViewHeight() int
type ClientMain ¶
type ClientMain struct {
Input
ClientModel
// contains filtered or unexported fields
}
func (*ClientMain) Init ¶
func (m *ClientMain) Init() tea.Cmd
func (*ClientMain) ReadMsgsCmd ¶
func (m *ClientMain) ReadMsgsCmd() tea.Cmd
type ClientModel ¶
type NewClientProgram ¶
type NewClientProgram func(context.Context, ClientModel, ...tea.ProgramOption) *tea.Program
type Program ¶
type Program struct {
// TODO: implement our own minimal tea compatible event loop since this
// program does not interact with a PTY/TTY at any point
*tea.Program
// Send is for a non-blocking many-to-one for clients to communicate with
// the mpty Program since the tea.Program.Send() API is unfortunately
// blocking
Send Input
// contains filtered or unexported fields
}
func NewProgram ¶
func (Program) NewClientProgram ¶
func (p Program) NewClientProgram() NewClientProgram
type Recorder ¶
type Recorder interface {
Save(mptymsg.Recordable) (mptymsg.Recordable, error)
Read(int) ([]mptymsg.Recordable, error)
}
Click to show internal directories.
Click to hide internal directories.