minigo

package module
v0.0.0-...-f17c367 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: GPL-3.0 Imports: 14 Imported by: 0

README

☎ minigo

From Minitel in Golang with ❤

Overview

Minigo provides an SDK to build a Minitel server over:

  • ✅ WebSockets
  • ✅ Serial Modem V.23 (Hayes)
  • ❌ TCP

Teletel Standard

The Teletel Standard is ported to the Go language. The basic set of commands is located within teletel.go, the constants are located in consts.go.

Documentation

Index

Constants

View Source
const (
	NoAck = iota
	AckRouleau
	AckPage
	AckMinuscule
	AckMajuscule
	AckPCEStart
	AckPCEStop
	AckClavierEtendu
	AckClavierStandard
)
View Source
const (
	InvalidDefinition = iota
	InvalidInit
	InvalidData
	ClosedConnection
	Unreachable
	Unsupported
)
View Source
const (
	ResolutionSimple = iota
	ResolutionDouble
)
View Source
const (
	ColonnesSimple = 40
	LignesSimple   = 25
	ColonnesDouble = ColonnesSimple / 2
	LignesDouble   = LignesSimple / 2
)
View Source
const (
	Livre        = 0x23
	Dollar       = 0x24
	Diese        = 0x26
	Paragraphe   = 0x27
	FlecheGauche = 0x2C
	FlecheHaut   = 0x2D
	FlecheDroite = 0x2E
	FlecheBas    = 0x2F
	Degre        = 0x30
	PlusOuMoins  = 0x31
	Division     = 0x38
	UnQuart      = 0x3C
	UnDemi       = 0x3D
	TroisQuart   = 0x3E
	OeMajuscule  = 0x6A
	OeMinuscule  = 0x7A
	Beta         = 0x7B
)

1 Mode Vidéotex

1.2.3 Codage des caractères visualisables Jeu G0 => alphanumérique (voir p.100) Jeu G1 => semi-graphique (voir p.101 et 102) Jeu G2 => complément à G0 (voir p.103) Les caractères du jeu G2 sont obtenus si précédés du code SS2 (0x19). On peut les afficher directement en utilisant printSpecialChar(byte b) :

View Source
const (
	AccentGrave       = 0x41
	AccentAigu        = 0x42
	AccentCirconflexe = 0x43
	Trema             = 0x48
	Cedille           = 0x4B
)

Les diacritiques ne peuvent pas être affichés seuls. printSpecialChar(byte b) n'aura donc aucun effet ici.

View Source
const (
	CaractereNoir    = 0x40
	CaractereRouge   = 0x41
	CaractereVert    = 0x42
	CaractereJaune   = 0x43
	CaractereBleu    = 0x44
	CaractereMagenta = 0x45
	CaractereCyan    = 0x46
	CaractereBlanc   = 0x47
)
View Source
const (
	FondNoir    = 0x50 // Pour éviter d'avoir cet espace à l'écran, une autre solution (dans ce cas le caractère sera noir), est de mettre en oeuvre le fond inversé.
	FondRouge   = 0x51 // Par exemple :
	FondVert    = 0x52 // minitel.attributs(CARACTERE_VERT);
	FondJaune   = 0x53 // minitel.attributs(INVERSION_FOND);
	FondBleu    = 0x54 // minitel.print("J'ECRIS ICI MON TEXTE");
	FondMagenta = 0x55 // minitel.attributs(FOND_NORMAL);
	FondCyan    = 0x56
	FondBlanc   = 0x57
)

Couleur de fond En mode texte, l'espace (0x20) est l'élément déclencheur du changement de couleur de fond (voir p.93). Ce changement est valide jusqu'à la fin d'une rangée.

View Source
const (
	GrandeurNormale = 0x4C // Non utilisable en mode graphique
	DoubleHauteur   = 0x4D // Non utilisable en mode graphique
	DoubleLargeur   = 0x4E // Non utilisable en mode graphique
	DoubleGrandeur  = 0x4F // Non utilisable en mode graphique
)

Taille

View Source
const (
	Clignotement = 0x48
	Fixe         = 0x49
)

Clignotement ou fixité

View Source
const (
	Masquage   = 0x58
	Demasquage = 0x5F
)

Début et fin de masquage

