telnet

package module
v0.0.0-...-9f1f843 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: Apache-2.0 Imports: 13 Imported by: 1

README

Telnet

The telnet server is meant for debugging, which needs to comply with Redis standard ( https://redis.io/topics/protocol ) for interoperability. This means you can use redis-cli with the tsxdb telnet server for testing and debugging.

In order to go into Redis-mode, send "COMMAND" as first (before auth) if the cli does not already to this for you.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InputLine

type InputLine string

type Instance

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

func New

func New(opts *Opts) *Instance

func (*Instance) Listen

func (instance *Instance) Listen() error

func (*Instance) Listener

func (instance *Instance) Listener() net.Listener

func (*Instance) Serve

func (instance *Instance) Serve(w tel.Writer, r tel.Reader)

func (*Instance) ServeTELNET

func (instance *Instance) ServeTELNET(ctx tel.Context, w tel.Writer, r tel.Reader)

func (*Instance) Server

func (instance *Instance) Server() *tel.Server

func (*Instance) SetListener

func (instance *Instance) SetListener(listener net.Listener)

func (*Instance) SetServer

func (instance *Instance) SetServer(server *tel.Server)

func (*Instance) Shutdown

func (instance *Instance) Shutdown() error

type Mode

type Mode string
const ModePlain Mode = "PLAIN" // auth
const ModeRedis Mode = "REDIS" // *x $y zzzz => *1 $4 auth

type Opts

type Opts struct {
	Host       string
	Port       int
	AuthToken  string
	ServerHost string
	ServerPort int
}

func NewOpts

func NewOpts() *Opts

type Session

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

func NewSession

func NewSession(instance *Instance) *Session

func (*Session) Handle

func (session *Session) Handle(typedLine InputLine) (err error)

func (*Session) SetMode

func (session *Session) SetMode(mode Mode)

func (*Session) SetWriter

func (session *Session) SetWriter(writer tel.Writer)

func (*Session) Write

func (session *Session) Write(s string) error

func (*Session) WriteErrMessage

func (session *Session) WriteErrMessage(err error) error

Jump to

Keyboard shortcuts

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