Documentation
¶
Index ¶
- type Connection
- func (c *Connection) AddOutput(name string, w io.WriteCloser, supportsANSI bool)
- func (c *Connection) Close() error
- func (c *Connection) GetConnectionName() string
- func (c *Connection) GetDisplayName() string
- func (c *Connection) GetMaxBuffer() uint
- func (c *Connection) Open() error
- func (c *Connection) Write(in []byte) (int, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct { // Whether or not the server is connected. Connected bool // contains filtered or unexported fields }
conn stores all connection settings
func NewConnection ¶
func NewConnection(name string, w config.World, s config.Server, cfg *config.Config, env *signal.Dispatcher) (*Connection, error)
NewConnection creates a new conneciton with the given world. One can also specify whether or not to use SSL, allow insecure SSL certs, and whether to log all output by default.
func (*Connection) AddOutput ¶
func (c *Connection) AddOutput(name string, w io.WriteCloser, supportsANSI bool)
AddOutput creates an output struct with the given io.WriteCloser. This can be a file, of course, but many other things as well, including the buffer that the UI uses.
func (*Connection) Close ¶
func (c *Connection) Close() error
Close closes the connection and all open files.
func (*Connection) GetConnectionName ¶
func (c *Connection) GetConnectionName() string
GetConnectionName gets the name of the connection (the connectStr, usually).
func (*Connection) GetDisplayName ¶
func (c *Connection) GetDisplayName() string
GetDisplayName gets the world's display name.
func (*Connection) GetMaxBuffer ¶
func (c *Connection) GetMaxBuffer() uint
GetMaxBuffer returns the max buffer lengh for a server.
func (*Connection) Open ¶
func (c *Connection) Open() error
Open opens the connection and all output files.