event

package
v0.0.0-...-7feb8d5 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2016 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package event implements types and structures for the telnet out-of-band events.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command struct {
	Byte byte
	// contains filtered or unexported fields
}

Command event

func (*Command) Done

func (e *Command) Done()

func (*Command) Handled

func (e *Command) Handled(h ...bool) bool

func (Command) Type

func (e Command) Type() Type

type Do

type Do struct {
	Opt byte
	// contains filtered or unexported fields
}

Do event (IAC)

func (*Do) Done

func (e *Do) Done()

func (*Do) Handled

func (e *Do) Handled(h ...bool) bool

func (Do) String

func (e Do) String() string

func (Do) Type

func (e Do) Type() Type

type Dont

type Dont struct {
	Opt byte
	// contains filtered or unexported fields
}

Dont event (IAC)

func (*Dont) Done

func (e *Dont) Done()

func (*Dont) Handled

func (e *Dont) Handled(h ...bool) bool

func (Dont) String

func (e Dont) String() string

func (Dont) Type

func (e Dont) Type() Type

type Environment

type Environment struct {
	Option byte
	Env    []string
	// contains filtered or unexported fields
}

func (*Environment) Done

func (e *Environment) Done()

func (*Environment) Handled

func (e *Environment) Handled(h ...bool) bool

func (*Environment) Type

func (e *Environment) Type() Type

type Event

type Event interface {
	// Done indicates the event is handled.
	Done()

	// Handled indicates weather or not the stream already handled the event. If
	// called without arguments it returns the current status, if called with a
	// single argument it updates the status.
	Handled(...bool) bool

	// Type of the event.
	Type() Type
}

Event with a type.

type MSSP

type MSSP struct {
	Status map[string]string
	// contains filtered or unexported fields
}

MSSP MUD Server Status Protocol.

func (*MSSP) Done

func (e *MSSP) Done()

func (*MSSP) Handled

func (e *MSSP) Handled(h ...bool) bool

func (MSSP) Type

func (e MSSP) Type() Type

type NAWS

type NAWS struct {
	Width, Height int
	// contains filtered or unexported fields
}

NAWS Negotiate About Window Size event (IAC)

func (*NAWS) Done

func (e *NAWS) Done()

func (*NAWS) Handled

func (e *NAWS) Handled(h ...bool) bool

func (NAWS) Type

func (e NAWS) Type() Type

type Raw

type Raw struct {
	Bytes []byte
	// contains filtered or unexported fields
}

Raw event

func NewRaw

func NewRaw(b []byte) *Raw

func (*Raw) Done

func (e *Raw) Done()

func (*Raw) Handled

func (e *Raw) Handled(h ...bool) bool

func (Raw) String

func (e Raw) String() string

func (Raw) Type

func (e Raw) Type() Type

type SubNegotiation

type SubNegotiation struct {
	Option byte
	Bytes  []byte
	// contains filtered or unexported fields
}

func NewSubNegotiation

func NewSubNegotiation(option byte, buffer []byte) *SubNegotiation

func (*SubNegotiation) Done

func (e *SubNegotiation) Done()

func (*SubNegotiation) Handled

func (e *SubNegotiation) Handled(h ...bool) bool

func (*SubNegotiation) Type

func (e *SubNegotiation) Type() Type

type TerminalType

type TerminalType struct {
	Option byte
	Name   string
	// contains filtered or unexported fields
}

TerminalType event

func (*TerminalType) Done

func (e *TerminalType) Done()

func (*TerminalType) Handled

func (e *TerminalType) Handled(h ...bool) bool

func (TerminalType) Type

func (e TerminalType) Type() Type

type Type

type Type int

Type of event

const (
	RawEvent Type = iota

	// Negotiate About Window Size (rfc1073)
	NawsEvent

	// Telnet Terminal-Type Option (rfc1090)
	TerminalTypeEvent

	// Sub-negotiation (rfc854)
	SubNegotiateEvent

	// Interpret as Command (rfc854)
	CommandEvent

	// Telnet Environment Option (rfc1408, rfc1571)
	EnvironmentEvent

	// Mud Server Status Protocol (rfc854, rfc855 extension)
	MSSPEvent

	// Zenith Mud Protocol (rfc854 extension)
	ZMPEvent

	// Interpret as Command (rfc854)
	DoEvent
	DontEvent
	WillEvent
	WontEvent

	ErrorEvent
	NullEvent
	UnknownEvent
)

Event types

type Will

type Will struct {
	Opt byte
	// contains filtered or unexported fields
}

Will event (IAC)

func (*Will) Done

func (e *Will) Done()

func (*Will) Handled

func (e *Will) Handled(h ...bool) bool

func (Will) String

func (e Will) String() string

func (Will) Type

func (e Will) Type() Type

type Wont

type Wont struct {
	Opt byte
	// contains filtered or unexported fields
}

Wont event (IAC)

func (*Wont) Done

func (e *Wont) Done()

func (*Wont) Handled

func (e *Wont) Handled(h ...bool) bool

func (Wont) String

func (e Wont) String() string

func (Wont) Type

func (e Wont) Type() Type

type ZMP

type ZMP struct {
	Options []string
	// contains filtered or unexported fields
}

ZMP Zenith Mud Protocol.

func (*ZMP) Done

func (e *ZMP) Done()

func (*ZMP) Handled

func (e *ZMP) Handled(h ...bool) bool

func (ZMP) Type

func (e ZMP) Type() Type

Jump to

Keyboard shortcuts

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