View Source
const (
	FinLignage   = 0x59
	DebutLignage = 0x5A // En mode texte, l'espace (0x20) marque le début d'une zone de lignage. C'est l'élément déclencheur (voir p.93).
)

Début ou fin de lignage

View Source
const (
	FondNormal    = 0x5C // Non utilisable en mode graphique
	InversionFond = 0x5D // Non utilisable en mode graphique
)

Fond inversé ou normal

View Source
const (
	Bs = 0x08 // BackSpace : Déplacement du curseur d'un emplacement de caractère à gauche.
	Ht = 0x09 // Horizontal Tab : Déplacement du curseur d'un emplacement de caractère à droite.
	Lf = 0x0A // Line Feed : Déplacement du curseur d'un emplacement de caractère vers le bas.
	Vt = 0x0B // Vertical Tab : Déplacement du curseur d'un emplacement de caractère vers le haut.
	Cr = 0x0D // Carriage Return : Retour du curseur au début de la rangée courante.
)

1.2.5 Fonctions de mise en page (voir p.94)

View Source
const (
	Rs  = 0x1E // Record Separator : Retour du curseur en première position de la rangée 01. Ce code est un séparateur explicite d'article.
	Ff  = 0x0C // Form Feed : Retour du curseur en première position de la rangée 01 avec effacement complet de l'écran.
	Us  = 0x1F // Unit Separator : Séparateur de sous-article.
	Can = 0x18 // Cancel : Remplissage à partir de la position courante du curseur et jusqu'à la fin de la rangée par des espaces du jeu courant ayant l'état courant des attributs. La position courante du curseur n'est pas déplacée.
)

Les fonctions de type CSI sont développées à l'intérieur de la classe Minitel (plus bas).

View Source
const (
	Rep = 0x12 // Repetition : Permet de répéter le dernier caractère visualisé avec les attributs courants de la position active d'écriture.
	Nul = 0x00 // Null :
	Sp  = 0x20 // Space : Séparateur de zone possédant les mêmes attributs
	Del = 0x7F // Delete :
	Bel = 0x07 // Bell : Provoque l'émission d'un signal sonore
)

1.2.6 Autres fonctions (voir p.98) 1.2.6.1 Fonctions diverses :

View Source
const (
	So  = 0x0E // Shift Out : Accès au jeu G1. => Mode semi-graphique
	Si  = 0x0F // Shift In : Accès au jeu G0.  => Mode alphanumérique
	Ss2 = 0x19 // Single Shift 2 : Appel d'un caractère unique du jeu G2.
	Esc = 0x1B // Escape : Echappement et accès à la grille C1.
)

1.2.6.3 Fonctions d'extension de code

View Source
const (
	CursorOn  = 0x11 // Visualisation de la position active du curseur (curseur actif).
	CursorOff = 0x14 // Arrêt de la visualisation de la position active (curseur inactif).
)

1.2.6.4 Visualisation du curseur

View Source
const (
	Special      = 0x13
	Envoi        = 0x1341
	Retour       = 0x1342
	Repetition   = 0x1343
	Guide        = 0x1344
	Annulation   = 0x1345
	Sommaire     = 0x1346
	Correction   = 0x1347
	Suite        = 0x1348
	ConnexionFin = 0x1349
)

6 Séquences émises par les touches de fonction en mode Vidéotex ou Mixte (voir p.123)

View Source
const (
	ToucheFlecheHaut        = 0x1B5B41
	SuppressionLigne        = 0x1B5B4D
	ToucheFlecheBas         = 0x1B5B42
	InsertionLigne          = 0x1B5B4C
	ToucheFlecheDroite      = 0x1B5B43
	DebutInsertionCaractere = 0x1B5B3468
	FinInsertionCaractere   = 0x1B5B346C
	ToucheFlecheGauche      = 0x1B5B44
	SupressionCaractere     = 0x1B5B50
)

7 Codes et séquences émis par les touches de gestion du curseur et d'édition en mode Vidéotex ou Mixte (voir p.124)

View Source
const (
	CodeEmissionEcran    = 0x50
	CodeEmissionClavier  = 0x51
	CodeEmissionModem    = 0x52
	CodeEmissionPrise    = 0x53
	CodeReceptionEcran   = 0x58
	CodeReceptionClavier = 0x59
	CodeReceptionModem   = 0x5A
	CodeReceptionPrise   = 0x5B
)

