go-linereader

Golang package that reads lines from an io.Reader and puts them onto a channel.

  • 所有者: mitchellh/go-linereader
  • 平台:
  • 许可证: MIT License
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

go-linereader

go-linereader (Golang package: linereader) is a package for Go that
breaks up the input from an io.Reader into multiple lines. It is
a lot like bufio.Scanner, except you can specify timeouts that will push
"lines" through after a certain amount of time. This lets you read lines,
but return any data if a line isn't updated for some time.

Installation and Usage

Install using go get github.com/mitchellh/go-linereader.

Full documentation is available at
http://godoc.org/github.com/mitchellh/go-linereader

Below is an example of its usage ignoring errors:

// Assume r is some set io.Reader. Perhaps a file, network, anything.
var r io.Reader

// Initialize the line reader
lr := linereader.New(r)

// Get all the lines
for line := <-lr.Ch {
	// Do something with the line. This line will have the line separator
	// removed.
}

主要指标

概览
名称与所有者mitchellh/go-linereader
主编程语言Go
编程语言Go (语言数: 1)
平台
许可证MIT License
所有者活动
创建于2014-10-05 17:11:03
推送于2019-02-13 21:33:13
最后一次提交2019-02-13 13:33:12
发布数0
用户参与
星数67
关注者数3
派生数5
提交数5
已启用问题?
问题数2
打开的问题数0
拉请求数1
打开的拉请求数0
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?