simulator

package
v1.8.8 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Overview

Package simulator provides a rudimentary simulation of a JNOS BBS, which can be used for testing JNOS-based services without connecting to a real BBS. This simulation implements only the features of JNOS that are used by package jnos.

To use this simulator, call Start to start it, then create a jnos/telnet Transport connecting to simulator.ListenAddress. Call the simulator's Stop method when it is no longer needed.

Index

Constants

View Source
const ListenAddress = "localhost:63425"

ListenAddress is the address to which the simulator listens. Connect to it with a telnet transport. Any login and password is accepted.

Variables

This section is empty.

Functions

This section is empty.

Types

type Simulator

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

Simulator is a JNOS simulator.

func Start

func Start(messages map[string]io.Reader, home string) (s *Simulator, err error)

Start starts a new JNOS simulator. It returns a handle to the simulator, which can be examined after the interaction to see what messages were sent through the simulated BBS. The messages available to read from the simulation are those in the supplied messages files, which can be mbox-style files or transcripts of an actual JNOS session that read messages. home is the name of the default message area. The simulator's Stop method should be called when it is no longer needed.

func (*Simulator) Sent

func (s *Simulator) Sent() []string

Sent returns the list of messages sent through the simulated BBS.

func (*Simulator) Stop

func (s *Simulator) Stop()

Stop stops the simulator.

Jump to

Keyboard shortcuts

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