1 Généralités (voir p.134)

View Source
const (
	AiguillageOff = 0x60
	AiguillageOn  = 0x61
)

3 Commandes d'aiguillages et de blocage des modules 3.2 Format des commandes (voir p.135)

View Source
const (
	To   = 0x62
	From = 0x63
)

3.4 Demande de statut d'aiguillages des modules

View Source
const (
	Prog          = 0x6B
	StatusVitesse = 0x74
)

8 Commandes relatives à la prise (voir p.141)

View Source
const (
	PCE  = 0x44
	Nack = 0x15
	Syn  = 0x16
)

Procédure de correction d'erreur

View Source
const (
	Start      = 0x69
	Stop       = 0x6A
	Minuscules = 0x45 // Mode minuscules / majuscules du clavier
)

11 Commandes relatives à plusieurs modules (voir p.143)

View Source
const (
	Mixte1  = 0x327D
	Mixte2  = 0x327E
	Telinfo = 0x317D
)

12 Commandes Protocole relatives au changement de standard (voir p.144)

View Source
const (
	Pro1 = 0x39
	Pro2 = 0x3A
	Pro3 = 0x3B
)

A ranger

View Source
const (
	Terminal       = 0x71
	Fonctionnement = 0x73
	Vitesse        = 0x75
	Protocole      = 0x77
)
View Source
const (
	StatusClavier    = 0x72
	RepStatusClavier = 0x73
)
View Source
const (
	NoOp = iota - 50
	DisconnectOp
	QuitOp
	EnvoiOp
	SommaireOp
	AnnulationOp
	RetourOp
	SuiteOp
	RepetitionOp
	GuideOp
	CorrectionOp
)
View Source
const ByteDurAt1200Bd = 8333 * time.Microsecond

1 byte, is 8 bits and 2 bits (start and stop) 1 byte = 10 symbols

View Source
const CacheSize = 16
View Source
const CharTable = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_xabcdefghijklmnopqrstuvwxyz"

Correspondance ASCII / Videotex

View Source
const Csi = 0x1B5B

Echappement vers la norme ISO 6429

View Source
const Eten = 0x41 // Clavier en mode étendu

9 Commandes relatives au clavier (voir p.141)

View Source
const MaxSubPerMinute = 5
View Source
const ModemReadTimeout = 30 * time.Second
View Source
const NackTimer = 1140 * time.Millisecond
View Source
const ParityBitPosition = 7
View Source
const Reset = 0x7F

13 L'état initial du minitel 13.2 Sur réception d'une commande de reset

View Source
const Rouleau = 0x43 // Ecran en mode rouleau

10 Commandes relatives à l'écran (voir p.142)

View Source
const Sub = 0x1A

Renvoyé par le Minitel pour informer d'erreurs de parité

Variables

This section is empty.

Functions

func AckPCE

func AckPCE(data []byte) (ack bool, next bool)

func ApplyPCE

func ApplyPCE(in []byte) (out [][]byte)

func ApplyParity

func ApplyParity(in []byte) (out []byte)

func BitReadAt

func BitReadAt(b byte, i int) bool

func BitWriteAt

func BitWriteAt(b byte, pos int, value bool) byte

func CheckByteParity

func CheckByteParity(b byte) (byte, error)

func DecodeAccent

func DecodeAccent(keyBuffer []byte) rune

func EncodeAttribute

func EncodeAttribute(attribute byte) (buf []byte)

func EncodeAttributes

func EncodeAttributes(attributes ...byte) (buf []byte)

func EncodeCharToVideotex

func EncodeCharToVideotex(c byte) byte

func EncodeMessage

func EncodeMessage(msg string) (buf []byte)

func EncodeRune

func EncodeRune(r rune) []byte

func EncodeSpecial

func EncodeSpecial(r rune) []byte

func EncodeSprintf

func EncodeSprintf(format string, a ...any) []byte

func GetByteHigh

func GetByteHigh(w int) byte

func GetByteLow

func GetByteLow(w int) byte

func GetByteWithParity

func GetByteWithParity(b byte) byte

func GetCleanLine

func GetCleanLine() (buf []byte)

func GetCleanLineFromCursor

func GetCleanLineFromCursor() (buf []byte)

func GetCleanLineToCursor

