v0.0.0-...-aadac20 Latest Latest

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 16 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


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.

func (*Connection) Write

func (c *Connection) Write(in []byte) (int, error)

Write sends data to the connection via the FIFO file

Jump to

Keyboard shortcuts

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