Documentation ¶
Index ¶
- type Stdout
- func (s *Stdout) Debug(msg ...string)
- func (s *Stdout) File(channel, from, title, url string)
- func (s *Stdout) Info(msg string)
- func (s *Stdout) List(list slk.ListItems, reverse bool)
- func (s *Stdout) Msg(channel, from, msg string, ts time.Time, section bool)
- func (s *Stdout) Notice(msg string)
- func (s *Stdout) Notify(channel, from, text string, force bool)
- func (s *Stdout) SetUsername(username string)
- func (s *Stdout) Typing(channel, user string, timeout time.Duration)
- func (s *Stdout) Warn(msg string)
- type Term
- func (t *Term) BindKey(key gocui.Key, handler func() error) error
- func (t *Term) Clear()
- func (t *Term) Debug(msg ...string)
- func (t *Term) File(channel, from, title, url string)
- func (t *Term) Info(msg string)
- func (t *Term) Init() (err error)
- func (t *Term) Input() string
- func (t *Term) List(list slk.ListItems, reverse bool)
- func (t *Term) Meta(str string)
- func (t *Term) Msg(channel, from, msg string, ts time.Time, section bool)
- func (t *Term) Notice(msg string)
- func (t *Term) Notify(channel, from, text string, force bool)
- func (t *Term) Quit()
- func (t *Term) Run() error
- func (t *Term) SetInput(str string, posX int, posY int, submit bool)
- func (t *Term) SetUsername(username string)
- func (t *Term) Typing(channel, user string, timeout time.Duration)
- func (t *Term) Warn(msg string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Stdout ¶
type Stdout struct {
// contains filtered or unexported fields
}
Stdout is a simple slk.Output implementation that writes everything to stdout.
func (*Stdout) SetUsername ¶
SetUsername sets the current user's name so the formatter can make it stand out.
type Term ¶
type Term struct {
// contains filtered or unexported fields
}
Term is a gocui / termbox slk.Output implementation that allows for user input which is communicated over the input channel as returned by NewTerm.
func NewTerm ¶
func NewTerm( appName, appIcon, username string, timeFormat string, notificationLimit time.Duration, notificationTimeout time.Duration, ) (t *Term, input chan string)
NewTerm returns a Term and an input channel which will receive the current input field contents when it is 'submitted'.
func (*Term) Quit ¶
func (t *Term) Quit()
Quit should stop the event loop and return the terminal to a usable state. TODO block until we've actually quit.
func (*Term) SetInput ¶
SetInput overwrites the current input field and sets the cursor to posX x posY.
If posY == -1 the cursor will be set to the last line.
If posX == -1 the cursor will be set the last column of the current line.
If submit == true the contents will be send to the input channel.
func (*Term) SetUsername ¶
SetUsername sets the current user's name so the formatter can make it stand out. Also disables notifications if messages are received from this user.