cui

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2016 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddCommand

func AddCommand(msg common.Message)

Adds a command to logger

func AddGroup

func AddGroup(groupName string, users []string)

Adds group to chatMap

func AddMessage

func AddMessage(msg common.Message)

Formats and adds message to logger

func AddUser

func AddUser(user string)

Adds user to chatMap

func CUIConsole

func CUIConsole(ccChan *logger.ChanChanMessage)

Create a CUI Console for logging

func QuitCUI

func QuitCUI()

Quits CUI

func RemoveUser

func RemoveUser(user string)

Removes user from usermap

func SetCreateConn

func SetCreateConn(f common.CreateConnFunc)

Sets the chat function for creating connection

func SetSendMessage

func SetSendMessage(f common.SendMessageFunc)

Sets the chat function for sending message

func StartCUI

func StartCUI()

Types

type Chat

type Chat struct {
	History []ChatMessage
	Name    string
	Users   []string
}

Chat struct for chatMap

type ChatMessage

type ChatMessage struct {
	*common.Message
	Read bool
}

Chat Message that extends the main message to see if user has read the message

type Command

type Command struct {
	Regex    *regexp.Regexp
	Command  string
	Desc     string
	Args     string
	Example  []string
	Callback CommandCallback
}

type CommandCallback

type CommandCallback func(line string, args []string)

Callback for when a command is called

Jump to

Keyboard shortcuts

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