func GetCleanLineToCursor() (buf []byte)

func GetCleanNItemsFromCursor

func GetCleanNItemsFromCursor(n int) (buf []byte)

func GetCleanNRowsFromCursor

func GetCleanNRowsFromCursor(n int) (buf []byte)

func GetCleanScreen

func GetCleanScreen() (buf []byte)

func GetCleanScreenFromCursor

func GetCleanScreenFromCursor() (buf []byte)

func GetCleanScreenToCursor

func GetCleanScreenToCursor() (buf []byte)

func GetCursorOff

func GetCursorOff() byte

func GetCursorOn

func GetCursorOn() byte

func GetHLine

func GetHLine(row, col, len int, t LineType) (buf []byte)

func GetMoveCursorAt

func GetMoveCursorAt(row, col int) (buf []byte)

func GetMoveCursorDown

func GetMoveCursorDown(n int) (buf []byte)

func GetMoveCursorLeft

func GetMoveCursorLeft(n int) (buf []byte)

func GetMoveCursorReturn

func GetMoveCursorReturn(n int) (buf []byte)

func GetMoveCursorRight

func GetMoveCursorRight(n int) (buf []byte)

func GetMoveCursorUp

func GetMoveCursorUp(n int) (buf []byte)

func GetPCEBlock

func GetPCEBlock(buf []byte) []byte

func GetPCode

func GetPCode(i int) []byte

func GetProCode

func GetProCode(pro byte) ([]byte, error)

func GetRect

func GetRect(row, col, width, height int) (buf []byte)

func GetRepeatRune

func GetRepeatRune(r rune, n int) (buf []byte)

func GetRequestPCE

func GetRequestPCE() []byte

func GetSubArticle

func GetSubArticle(content []byte, x, y int, res uint) (buf []byte)

func GetSynFrame

func GetSynFrame(blockId byte, block []byte) []byte

func GetTextZone

func GetTextZone(text string, attributes ...byte) (buf []byte)

func GetVLine

func GetVLine(row, col, len int, t LineType) (buf []byte)

func GetWord

func GetWord(word int) []byte

func IsAccent

func IsAccent(b byte) bool

func IsByteEven

func IsByteEven(b byte) bool

func IsPosInBounds

func IsPosInBounds(x, y int, resolution uint) (bool, error)

func ReadEntryBytes

func ReadEntryBytes(entryBytes []byte) (done bool, pro bool, value int32, err error)

func ValidChar

func ValidChar(c byte) bool

func ValidRune

func ValidRune(r rune) bool

func WrapperGenerique

func WrapperGenerique(text string, size int) (wrapped []string)

func WrapperLargeurDouble

func WrapperLargeurDouble(text string) []string

func WrapperLargeurNormale

func WrapperLargeurNormale(text string) []string

Types

type ATCommand

type ATCommand struct {
	Command string
	Reply   string
}

type AckStack

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

func NewAckStack

func NewAckStack() *AckStack

func (*AckStack) Add

func (a *AckStack) Add(ack AckType)

func (*AckStack) Empty

func (a *AckStack) Empty() bool

func (*AckStack) Len

func (a *AckStack) Len() int

func (*AckStack) Pop

func (a *AckStack) Pop() (ack AckType, ok bool)

type AckType

type AckType uint

type Cache

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

func NewCache

func NewCache() *Cache

func (*Cache) Add

func (c *Cache) Add(msg []byte)

func (*Cache) Empty

func (c *Cache) Empty() bool

func (*Cache) Get

func (c *Cache) Get(id byte) []byte

func (*Cache) Has

func (c *Cache) Has(id byte) bool

func (*Cache) Reset

func (c *Cache) Reset()

type Connector

type Connector interface {
	Init() error

	Write([]byte) error

	Read() ([]byte, error)

	Connected() bool

	Disconnect()
}

type ConnectorError

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

func (*ConnectorError) Code

func (*ConnectorError) Error

func (ce *ConnectorError) Error() string

func (*ConnectorError) Raw

func (ce *ConnectorError) Raw() error

type ConnectorErrorCode

type ConnectorErrorCode int

type ConnexionFinFunc

type ConnexionFinFunc func(mntl *Minitel) int

type Form

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

func (*Form) ActivateFirst

func (f *Form) ActivateFirst()

func (*Form) ActivateNext

