nex-go/compression.go
RedDuckss 686a59737c Properly send fragmented packets + godoc comments
Server now properly splits the packet payload into multiple fragments if needed.

Server settings now properly get defaults.

Added the basis for compression support, though it doesn't do anything right now.

Removed unused NEX type structs.

And finally, fixed all godoc and other linting issues.
2018-09-26 21:42:48 -04:00

27 lines
758 B
Go

package nex
// DummyCompression represents no compression
type DummyCompression struct{}
// Compress returns the data as-is
func (compression *DummyCompression) Compress(data []byte) []byte {
return data
}
// Decompress returns the data as-is
func (compression *DummyCompression) Decompress(data []byte) []byte {
return data
}
// ZLibCompression represents ZLib compression
type ZLibCompression struct{}
// Compress returns the data as-is (needs to be updated to return ZLib compressed data)
func (compression *ZLibCompression) Compress(data []byte) []byte {
return data
}
// Decompress returns the data as-is (needs to be updated to return ZLib decompressed data)
func (compression *ZLibCompression) Decompress(data []byte) []byte {
return data
}