aboutsummaryrefslogtreecommitdiff
path: root/transfer.go
diff options
context:
space:
mode:
authorJeff Halter <868228+jhalter@users.noreply.github.com>2021-07-28 18:21:52 -0700
committerJeff Halter <868228+jhalter@users.noreply.github.com>2021-07-28 14:21:52 -0700
commit22c599abc18895f73e96095f35b71cf3357d41b4 (patch)
tree482ef57d386c955692ea43c43e4655b3c3763499 /transfer.go
parent71c56068adca18f76ebee86355f000a3e51d3127 (diff)
Move code to hotline dir
Diffstat (limited to 'transfer.go')
-rw-r--r--transfer.go49
1 files changed, 0 insertions, 49 deletions
diff --git a/transfer.go b/transfer.go
deleted file mode 100644
index ecbe324..0000000
--- a/transfer.go
+++ /dev/null
@@ -1,49 +0,0 @@
-package hotline
-
-import (
- "bytes"
- "encoding/binary"
- "errors"
-)
-
-type Transfer struct {
- Protocol [4]byte // "HTXF" 0x48545846
- ReferenceNumber [4]byte // Unique ID generated for the transfer
- DataSize [4]byte // File size
- RSVD [4]byte // Not implemented in Hotline Protocol
-}
-
-func NewReadTransfer(b []byte) (Transfer, error) {
- r := bytes.NewReader(b)
- var transfer Transfer
-
- if err := binary.Read(r, binary.BigEndian, &transfer); err != nil {
- return transfer, err
- }
-
- // 0x48545846 (HTXF) is the only supported transfer protocol
- if transfer.Protocol != [4]byte{0x48, 0x54, 0x58, 0x46} {
- return transfer, errors.New("invalid protocol")
- }
-
- return transfer, nil
-}
-//
-//type FolderTransfer struct {
-// Protocol [4]byte // "HTXF" 0x48545846
-// ReferenceNumber [4]byte // Unique ID generated for the transfer
-// DataSize [4]byte // File size
-// RSVD [4]byte // Not implemented in Hotline Protocol
-// Action [2]byte // Next file action
-//}
-//
-//func ReadFolderTransfer(b []byte) (FolderTransfer, error) {
-// r := bytes.NewReader(b)
-// var decodedEvent FolderTransfer
-//
-// if err := binary.Read(r, binary.BigEndian, &decodedEvent); err != nil {
-// return decodedEvent, err
-// }
-//
-// return decodedEvent, nil
-//}