func (f *Form) ActivateNext()

func (*Form) ActivatePrev

func (f *Form) ActivatePrev()

func (*Form) AppendInput

func (f *Form) AppendInput(name string, input *Input)

func (*Form) AppendKeyActive

func (f *Form) AppendKeyActive(key rune)

func (*Form) CorrectionActive

func (f *Form) CorrectionActive()

func (*Form) HideActive

func (f *Form) HideActive()

func (*Form) HideAll

func (f *Form) HideAll()

func (*Form) InitAll

func (f *Form) InitAll()

func (*Form) ResetActive

func (f *Form) ResetActive()

func (*Form) ResetAll

func (f *Form) ResetAll()

func (*Form) ToMap

func (f *Form) ToMap() map[string]string

func (*Form) UnHideActive

func (f *Form) UnHideActive()

func (*Form) UnHideAll

func (f *Form) UnHideAll()

func (*Form) ValueActive

func (f *Form) ValueActive() string

type InitFunc

type InitFunc func(mntl *Minitel, inputs *Form, initData map[string]string) int

type Input

type Input struct {
	Value []byte
	// contains filtered or unexported fields
}

func NewInput

func NewInput(m *Minitel, refRow, refCol int, width, height int, dots bool) *Input

func (*Input) Activate

func (i *Input) Activate()

Activate moves the cursor to its actual position and let it on

func (*Input) AppendKey

func (i *Input) AppendKey(r rune)

AppendKey appends a new Rune to the Value array

func (*Input) Correction

func (i *Input) Correction()

Correction removes the last key, on screen and within Value

func (*Input) Deactivate

func (i *Input) Deactivate()

func (*Input) Hide

func (i *Input) Hide()

Hide clears the input on the Minitel screen, but it keeps the Value member complete

func (*Input) Init

func (i *Input) Init()

Init displays the input empty

func (*Input) Reset

func (i *Input) Reset()

Reset clears both the input on screen and Value

func (*Input) UnHide

func (i *Input) UnHide()

UnHide reveals the input on screen

type KeyboardFunc

type KeyboardFunc func(mntl *Minitel, inputs *Form, key rune)

type LineType

type LineType byte

Constantes pour h_line et v_line

const (
	Bottom  LineType = 0x5F
	HCenter LineType = 0x60
	Left    LineType = 0x7B
	VCenter LineType = 0x7C
	Right   LineType = 0x7D
	Top     LineType = 0x7E
)

type List

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

func NewList

func NewList(mntl *Minitel, row, col, maxRow, brk int) *List

func (*List) AppendItem

func (l *List) AppendItem(key, value string)

func (*List) Display

func (l *List) Display()

type ListEnum

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

func NewListEnum

func NewListEnum(mntl *Minitel, items []string) *ListEnum

func (*ListEnum) AppendItem

func (l *ListEnum) AppendItem(item string)

func (*ListEnum) Display

func (l *ListEnum) Display()

func (*ListEnum) SetEntryHeight

func (l *ListEnum) SetEntryHeight(h int)

func (*ListEnum) SetXY

func (l *ListEnum) SetXY(x, y int)

type Matrix

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

func NewMatrix

func NewMatrix(rows, cols int) *Matrix

func (*Matrix) ActivateDown

func (m *Matrix) ActivateDown()

func (*Matrix) ActivateFirst

func (m *Matrix) ActivateFirst()

func (*Matrix) ActivateLeft

func (m *Matrix) ActivateLeft()

func (*Matrix) ActivateNext

func (m *Matrix) ActivateNext()

func (*Matrix) ActivatePrev

func (m *Matrix) ActivatePrev()

func (*Matrix) ActivateRight

func (m *Matrix) ActivateRight()

func (*Matrix) ActivateUp

func (m *Matrix) ActivateUp()

func (*Matrix) AppendKeyActive

func (m *Matrix) AppendKeyActive(key rune)

func (*Matrix) CorrectionActive

func (m *Matrix) CorrectionActive()

func (*Matrix) HideActive

func (m *Matrix) HideActive()

func (*Matrix) HideAll

func (m *Matrix) HideAll()

func (*Matrix) InitAll

func (m *Matrix) InitAll()

func (*Matrix) ResetActive

func (m *Matrix) ResetActive()

func (*Matrix) ResetAll

