telnet

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2019 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Telnet

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

Telnet represents a telnet connection

func New

func New(ctx context.Context, config config.Telnet) (*Telnet, error)

New creates a new telnet connect

func (*Telnet) Connect

func (t *Telnet) Connect(ctx context.Context) error

Connect establishes a new connection with Telnet

func (*Telnet) Disconnect

func (t *Telnet) Disconnect(ctx context.Context) error

Disconnect stops a previously started connection with Telnet. If called while a connection is not active, returns nil

func (*Telnet) IsConnected

func (t *Telnet) IsConnected() bool

IsConnected returns if a connection is established

func (*Telnet) Send

func (t *Telnet) Send(ctx context.Context, source string, author string, channelID int, message string) error

Send attempts to send a message through Telnet.

func (*Telnet) Subscribe

func (t *Telnet) Subscribe(ctx context.Context, onMessage func(source string, author string, channelID int, message string)) error

Subscribe listens for new events on telnet

Jump to

Keyboard shortcuts

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