X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/blobdiff_plain/d9bc63a10d0978d9a5222cf7be74044e55f409b7..fd740bc499ebc6d3a381479316f74cdc736d02de:/hotline/field.go diff --git a/hotline/field.go b/hotline/field.go index 4c760d5..65ff394 100644 --- a/hotline/field.go +++ b/hotline/field.go @@ -92,8 +92,8 @@ func NewField(fieldType [2]byte, data []byte) Field { return f } -// fieldScanner implements bufio.SplitFunc for parsing byte slices into complete tokens -func fieldScanner(data []byte, _ bool) (advance int, token []byte, err error) { +// FieldScanner implements bufio.SplitFunc for parsing byte slices into complete tokens +func FieldScanner(data []byte, _ bool) (advance int, token []byte, err error) { if len(data) < minFieldLen { return 0, nil, nil } @@ -122,7 +122,7 @@ func (f *Field) DecodeInt() (int, error) { } func (f *Field) DecodeObfuscatedString() string { - return string(encodeString(f.Data)) + return string(EncodeString(f.Data)) } // DecodeNewsPath decodes the field data to a news path. @@ -185,7 +185,7 @@ func (f *Field) Write(p []byte) (int, error) { return minFieldLen + dataSize, nil } -func getField(id [2]byte, fields *[]Field) *Field { +func GetField(id [2]byte, fields *[]Field) *Field { for _, field := range *fields { if id == field.Type { return &field