diff options
author | xengineering <me@xengineering.eu> | 2023-06-26 18:37:16 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-06-27 15:04:33 +0200 |
commit | 8715603ce1a713d1c8841382bb965cb55948fedd (patch) | |
tree | c3af42979a443168d85dd194b063308417ad0f42 /xmpp/encoder.go | |
parent | a8a6c31d862ec1d491fc76ed21c46d7e0b35b7f2 (diff) | |
download | limox-8715603ce1a713d1c8841382bb965cb55948fedd.tar limox-8715603ce1a713d1c8841382bb965cb55948fedd.tar.zst limox-8715603ce1a713d1c8841382bb965cb55948fedd.zip |
xmpp: Remove unused code
This is part of the refactoring. Details of the old implementation
should be looked up by older commits.
Diffstat (limited to 'xmpp/encoder.go')
-rw-r--r-- | xmpp/encoder.go | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/xmpp/encoder.go b/xmpp/encoder.go deleted file mode 100644 index 434ca68..0000000 --- a/xmpp/encoder.go +++ /dev/null @@ -1,79 +0,0 @@ -package xmpp - -import ( - "crypto/tls" - "encoding/xml" - "os" -) - -type encoder struct { - tcp *xml.Encoder - debug *xml.Encoder -} - -func newEncoder(conn *tls.Conn) encoder { - e := encoder{ - xml.NewEncoder(conn), - xml.NewEncoder(os.Stdout), - } - e.tcp.Indent("", "") - e.debug.Indent("C: ", " ") - - return e -} - -func (e *encoder) encodeNow(t xml.Token) error { - err := e.encode(t) - if err != nil { - return err - } - - err = e.flush() - if err != nil { - return err - } - - return nil -} - -func (e *encoder) encode(t xml.Token) error { - err := e.tcp.EncodeToken(t) - if err != nil { - return err - } - - err = e.debug.EncodeToken(t) - if err != nil { - return err - } - - return nil -} - -func (e *encoder) flush() error { - err := e.tcp.Flush() - if err != nil { - return err - } - - err = e.debug.Flush() - if err != nil { - return err - } - - return nil -} - -func (e *encoder) Close() error { - err := e.tcp.Close() - if err != nil { - return err - } - - err = e.debug.Close() - if err != nil { - return err - } - - return nil -} |