Documentation
¶
Overview ¶
Package recordio implements the Mesos variant of RecordIO framing, whereby each record is prefixed by a line that indicates the length of the record in decimal ASCII. The bytes of the record immediately follow the length-line. Zero-length records are allowed.
Example ¶
package main
import (
"fmt"
"io"
"strings"
"github.com/mesos/mesos-go/api/v1/lib/recordio"
)
func main() {
var (
r = recordio.NewReader(strings.NewReader("6\nhello 0\n6\nworld!"))
lines []string
)
for {
fr, err := r.ReadFrame()
if err == io.EOF {
break
}
if err != nil {
panic(err)
}
lines = append(lines, string(fr))
}
fmt.Println(lines)
}
Output: [hello world!]
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Opt ¶ added in v0.0.4
type Opt func(*reader)
func MaxMessageSize ¶ added in v0.0.4
MaxMessageSize returns a functional option that configures the internal Scanner's buffer and max token (message) length, in bytes.
Click to show internal directories.
Click to hide internal directories.