ui

package
v0.5.3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2021 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatDuration added in v0.3.8

func FormatDuration(d time.Duration, minParts int) (str string, parts int)

func StripUnprintable added in v0.3.8

func StripUnprintable(str string) string

Types

type Highlight

type Highlight byte
const (
	HLNone Highlight = 1 << iota
	HLTitle
	HLActive
	HLMuted
	HLSlight
	HLProblem
	HLTemporary
)

type Msg

type Msg struct {
	From      string
	Stamp     time.Time
	Message   string
	Notify    chatdata.Notify
	Highlight Highlight
}

func (Msg) NotifyNever

func (m Msg) NotifyNever() bool

func (Msg) NotifyPersonal

func (m Msg) NotifyPersonal() bool

type PlainUI

type PlainUI struct {
	io.Writer
}

func Plain

func Plain(w io.Writer) *PlainUI

func (*PlainUI) Broadcast

func (p *PlainUI) Broadcast(msgs []Msg, scroll bool)

func (*PlainUI) Clear

func (p *PlainUI) Clear()

func (*PlainUI) Err

func (p *PlainUI) Err(err error)

func (*PlainUI) Flash

func (p *PlainUI) Flash(msg string, dur time.Duration)

func (*PlainUI) JumpToActive

func (p *PlainUI) JumpToActive()

func (*PlainUI) Latency

func (p *PlainUI) Latency(time.Duration)

func (*PlainUI) Log

func (p *PlainUI) Log(msg string)

func (*PlainUI) MusicState

func (p *PlainUI) MusicState(s State)

func (*PlainUI) UserTyping added in v0.3.9

func (p *PlainUI) UserTyping(string, bool)

func (*PlainUI) Users

func (p *PlainUI) Users([]string)

type State

type State struct {
	Song     string
	Paused   bool
	Position time.Duration
	Duration time.Duration
	Volume   float64
}

func (State) Pos

func (s State) Pos() float64

type TermUI

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

func Term

func Term(metaPrefix bool, maxMessages, indent int, scrollTop bool) *TermUI

func (*TermUI) BackspaceInput

func (ui *TermUI) BackspaceInput()

func (*TermUI) Broadcast

func (ui *TermUI) Broadcast(msgs []Msg, scroll bool)

func (*TermUI) Clear

func (ui *TermUI) Clear()

func (*TermUI) CursorHide added in v0.3.7

func (ui *TermUI) CursorHide(set bool)

func (*TermUI) Err

func (ui *TermUI) Err(err error)

func (*TermUI) ErrStr

func (ui *TermUI) ErrStr(err string)

func (*TermUI) Flash

func (ui *TermUI) Flash(msg string, dur time.Duration)

func (*TermUI) Flush

func (ui *TermUI) Flush()

func (*TermUI) GetInput

func (ui *TermUI) GetInput() string

func (*TermUI) Input

func (ui *TermUI) Input(n byte)

func (*TermUI) JumpToActive

func (ui *TermUI) JumpToActive()

func (*TermUI) Latency

func (ui *TermUI) Latency(n time.Duration)
func (ui *TermUI) Link(id string) (*url.URL, bool)

func (*TermUI) Log

func (ui *TermUI) Log(msg string)

func (*TermUI) MusicState

func (ui *TermUI) MusicState(s State)

func (*TermUI) ResetInput

func (ui *TermUI) ResetInput() []byte

func (*TermUI) Scroll

func (ui *TermUI) Scroll(amount int)

func (*TermUI) ScrollPageDown

func (ui *TermUI) ScrollPageDown()

func (*TermUI) ScrollPageUp

func (ui *TermUI) ScrollPageUp()

func (*TermUI) Search added in v0.3.7

func (ui *TermUI) Search(qry string)

func (*TermUI) SetInput

func (ui *TermUI) SetInput(n string)

func (*TermUI) Start

func (ui *TermUI) Start()

func (*TermUI) UserTyping added in v0.3.9

func (ui *TermUI) UserTyping(who string, is bool)

func (*TermUI) Users

func (ui *TermUI) Users(users []string)

Jump to

Keyboard shortcuts

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