mirror of
https://github.com/PretendoNetwork/nex-go.git
synced 2025-04-02 11:02:14 -04:00
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.
31 lines
566 B
Go
31 lines
566 B
Go
package nex
|
|
|
|
import (
|
|
"bytes"
|
|
"strings"
|
|
)
|
|
|
|
// DataHolder represents a generic data holder
|
|
type DataHolder struct {
|
|
Name string
|
|
Length uint32
|
|
DataLength uint32
|
|
Data []byte
|
|
}
|
|
|
|
// NewStationURL returns a new station URL string
|
|
func NewStationURL(protocol string, JSON map[string]string) string {
|
|
var URLBuffer bytes.Buffer
|
|
|
|
URLBuffer.WriteString(protocol + ":/")
|
|
|
|
for key, value := range JSON {
|
|
option := key + "=" + value + ";"
|
|
URLBuffer.WriteString(option)
|
|
}
|
|
|
|
URL := URLBuffer.String()
|
|
URL = strings.TrimRight(URL, ";")
|
|
|
|
return URL
|
|
}
|