1
0
mirror of https://gitlab.crans.org/nounous/ghostream.git synced 2024-12-22 20:52:20 +00:00

Comment telnet package

This commit is contained in:
Yohann D'ANELLO 2020-10-13 00:31:47 +02:00
parent ee76951854
commit 95fcedf2fa

View File

@ -9,6 +9,8 @@ import (
) )
var ( var (
// TODO Config should not be exported
// Cfg contains the different options of the telnet package, see below
Cfg *Options Cfg *Options
currentMessage *string currentMessage *string
) )
@ -22,6 +24,7 @@ type Options struct {
Delay int Delay int
} }
// Serve starts the telnet server and listen to clients
func Serve(config *Options) { func Serve(config *Options) {
Cfg = config Cfg = config
@ -70,7 +73,7 @@ func asciiChar(pixel byte) string {
return asciiChars[(255-pixel)/23] return asciiChars[(255-pixel)/23]
} }
// ServeAsciiArt starts a telnet server that send all packets as ASCII Art // ServeAsciiArt send all packets received by ffmpeg as ASCII Art to telnet clients
func ServeAsciiArt(reader io.ReadCloser) { func ServeAsciiArt(reader io.ReadCloser) {
if !Cfg.Enabled { if !Cfg.Enabled {
_ = reader.Close() _ = reader.Close()