Documentation ¶
Index ¶
- Constants
- Variables
- func Init(c *cmd.Command)
- func Logic(c *cmd.Command)
- func SetFocus(name string) func(g *gocui.Gui) error
- type ChatContext
- type ChatManager
- func (chatManager *ChatManager) Connect() error
- func (chatManager *ChatManager) Disconnect() error
- func (chatManager *ChatManager) Recipient() string
- func (chatManager *ChatManager) ScrollDown()
- func (chatManager *ChatManager) ScrollUp()
- func (chatManager *ChatManager) SendMessage(text string) error
- func (chatManager *ChatManager) Start() error
- type ChatView
- type InputView
- type ViewDimensionHandler
Constants ¶
View Source
const (
MAX_INPUT_LENGTH = 1024
)
Variables ¶
View Source
var Cmd = &cmd.Command{ Name: "chat", Help: "Interactive chat with recipient", Context: &ChatContext{}, Init: Init, Logic: Logic, }
Functions ¶
Types ¶
type ChatContext ¶
type ChatContext struct {
To *string
}
type ChatManager ¶
type ChatManager struct {
// contains filtered or unexported fields
}
func NewChatManager ¶
func NewChatManager(chatView *ChatView, inputView *InputView, recipient string) (*ChatManager, error)
func (*ChatManager) Connect ¶
func (chatManager *ChatManager) Connect() error
func (*ChatManager) Disconnect ¶
func (chatManager *ChatManager) Disconnect() error
func (*ChatManager) Recipient ¶
func (chatManager *ChatManager) Recipient() string
func (*ChatManager) ScrollDown ¶
func (chatManager *ChatManager) ScrollDown()
func (*ChatManager) ScrollUp ¶
func (chatManager *ChatManager) ScrollUp()
func (*ChatManager) SendMessage ¶
func (chatManager *ChatManager) SendMessage(text string) error
func (*ChatManager) Start ¶
func (chatManager *ChatManager) Start() error
type ChatView ¶
type ChatView struct {
// contains filtered or unexported fields
}
func NewChatView ¶
func NewChatView(name string, dim ViewDimensionHandler) *ChatView
func (*ChatView) AddMessage ¶
func (*ChatView) ScrollDown ¶
func (cv *ChatView) ScrollDown()
func (*ChatView) SetChatManager ¶
func (cv *ChatView) SetChatManager(chatManager *ChatManager)
type InputView ¶
type InputView struct {
// contains filtered or unexported fields
}
func NewInputView ¶
func NewInputView(name string, dim ViewDimensionHandler, maxLength int) *InputView
func (*InputView) SetChatManager ¶
func (cv *InputView) SetChatManager(chatManager *ChatManager)
type ViewDimensionHandler ¶
Click to show internal directories.
Click to hide internal directories.