SimpleChatCommon

package module
v0.0.0-...-dbced6d Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2013 License: MIT Imports: 5 Imported by: 0

README

Termbox UI Kit - SimlpeChatCommon

This is a common library to serialize messages back and forth between the client and server for the SimpleChatClient demo.

Documentation

Index

Constants

View Source
const MESSAGE_TOKEN string = "|%|"

Separator string to split the message up

View Source
const WHO_MESSAGE_REGEX_STR string = `^\|%WHO%\|`
View Source
const WHO_MESSAGE_TOKEN string = "|%WHO%|"

Variables

This section is empty.

Functions

func ColStringSliceFromStringSlice

func ColStringSliceFromStringSlice(texts []string, color string) []*tbuikit.ColorizedString

For convenience, takes a slice of strings and a single color and then converts them to slice of message objects. Obviously, they'll all have the same color but in many cases this is desirable.

func Create

func Create(text, color string) *tbuikit.ColorizedString

Creates a new colorized string object, from a body string and color string

func IsWhoMessage

func IsWhoMessage(colorizedString *tbuikit.ColorizedString) bool

Check if this message from the server is a "who" message

func Pack

func Pack(colorizedString *tbuikit.ColorizedString) string

Converts a colorized string object to a string

func Unpack

func Unpack(raw string) *tbuikit.ColorizedString

Converts a string to a ColorizedString object

Types

type ColorList

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

func (*ColorList) FromColor

func (this *ColorList) FromColor(col termbox.Attribute) string

func (*ColorList) Get

func (this *ColorList) Get(color string) termbox.Attribute

func (*ColorList) IsColor

func (this *ColorList) IsColor(colStr string) bool

Jump to

Keyboard shortcuts

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