ttcf

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

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

Go to latest
Published: Jan 18, 2021 License: MIT Imports: 3 Imported by: 0

README

ttcf

Tiny Terminal Chat Framework

Handle the UI component of your terminal based chat in a few Go functions.

How:

// no idea yet

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Chat

type Chat struct {
	Config     Config
	Collection []Entry
}
var (
	Fakechat *Chat
)

func Init

func Init(c Config) (err error, chat Chat)

func (*Chat) PushEntry

func (c *Chat) PushEntry(e Entry) error

type Config

type Config struct {
	BodyMax,
	HeadMax,
	InputMax,
	CollectionMax int
	Title,
	Prompt,
	TimeFormat,
	Placeholder string
	InputCalls func(string) bool /* On input submission, function (of the client) called */
}

type Entry

type Entry struct {
	Head,
	Body string
	Time time.Time
	ID   uint64 /* Generated by client, ideally unique but that's their problem */
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