Documentation ¶
Index ¶
- Constants
- Variables
- func IRCLineToAnsi(line string, colorLevel ColorLevel, outputItalics bool) string
- func IRCMessageToAnsi(message string, colorLevel ColorLevel, outputItalics bool) string
- func ReadScript(filename string) (commands []string, err error)
- func ReplaceControlCodes(line string) string
- type ColorLevel
- type ConnectionConfig
- type IRCConnection
- type IRCWebSocket
- type Socket
- type Transcript
Constants ¶
View Source
const ( InitialBufferSize = 1024 MaxBufferSize = 1024 * 1024 )
View Source
const (
// SemVer is the semantic version of this program
SemVer = "0.5.2"
)
Variables ¶
View Source
var ( // ErrorDisconnected indicates that this socket is disconnected. ErrorDisconnected = errors.New("Socket is disconnected") )
Functions ¶
func IRCLineToAnsi ¶ added in v0.4.0
func IRCLineToAnsi(line string, colorLevel ColorLevel, outputItalics bool) string
func IRCMessageToAnsi ¶ added in v0.4.0
func IRCMessageToAnsi(message string, colorLevel ColorLevel, outputItalics bool) string
func ReadScript ¶ added in v0.5.0
func ReplaceControlCodes ¶ added in v0.3.0
ReplaceControlCodes applies our control code replacements to the line.
Types ¶
type ColorLevel ¶ added in v0.4.0
type ColorLevel int
ColorLevel represents the ANSI color level supported by the terminal.
const ( // None represents a terminal that does not support color at all. ColorLevelNone ColorLevel = 0 // Basic represents a terminal with basic 16 color support. ColorLevelBasic ColorLevel = 1 // Ansi256 represents a terminal with 256 color support. ColorLevelAnsi256 ColorLevel = 2 // Ansi16m represents a terminal with full true color support. ColorLevelAnsi16m ColorLevel = 3 )
type ConnectionConfig ¶
type IRCConnection ¶ added in v0.4.0
type IRCConnection interface { // SendLine sends an IRC protocol line, given without \r\n SendLine(string) error // GetLine reads and returns an IRC protocol line, stripping the \r\n GetLine() (string, error) // Disconnect closes the connection, interrupting GetLine(); it must be // concurrency-safe and idempotent. Disconnect() RemoteAddr() net.Addr }
IRCConnection is an abstract IRC connection.
func NewConnection ¶
func NewConnection(config ConnectionConfig) (conn IRCConnection, err error)
func NewIRCWebSocket ¶ added in v0.4.0
func NewIRCWebSocket(wsUrl, origin string, tlsConfig *tls.Config) (IRCConnection, error)
type IRCWebSocket ¶ added in v0.4.0
type IRCWebSocket struct {
// contains filtered or unexported fields
}
func (*IRCWebSocket) Disconnect ¶ added in v0.4.0
func (w *IRCWebSocket) Disconnect()
func (*IRCWebSocket) GetLine ¶ added in v0.4.0
func (w *IRCWebSocket) GetLine() (string, error)
func (*IRCWebSocket) RemoteAddr ¶ added in v0.4.0
func (w *IRCWebSocket) RemoteAddr() net.Addr
func (*IRCWebSocket) SendLine ¶ added in v0.4.0
func (w *IRCWebSocket) SendLine(line string) error
type Socket ¶
type Socket struct {
// contains filtered or unexported fields
}
Socket appropriately buffers IRC lines.
func ConnectSocket ¶
ConnectSocket connects to the given host/port and starts our receivers if appropriate.
func MakeSocket ¶ added in v0.2.0
MakeSocket makes a socket from the given connection.
func (*Socket) Disconnect ¶
func (s *Socket) Disconnect()
Disconnect severs our connection to the server.
func (*Socket) RemoteAddr ¶ added in v0.4.0
type Transcript ¶ added in v0.4.0
func NewTranscript ¶ added in v0.4.0
func NewTranscript(filename string) (result *Transcript, err error)
func (*Transcript) Close ¶ added in v0.4.0
func (t *Transcript) Close() error
Click to show internal directories.
Click to hide internal directories.