Documentation
¶
Index ¶
- func AskUserDetailsCLI() (string, string)
- func StartTUI(c *Client) error
- type Client
- func (c *Client) ActionMessageType(p encoding.MsgProtocol, data []byte)
- func (c *Client) AwaitHandshakeResponse(conn net.Conn) (encoding.MsgProtocol, error)
- func (c *Client) AwaitMessage()
- func (c *Client) AwaitServerKey(conn net.Conn) ([]byte, error)
- func (c *Client) Connect(srvAddr string) error
- func (c *Client) ProcessMessage()
- func (c *Client) PushSentMessageToChatView(msg string)
- func (c *Client) PushToChatView(msg string)
- func (c *Client) SendAESKey(conn net.Conn) error
- func (c *Client) SendDisconnectionRequest()
- func (c *Client) SendHandshake(conn net.Conn) error
- func (c *Client) SendKeepAlive()
- func (c *Client) SendMessageToServer(msg []byte) error
- func (c *Client) SendWhisperToServer(msg []byte) error
- func (c *Client) SetAsHost(srv *server.Server)
- type ClientConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AskUserDetailsCLI ¶
Types ¶
type Client ¶
type Client struct { ActiveConn net.Conn Host bool HostServer *server.Server ServerAESKey []byte ServerPubKey *rsa.PublicKey LastCommand string TUI *tview.Application KeepAliveTimer *time.Ticker // contains filtered or unexported fields }
func NewClient ¶
func NewClient(cfg *ClientConfig) Client
func (*Client) ActionMessageType ¶
func (c *Client) ActionMessageType(p encoding.MsgProtocol, data []byte)
func (*Client) AwaitHandshakeResponse ¶
func (*Client) AwaitMessage ¶
func (c *Client) AwaitMessage()
func (*Client) ProcessMessage ¶
func (c *Client) ProcessMessage()
func (*Client) PushSentMessageToChatView ¶
func (*Client) PushToChatView ¶
func (*Client) SendDisconnectionRequest ¶
func (c *Client) SendDisconnectionRequest()
func (*Client) SendKeepAlive ¶
func (c *Client) SendKeepAlive()
func (*Client) SendMessageToServer ¶
func (*Client) SendWhisperToServer ¶
type ClientConfig ¶
type ClientConfig struct { Username string `json:"username"` UserColour string `json:"user_colour"` Logger *log.Logger RSAKeyPair crypto.RSAKeys ClientAESKey []byte KeepAlivePing time.Duration }
func SetupClientConfig ¶
func SetupClientConfig(filePath string, manualSet bool) *ClientConfig
Click to show internal directories.
Click to hide internal directories.