client

package
v0.0.0-...-30dba9e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 5, 2025 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package client is the logical responsible for creating the TUI

Index

Constants

This section is empty.

Variables

View Source
var CyanStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#00FFFF"))
View Source
var HeaderStyle = lipgloss.NewStyle().
	Padding(0, 0).
	MarginTop(0).
	Border(lipgloss.RoundedBorder()).
	BorderForeground(lipgloss.Color("#FF69B4")).
	Bold(true)

HeaderStyle styles the header which currently just contains the title

View Source
var InputBoxStyle = lipgloss.NewStyle().
	Padding(0, 2).
	MarginTop(0).
	Border(lipgloss.RoundedBorder()).
	BorderForeground(lipgloss.Color("#00FFFF"))

InputBoxStyle style for the box which handles input

View Source
var ItemStyle = lipgloss.NewStyle().
	MarginTop(1).
	PaddingLeft(1).
	Foreground(lipgloss.Color("#800080"))

ItemStyle style for each message sent

View Source
var MessageBoxStyle = lipgloss.NewStyle().
	Padding(0, 0).
	MarginTop(0).
	Border(lipgloss.RoundedBorder()).
	BorderForeground(lipgloss.Color("white"))

MessageBoxStyle style for the box which contains the messages

View Source
var PinkStyle = lipgloss.NewStyle().Foreground(lipgloss.Color("#FF69B4"))
View Source
var SelectedItemStyle = lipgloss.NewStyle().
	PaddingLeft(1).
	Foreground(lipgloss.Color("#800080"))

SelectedItemStyle for each selected message, this controls the style of the message and user name TODO: split the colour of username and messages

Functions

func SendMessage

func SendMessage(msg Message, serverAddr string) error

Dont use this SendMessage provides utility to be able to send a message from the chat client to the grpc server

func StartClient

func StartClient()

StartClient starts the client and initializes the model, will most likely have to move this TODO: Move this code at some point

Types

type GRPCMessage

type GRPCMessage struct {
	Envelope *messenger.Envelope
	Err      error
}

type Message

type Message struct {
	// contains filtered or unexported fields
}

Message is a struct which represents, who sent the message, if it has been seen and what it contains along with the actual content of the message

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL