Documentation ¶
Overview ¶
line 1 "ext/parser.rl"
Index ¶
- Variables
- func A2E(src []byte) (res []byte)
- func E2A(src []byte) (res []byte)
- func E2D(src []byte) (res []byte)
- type Client
- func (c *Client) Connect(addr string) (chan string, error)
- func (c *Client) ConnectTLS(addr string, tslconfig *tls.Config) (chan string, error)
- func (c *Client) OnError([]byte, int) error
- func (c *Client) OnTN3270DeviceTypeIs(model []byte, name []byte)
- func (c *Client) OnTN3270DeviceTypeReject(byte)
- func (c *Client) OnTN3270DeviceTypeRequest([]byte, []byte, []byte)
- func (c *Client) OnTN3270FunctionsIs([]byte)
- func (c *Client) OnTN3270FunctionsRequest(functions []byte)
- func (c *Client) OnTN3270SendDeviceType()
- func (c *Client) OnTNArgCommand(b byte, arg byte)
- func (c *Client) OnTNCommand(b byte)
- func (c *Client) Send(s string) chan string
- func (c *Client) SendRecv(s string) string
- type ErrorHandler
- type Handler
- type MultiHandler
- func (h *MultiHandler) OnTN3270AID(b byte)
- func (h *MultiHandler) OnTN3270Command(b byte)
- func (h *MultiHandler) OnTN3270EUA(addr int)
- func (h *MultiHandler) OnTN3270IC()
- func (h *MultiHandler) OnTN3270Message()
- func (h *MultiHandler) OnTN3270PT()
- func (h *MultiHandler) OnTN3270RA(addr int, b byte)
- func (h *MultiHandler) OnTN3270SBA(addr int)
- func (h *MultiHandler) OnTN3270SF(b byte)
- func (h *MultiHandler) OnTN3270SFE(b byte)
- func (h *MultiHandler) OnTN3270Text(text []byte)
- func (h *MultiHandler) OnTN3270WCC(b byte)
- type Parser
- type Request
- type ResponseWriter
- type Screen
- type Server
- type TN3270Handler
- type TN3270NegoHandler
- type TNHandler
- type TextTN3270Handler
- func (h *TextTN3270Handler) OnTN3270AID(byte)
- func (h *TextTN3270Handler) OnTN3270Command(byte)
- func (h *TextTN3270Handler) OnTN3270EUA(int)
- func (h *TextTN3270Handler) OnTN3270IC()
- func (h *TextTN3270Handler) OnTN3270Message()
- func (h *TextTN3270Handler) OnTN3270PT()
- func (h *TextTN3270Handler) OnTN3270RA(int, byte)
- func (h *TextTN3270Handler) OnTN3270SBA(int)
- func (h *TextTN3270Handler) OnTN3270SF(byte)
- func (h *TextTN3270Handler) OnTN3270SFE(byte)
- func (h *TextTN3270Handler) OnTN3270Text(text []byte)
- func (h *TextTN3270Handler) OnTN3270WCC(byte)
- func (h *TextTN3270Handler) String() string
- type VerboseErrorHandler
- type VerboseTN3270Handler
- func (h *VerboseTN3270Handler) OnTN3270AID(b byte)
- func (h *VerboseTN3270Handler) OnTN3270Command(b byte)
- func (h *VerboseTN3270Handler) OnTN3270EUA(addr int)
- func (h *VerboseTN3270Handler) OnTN3270IC()
- func (h *VerboseTN3270Handler) OnTN3270Message()
- func (h *VerboseTN3270Handler) OnTN3270PT()
- func (h *VerboseTN3270Handler) OnTN3270RA(addr int, b byte)
- func (h *VerboseTN3270Handler) OnTN3270SBA(addr int)
- func (h *VerboseTN3270Handler) OnTN3270SF(b byte)
- func (h *VerboseTN3270Handler) OnTN3270SFE(b byte)
- func (h *VerboseTN3270Handler) OnTN3270Text(b []byte)
- func (h *VerboseTN3270Handler) OnTN3270WCC(b byte)
- type VirtualScreenTN3270Handler
- func (h *VirtualScreenTN3270Handler) OnTN3270AID(b byte)
- func (h *VirtualScreenTN3270Handler) OnTN3270Command(b byte)
- func (h *VirtualScreenTN3270Handler) OnTN3270EUA(addr int)
- func (h *VirtualScreenTN3270Handler) OnTN3270IC()
- func (h *VirtualScreenTN3270Handler) OnTN3270Message()
- func (h *VirtualScreenTN3270Handler) OnTN3270PT()
- func (h *VirtualScreenTN3270Handler) OnTN3270RA(addr int, b byte)
- func (h *VirtualScreenTN3270Handler) OnTN3270SBA(addr int)
- func (h *VirtualScreenTN3270Handler) OnTN3270SF(b byte)
- func (h *VirtualScreenTN3270Handler) OnTN3270SFE(b byte)
- func (h *VirtualScreenTN3270Handler) OnTN3270Text(b []byte)
- func (h *VirtualScreenTN3270Handler) OnTN3270WCC(b byte)
- func (h *VirtualScreenTN3270Handler) String() string
Constants ¶
This section is empty.
Variables ¶
var ErrServerClosed = errors.New("Server closed")
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ConnectTLS ¶
func (*Client) OnTN3270DeviceTypeIs ¶
func (*Client) OnTN3270DeviceTypeReject ¶
func (*Client) OnTN3270DeviceTypeRequest ¶
func (*Client) OnTN3270FunctionsIs ¶
func (*Client) OnTN3270FunctionsRequest ¶
func (*Client) OnTN3270SendDeviceType ¶
func (c *Client) OnTN3270SendDeviceType()
func (*Client) OnTNArgCommand ¶
func (*Client) OnTNCommand ¶
type ErrorHandler ¶
type Handler ¶
type Handler interface { ServeWelcomeScreen(ResponseWriter) ServeTN3270(ResponseWriter, *Request) }
Handler implements the Handler interface can be registered to serve a particular path or subtree in the HTTP server.
ServeHTTP should write reply headers and data to the ResponseWriter and then return. Returning signals that the request is finished and that the HTTP server can move on to the next request on the connection.
type MultiHandler ¶
type MultiHandler struct {
// contains filtered or unexported fields
}
MultiHandler is a TN3270 handler that wraps several handlers into one all handlers are called for each function
func (*MultiHandler) OnTN3270AID ¶
func (h *MultiHandler) OnTN3270AID(b byte)
func (*MultiHandler) OnTN3270Command ¶
func (h *MultiHandler) OnTN3270Command(b byte)
func (*MultiHandler) OnTN3270EUA ¶
func (h *MultiHandler) OnTN3270EUA(addr int)
func (*MultiHandler) OnTN3270IC ¶
func (h *MultiHandler) OnTN3270IC()
func (*MultiHandler) OnTN3270Message ¶
func (h *MultiHandler) OnTN3270Message()
func (*MultiHandler) OnTN3270PT ¶
func (h *MultiHandler) OnTN3270PT()
func (*MultiHandler) OnTN3270RA ¶
func (h *MultiHandler) OnTN3270RA(addr int, b byte)
func (*MultiHandler) OnTN3270SBA ¶
func (h *MultiHandler) OnTN3270SBA(addr int)
func (*MultiHandler) OnTN3270SF ¶
func (h *MultiHandler) OnTN3270SF(b byte)
func (*MultiHandler) OnTN3270SFE ¶
func (h *MultiHandler) OnTN3270SFE(b byte)
func (*MultiHandler) OnTN3270Text ¶
func (h *MultiHandler) OnTN3270Text(text []byte)
func (*MultiHandler) OnTN3270WCC ¶
func (h *MultiHandler) OnTN3270WCC(b byte)
type Parser ¶
func NewParser ¶
func NewParser(tnh TNHandler, tn3270negoh TN3270NegoHandler, tn3270h TN3270Handler, errorh ErrorHandler) Parser
type ResponseWriter ¶
type Server ¶
type Server struct { Addr string // TCP address to listen on, ":telnet" if empty Handler Handler // handler to invoke TLSConfig *tls.Config // contains filtered or unexported fields }
func (*Server) ListenAndServe ¶
ListenAndServe listens on the TCP network address s.Addr and then calls Serve to handle requests on incoming connections. If s.Addr is blank, ":telnet" is used.
func (*Server) ListenAndServeTLS ¶
func (*Server) Serve ¶
Serve accepts incoming connections on the Listener l, creating a new service goroutine for each. The service goroutines read requests and then call s.Handler to reply to them.
type TN3270Handler ¶
type TN3270NegoHandler ¶
type TextTN3270Handler ¶
type TextTN3270Handler struct { HandleMessage func(string) // contains filtered or unexported fields }
TextTN3270Handler is a handler that keeps only track of text display
func (*TextTN3270Handler) OnTN3270AID ¶
func (h *TextTN3270Handler) OnTN3270AID(byte)
func (*TextTN3270Handler) OnTN3270Command ¶
func (h *TextTN3270Handler) OnTN3270Command(byte)
func (*TextTN3270Handler) OnTN3270EUA ¶
func (h *TextTN3270Handler) OnTN3270EUA(int)
func (*TextTN3270Handler) OnTN3270IC ¶
func (h *TextTN3270Handler) OnTN3270IC()
func (*TextTN3270Handler) OnTN3270Message ¶
func (h *TextTN3270Handler) OnTN3270Message()
func (*TextTN3270Handler) OnTN3270PT ¶
func (h *TextTN3270Handler) OnTN3270PT()
func (*TextTN3270Handler) OnTN3270RA ¶
func (h *TextTN3270Handler) OnTN3270RA(int, byte)
func (*TextTN3270Handler) OnTN3270SBA ¶
func (h *TextTN3270Handler) OnTN3270SBA(int)
func (*TextTN3270Handler) OnTN3270SF ¶
func (h *TextTN3270Handler) OnTN3270SF(byte)
func (*TextTN3270Handler) OnTN3270SFE ¶
func (h *TextTN3270Handler) OnTN3270SFE(byte)
func (*TextTN3270Handler) OnTN3270Text ¶
func (h *TextTN3270Handler) OnTN3270Text(text []byte)
func (*TextTN3270Handler) OnTN3270WCC ¶
func (h *TextTN3270Handler) OnTN3270WCC(byte)
func (*TextTN3270Handler) String ¶
func (h *TextTN3270Handler) String() string
type VerboseErrorHandler ¶
type VerboseErrorHandler struct { }
type VerboseTN3270Handler ¶
type VerboseTN3270Handler struct { }
VerboseTN3270Handler is a handler that prints all the TN3270 commands to stdout
func (*VerboseTN3270Handler) OnTN3270AID ¶
func (h *VerboseTN3270Handler) OnTN3270AID(b byte)
func (*VerboseTN3270Handler) OnTN3270Command ¶
func (h *VerboseTN3270Handler) OnTN3270Command(b byte)
func (*VerboseTN3270Handler) OnTN3270EUA ¶
func (h *VerboseTN3270Handler) OnTN3270EUA(addr int)
func (*VerboseTN3270Handler) OnTN3270IC ¶
func (h *VerboseTN3270Handler) OnTN3270IC()
func (*VerboseTN3270Handler) OnTN3270Message ¶
func (h *VerboseTN3270Handler) OnTN3270Message()
func (*VerboseTN3270Handler) OnTN3270PT ¶
func (h *VerboseTN3270Handler) OnTN3270PT()
func (*VerboseTN3270Handler) OnTN3270RA ¶
func (h *VerboseTN3270Handler) OnTN3270RA(addr int, b byte)
func (*VerboseTN3270Handler) OnTN3270SBA ¶
func (h *VerboseTN3270Handler) OnTN3270SBA(addr int)
func (*VerboseTN3270Handler) OnTN3270SF ¶
func (h *VerboseTN3270Handler) OnTN3270SF(b byte)
func (*VerboseTN3270Handler) OnTN3270SFE ¶
func (h *VerboseTN3270Handler) OnTN3270SFE(b byte)
func (*VerboseTN3270Handler) OnTN3270Text ¶
func (h *VerboseTN3270Handler) OnTN3270Text(b []byte)
func (*VerboseTN3270Handler) OnTN3270WCC ¶
func (h *VerboseTN3270Handler) OnTN3270WCC(b byte)
type VirtualScreenTN3270Handler ¶
type VirtualScreenTN3270Handler struct { HandleMessage func(string) // contains filtered or unexported fields }
VirtualScreenTN3270Handler is a TN3270 handler that simulates a terminal and keeps track of the terminal display as if it was a GUI
func (*VirtualScreenTN3270Handler) OnTN3270AID ¶
func (h *VirtualScreenTN3270Handler) OnTN3270AID(b byte)
func (*VirtualScreenTN3270Handler) OnTN3270Command ¶
func (h *VirtualScreenTN3270Handler) OnTN3270Command(b byte)
func (*VirtualScreenTN3270Handler) OnTN3270EUA ¶
func (h *VirtualScreenTN3270Handler) OnTN3270EUA(addr int)
func (*VirtualScreenTN3270Handler) OnTN3270IC ¶
func (h *VirtualScreenTN3270Handler) OnTN3270IC()
func (*VirtualScreenTN3270Handler) OnTN3270Message ¶
func (h *VirtualScreenTN3270Handler) OnTN3270Message()
func (*VirtualScreenTN3270Handler) OnTN3270PT ¶
func (h *VirtualScreenTN3270Handler) OnTN3270PT()
func (*VirtualScreenTN3270Handler) OnTN3270RA ¶
func (h *VirtualScreenTN3270Handler) OnTN3270RA(addr int, b byte)
func (*VirtualScreenTN3270Handler) OnTN3270SBA ¶
func (h *VirtualScreenTN3270Handler) OnTN3270SBA(addr int)
func (*VirtualScreenTN3270Handler) OnTN3270SF ¶
func (h *VirtualScreenTN3270Handler) OnTN3270SF(b byte)
func (*VirtualScreenTN3270Handler) OnTN3270SFE ¶
func (h *VirtualScreenTN3270Handler) OnTN3270SFE(b byte)
func (*VirtualScreenTN3270Handler) OnTN3270Text ¶
func (h *VirtualScreenTN3270Handler) OnTN3270Text(b []byte)
func (*VirtualScreenTN3270Handler) OnTN3270WCC ¶
func (h *VirtualScreenTN3270Handler) OnTN3270WCC(b byte)
func (*VirtualScreenTN3270Handler) String ¶
func (h *VirtualScreenTN3270Handler) String() string