func (m *Matrix) ResetAll()

func (*Matrix) SetInput

func (m *Matrix) SetInput(row, col int, input *Input)

func (*Matrix) ToArray

func (m *Matrix) ToArray() []string

func (*Matrix) ToMap

func (m *Matrix) ToMap() map[string]string

func (*Matrix) UnHideActive

func (m *Matrix) UnHideActive()

func (*Matrix) UnHideAll

func (m *Matrix) UnHideAll()

func (*Matrix) ValueActive

func (m *Matrix) ValueActive() string

type Minitel

type Minitel struct {
	In chan int32
	// contains filtered or unexported fields
}

func NewMinitel

func NewMinitel(conn Connector, parity bool, source string, connLost *prometheus.CounterVec, group *sync.WaitGroup) *Minitel

func (*Minitel) ClavierEtendu

func (m *Minitel) ClavierEtendu() error

func (*Minitel) ClavierStandard

func (m *Minitel) ClavierStandard() error

func (*Minitel) CleanLine

func (m *Minitel) CleanLine() error

func (*Minitel) CleanNRowsFrom

func (m *Minitel) CleanNRowsFrom(row, col, n int) error

func (*Minitel) CleanScreen

func (m *Minitel) CleanScreen() error

func (*Minitel) CleanScreenFrom

func (m *Minitel) CleanScreenFrom(row, col int) error

func (*Minitel) CleanScreenFromCursor

func (m *Minitel) CleanScreenFromCursor() error

func (*Minitel) CursorOff

func (m *Minitel) CursorOff() error

func (*Minitel) CursorOn

func (m *Minitel) CursorOn() error

func (*Minitel) CursorOnXY

func (m *Minitel) CursorOnXY(col, row int) error

func (*Minitel) HLine

func (m *Minitel) HLine(row, col, len int, t LineType)

func (*Minitel) MinusculeOff

func (m *Minitel) MinusculeOff() error

func (*Minitel) MinusculeOn

func (m *Minitel) MinusculeOn() error

func (*Minitel) ModeG0

func (m *Minitel) ModeG0() error

func (*Minitel) ModeG1

func (m *Minitel) ModeG1() error

func (*Minitel) ModeG2

func (m *Minitel) ModeG2() error

func (*Minitel) MoveCursorAt

func (m *Minitel) MoveCursorAt(lineId, colId int) error

func (*Minitel) MoveCursorDown

func (m *Minitel) MoveCursorDown(n int) error

func (*Minitel) MoveCursorLeft

func (m *Minitel) MoveCursorLeft(n int) error

func (*Minitel) MoveCursorRight

func (m *Minitel) MoveCursorRight(n int) error

func (*Minitel) MoveCursorUp

func (m *Minitel) MoveCursorUp(n int) error

func (*Minitel) Rect

func (m *Minitel) Rect(row, col, width, height int)

func (*Minitel) Reset

func (m *Minitel) Reset() error

func (*Minitel) Return

func (m *Minitel) Return(n int) error

func (*Minitel) RouleauOff

func (m *Minitel) RouleauOff() error

func (*Minitel) RouleauOn

func (m *Minitel) RouleauOn() error

func (*Minitel) Send

func (m *Minitel) Send(buf []byte) error

func (*Minitel) SendVDT

func (m *Minitel) SendVDT(filename string) error

func (*Minitel) Serve

func (m *Minitel) Serve()

func (*Minitel) VLine

func (m *Minitel) VLine(row, col, len int, t LineType)

func (*Minitel) WriteAttributes

func (m *Minitel) WriteAttributes(attributes ...byte) error

func (*Minitel) WriteBytesAt

func (m *Minitel) WriteBytesAt(lineId, colId int, inBuf []byte) error

func (*Minitel) WriteHelperAt

func (m *Minitel) WriteHelperAt(lineId, colId int, helpText, button string) error

func (*Minitel) WriteHelperLeft

func (m *Minitel) WriteHelperLeft(lineId int, helpText, button string) error

func (*Minitel) WriteHelperRight

func (m *Minitel) WriteHelperRight(lineId int, helpText, button string) error

func (*Minitel) WriteNRunes

func (m *Minitel) WriteNRunes(r rune, n int) error

func (*Minitel) WriteStatusLine

func (m *Minitel) WriteStatusLine(s string) error

