Documentation ¶
Index ¶
- func NewIncomingRequestsModel(rpcClient *app.RpcClient) incomingRequestsModel
- func NewLandingModel(rpcClient *app.RpcClient) model
- func NewLoginModel(rpcClient *app.RpcClient) loginModel
- func NewOutgoingRequestsModel(rpcClient *app.RpcClient) outgoingRequestsModel
- func NewRegisterModel(rpcClient *app.RpcClient) registerModel
- type AcceptFriendRequestMsg
- type AcceptFriendRequestResultMsg
- type ChatFriendListModel
- type ChatMessage
- type ChatModel
- type ChatPanelModel
- type Choice
- type ClearStatusMessageMsg
- type DeclineFriendRequestMsg
- type DeclineFriendRequestResultMsg
- type DummyModel
- type FriendListModel
- type FriendListMsg
- type FriendManagementModel
- type FriendSelectedMsg
- type IncomingFriendRequestsMsg
- type OutgoingFriendRequestsMsg
- type ReceivedMessage
- type RemoveFriendMsg
- type RemoveFriendResultMsg
- type SendFriendRequestMsg
- type SendFriendRequestResultMsg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewLoginModel ¶
NewLoginModel initializes the login component
func NewRegisterModel ¶
NewRegisterModel initializes the register component
Types ¶
type AcceptFriendRequestMsg ¶
type AcceptFriendRequestMsg struct {
RequestID int32
}
type ChatFriendListModel ¶
type ChatFriendListModel struct {
// contains filtered or unexported fields
}
ChatFriendListModel manages the friends list within the chat context.
func NewChatFriendListModel ¶
func NewChatFriendListModel(rpcClient *app.RpcClient) ChatFriendListModel
NewChatFriendListModel initializes the ChatFriendListModel.
func (ChatFriendListModel) Init ¶
func (m ChatFriendListModel) Init() tea.Cmd
Init initializes the ChatFriendListModel with a command to fetch the friend list.
func (ChatFriendListModel) Update ¶
Update handles key presses to navigate the friend list and processes incoming messages.
func (ChatFriendListModel) View ¶
func (m ChatFriendListModel) View() string
View renders the chat friend list with the currently selected friend highlighted.
type ChatMessage ¶
ChatMessage represents a message in the chat.
type ChatModel ¶
type ChatModel struct {
// contains filtered or unexported fields
}
func NewChatModel ¶
NewChatModel initializes a new ChatModel.
func (*ChatModel) SetActiveUser ¶
type ChatPanelModel ¶
type ChatPanelModel struct {
// contains filtered or unexported fields
}
Main menu model now has ChatModel as a pointer for in-place updates
func NewChatPanelModel ¶
func NewChatPanelModel(rpcClient *app.RpcClient) ChatPanelModel
Initialize the main menu model
func (ChatPanelModel) Init ¶
func (m ChatPanelModel) Init() tea.Cmd
func (ChatPanelModel) View ¶
func (m ChatPanelModel) View() string
View function renders the Main Menu UI
type ClearStatusMessageMsg ¶
type ClearStatusMessageMsg struct{}
type DeclineFriendRequestMsg ¶
type DeclineFriendRequestMsg struct {
RequestID int32
}
type DummyModel ¶
type DummyModel struct{}
func NewDummyModel ¶
func NewDummyModel() DummyModel
func (DummyModel) Init ¶
func (m DummyModel) Init() tea.Cmd
Init function initializes the main menu model
func (DummyModel) View ¶
func (m DummyModel) View() string
type FriendListModel ¶
type FriendListModel struct {
// contains filtered or unexported fields
}
FriendListModel represents the model for the friend list page
func NewFriendListModel ¶
func NewFriendListModel(rpcClient *app.RpcClient) FriendListModel
NewFriendListModel creates and returns a new friend list model
func (FriendListModel) Init ¶
func (m FriendListModel) Init() tea.Cmd
Init initializes the model (no initialization needed here)
type FriendListMsg ¶
Data Messages (used to pass data to child models)
type FriendManagementModel ¶
type FriendManagementModel struct {
// contains filtered or unexported fields
}
func NewFriendManagementModel ¶
func NewFriendManagementModel(rpcClient *app.RpcClient) FriendManagementModel
func (FriendManagementModel) Init ¶
func (m FriendManagementModel) Init() tea.Cmd
func (FriendManagementModel) View ¶
func (m FriendManagementModel) View() string
type FriendSelectedMsg ¶
type IncomingFriendRequestsMsg ¶
type IncomingFriendRequestsMsg struct { Requests []*friends.FriendRequest // Actual FriendRequest type from proto Err error }
type OutgoingFriendRequestsMsg ¶
type OutgoingFriendRequestsMsg struct { Requests []*friends.FriendRequest // Actual FriendRequest type from proto Err error }
type ReceivedMessage ¶
Define a custom message type for received messages.
type RemoveFriendMsg ¶
type RemoveFriendMsg struct {
FriendID int32
}
type RemoveFriendResultMsg ¶
type SendFriendRequestMsg ¶
type SendFriendRequestMsg struct {
RecipientUsername string
}
Action Messages (sent from child models to parent model to request an action)
type SendFriendRequestResultMsg ¶
Result Messages (returned by commands after action execution)