stimmtausch: Index | Files

package connection

import ""


Package Files

connection.go log.go output.go

type Connection Uses

type Connection struct {

    // Whether or not the server is connected.
    Connected bool
    // contains filtered or unexported fields

conn stores all connection settings

func NewConnection Uses

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 Uses

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 Uses

func (c *Connection) Close() error

Close closes the connection and all open files.

func (*Connection) GetConnectionName Uses

func (c *Connection) GetConnectionName() string

GetConnectionName gets the name of the connection (the connectStr, usually).

func (*Connection) GetDisplayName Uses

func (c *Connection) GetDisplayName() string

GetDisplayName gets the world's display name.

func (*Connection) Open Uses

func (c *Connection) Open() error

Open opens the connection and all output files.

func (*Connection) Write Uses

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

Write sends data to the connection via the FIFO file

Package connection imports 16 packages (graph) and is imported by 1 packages. Updated 2020-08-14. Refresh now. Tools for package owners.