Add Group.WriteLine

This commit is contained in:
Jae Kwon
2016-10-28 13:56:31 -07:00
parent 0311042336
commit 5e9c5dc413

View File

@@ -107,6 +107,14 @@ func (g *Group) MaxIndex() int {
return g.maxIndex
}
// Auto appends "\n"
// TODO: Make it halt if space is unavailable
func (g *Group) WriteLine(line string) error {
_, err := g.Head.Write([]byte(line + "\n"))
return err
}
// NOTE: g.Head must be closed separately
func (g *Group) Close() error {
g.ticker.Stop()
return nil