func (*Minitel) WriteStringAt

func (m *Minitel) WriteStringAt(lineId, colId int, s string) error

func (*Minitel) WriteStringAtWithAttributes

func (m *Minitel) WriteStringAtWithAttributes(lineId, colId int, s string, attributes ...byte) error

func (*Minitel) WriteStringCenter

func (m *Minitel) WriteStringCenter(lineId int, s string) error

func (*Minitel) WriteStringLeft

func (m *Minitel) WriteStringLeft(lineId int, s string) error

func (*Minitel) WriteStringRight

func (m *Minitel) WriteStringRight(lineId int, s string) error

type Modem

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

func NewModem

func NewModem(portName string, baud int, init []ATCommand, tag string, connAttempt *prometheus.CounterVec) (*Modem, error)

func (*Modem) Connect

func (m *Modem) Connect()

func (*Modem) Connected

func (m *Modem) Connected() bool

func (*Modem) Disconnect

func (m *Modem) Disconnect()

func (*Modem) Init

func (m *Modem) Init() error

func (*Modem) Read

func (m *Modem) Read() ([]byte, error)

func (*Modem) ReadTimeout

func (m *Modem) ReadTimeout(d time.Duration) ([]byte, error)

func (*Modem) RingHandler

func (m *Modem) RingHandler(f func(modem *Modem))

func (*Modem) Serve

func (m *Modem) Serve(forceRing bool)

func (*Modem) SetConnected

func (m *Modem) SetConnected(status bool)

func (*Modem) Write

func (m *Modem) Write(b []byte) error
type NavigationFunc func(mntl *Minitel, inputs *Form) (map[string]string, int)

type Network

type Network struct {
	In  chan byte
	Out chan []byte
	// contains filtered or unexported fields
}

func NewNetwork

func NewNetwork(conn Connector, parity bool, group *sync.WaitGroup, source string) *Network

func (*Network) Connected

func (n *Network) Connected() bool

func (*Network) Serve

func (n *Network) Serve()

type Page

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

func NewPage

func NewPage(name string, mntl *Minitel, initData map[string]string) *Page

func (*Page) Run

func (p *Page) Run() (map[string]string, int)

func (*Page) SetAnnulationFunc

func (p *Page) SetAnnulationFunc(f NavigationFunc)

func (*Page) SetBasFunc

func (p *Page) SetBasFunc(f NavigationFunc)

func (*Page) SetCharFunc

func (p *Page) SetCharFunc(f KeyboardFunc)

func (*Page) SetConnexionFinFunc

func (p *Page) SetConnexionFinFunc(f ConnexionFinFunc)

func (*Page) SetCorrectionFunc

func (p *Page) SetCorrectionFunc(f NavigationFunc)

func (*Page) SetDroiteFunc

func (p *Page) SetDroiteFunc(f NavigationFunc)

func (*Page) SetEnvoiFunc

func (p *Page) SetEnvoiFunc(f NavigationFunc)

func (*Page) SetGaucheFunc

func (p *Page) SetGaucheFunc(f NavigationFunc)

func (*Page) SetGuideFunc

func (p *Page) SetGuideFunc(f NavigationFunc)

func (*Page) SetHautFunc

func (p *Page) SetHautFunc(f NavigationFunc)

func (*Page) SetInitFunc

func (p *Page) SetInitFunc(f InitFunc)

func (*Page) SetRepetitionFunc

func (p *Page) SetRepetitionFunc(f NavigationFunc)

func (*Page) SetRetourFunc

func (p *Page) SetRetourFunc(f NavigationFunc)

func (*Page) SetSommaireFunc

func (p *Page) SetSommaireFunc(f NavigationFunc)

func (*Page) SetSuiteFunc

func (p *Page) SetSuiteFunc(f NavigationFunc)

type Websocket

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

func NewWebsocket

func NewWebsocket(conn *websocket.Conn, ctx context.Context) (*Websocket, error)

func (*Websocket) Connected

func (ws *Websocket) Connected() bool

func (*Websocket) Disconnect

func (ws *Websocket) Disconnect()

func (*Websocket) Init

func (ws *Websocket) Init() error

func (*Websocket) Read

func (ws *Websocket) Read() ([]byte, error)

func (*Websocket) Write

func (ws *Websocket) Write(b []byte) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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