Documentation
¶
Index ¶
- Constants
- Variables
- func ReadBinary(reader io.Reader) (result interface{}, err error)
- func ReadCsv(reader io.Reader) ([]packet.RocketPacket, error)
- func ReadCsvFile(csvPath string) ([]packet.RocketPacket, error)
- func WriteBinary(writer io.Writer, delimiter uint16, packet interface{}) (err error)
- func WriteCommandBinary(writer io.Writer, cmdPacket packet.CommandPacket) error
- type ErrUnknownStart
- type SaveDataHandler
Constants ¶
View Source
const ( StartDelimSize = 2 ChecksumSize = 2 RocketPacketStart uint16 = 's' AcknowledgeStart uint16 = 0xface CommandStart uint16 = 0xface )
Variables ¶
View Source
var ErrInvalidChecksum = e.New("packet checksum validation failed")
Functions ¶
func ReadBinary ¶
ReadBinary reads and unmarshall the next packet from a raw binary io.Reader
func ReadCsv ¶
func ReadCsv(reader io.Reader) ([]packet.RocketPacket, error)
ReadCsv reads and transforms all the data from the reader to a list of packet.RocketPacket.
IMPORTANT: Do NOT use on large files. Instead use csvutil.Decoder and process the file line by line (don't store the whole file in memory).
func ReadCsvFile ¶
func ReadCsvFile(csvPath string) ([]packet.RocketPacket, error)
ReadCsvFile reads a CSV file and returns a list of packet.RocketPacket.
IMPORTANT: Do NOT use on large files. Instead use csvutil.Decoder and process the file line by line (don't store the whole file in memory).
func WriteBinary ¶
WriteBinary TODO doc
func WriteCommandBinary ¶
func WriteCommandBinary(writer io.Writer, cmdPacket packet.CommandPacket) error
WriteCommandBinary TODO doc
Types ¶
type ErrUnknownStart ¶
type ErrUnknownStart struct {
Char uint16
}
func (ErrUnknownStart) Error ¶
func (e ErrUnknownStart) Error() string
type SaveDataHandler ¶
func (*SaveDataHandler) OnData ¶
func (s *SaveDataHandler) OnData(packets []packet.RocketPacket)
Click to show internal directories.
Click to hide internal directories.